Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Is interpre...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 21 Topic 3960 of 4053
Post > Topic >>

Re: Is interpret/compile the wrong distinction?

by John Doty <jpd@[EMAIL PROTECTED] > Mar 23, 2008 at 10:48 PM

Jonah Thomas wrote:

> It isn't necessarily more complex for the compiler. But you have to
> think -- sometimes we want to parse strings and do something to them in
> midline.
> 
>  ... [ ' DUP ] LITERAL ....
> 
>  ... ['] DUP ....
> 
> It isn't enough to tell the compiler to compile strings into the current
> word. There are other things to do with them.
> 
> Print a string now.         .(
> Print it later.             ."
> Get an xt                   [']
> Get a character             [CHAR]
> Maybe print and abort later ABORT"
> Ignore the string now       (
> Etc.
> 
> And then there's
> 
> [ do-something-now ]
> 
> Sometimes we want to execute anything right now, not later when the line
> executes, but now before the rest of the line has compiled.
> 
> And .... POSTPONE IF ....  sometimes we want to take a command that
> would normally happen now and make it happen later.
> 
> You want to build all this into the compiler, and also make the compiler
> extensible? I have some doubts. It isn't trivial to always-compile and
> still do all the things we're used to doing. Somehow you have to decide
> what to give up.
> 
> I think it's possible to get all the results you'd want that way. Like,
> you could have a system to start a new temporary line, and the new one
> executes before the old one. So you could do
> 
> ['] FOO
> 
> on a separate line and have it get compiled and then execute to compile
> FOO's xt as a literal in the previous definition, and then go back to
> compiling the unfinished definition. Each individual line would get
> compiled into the currently-unfinished code or compiled into its own
> routine that gets executed first, depending on which you tell that line
> to do. I started to implement this and got distracted with an income
> opportunity and haven't gotten back to it.
> 
> But usually people who build always-compile systems accept less
> functionality.

No! But I personally will go for less *complexity*.

In LSE, the factors of the system's immediate words are, in effect, the 
metaprogramming toolkit. You don't worry about POSTPONEing anything: you 
just use its (non-immediate) factors. If you need to compute something 
mid definition, you define a word for it and make that immediate. 
There's no loss in functionality at all versus traditional Forth, only a 
loss of cuteness. It's not like it would be difficult to put in POSTPONE 
or [ and ], but why bother? Metaprogramming shouldn't be cute and 
clever: it's usually a bad idea.

-- 
John Doty, Noqsi Aerospace, Ltd.
http://www.noqsi.com/
--
History teaches that logical consistency is neither sufficient nor 
necessary to establish practical, real world truth. Those who attempt to 
use logic for that purpose are abusing it.




 21 Posts in Topic:
Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-23 14:50:35 
Re: Is interpret/compile the wrong distinction?
Elizabeth D Rather <er  2008-03-23 15:06:31 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-23 14:09:50 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 19:23:48 
Re: Is interpret/compile the wrong distinction?
pablo reda <pabloreda@  2008-03-23 16:50:53 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 03:20:31 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-23 22:18:20 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 15:07:47 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-24 12:36:00 
Re: Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-24 01:11:03 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-23 19:34:40 
Re: Is interpret/compile the wrong distinction?
John Doty <jpd@[EMAIL   2008-03-23 22:48:04 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 00:06:20 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 08:21:38 
Re: Is interpret/compile the wrong distinction?
Bruce McFarling <agila  2008-03-24 09:21:32 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 20:08:31 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-23 22:16:20 
Re: Is interpret/compile the wrong distinction?
Josh Grams <josh@[EMAI  2008-03-24 13:00:48 
Re: Is interpret/compile the wrong distinction?
Jonah Thomas <jethomas  2008-03-24 09:36:52 
Re: Is interpret/compile the wrong distinction?
Albert van der Horst <  2008-03-24 15:40:20 
Re: Is interpret/compile the wrong distinction?
anton@[EMAIL PROTECTED]   2008-03-24 13:41:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 7:26:52 CDT 2008.