Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Perl Forth interpreter

by gwadej (Chaplain)
on May 29, 2009 at 12:53 UTC ( #766851=note: print w/replies, xml ) Need Help??


in reply to Perl Forth interpreter

As an old Forth programmer, I'm happy to see this. Although, I probably would have done the core loop much differently.

Forth normally reads the input stream one word (\S+) at a time. This allows immediate words (like '"', '."', ':', and '(') to read the input directly instead of delegating that to the input function. This also allows removal of the state logic in dispatch.

If I remember correctly, the first Forth I learned on had about a dozen words defined in assembly and the rest were defined in Forth. Your experiment reminds me of how little it took to get a beginning Forth system up and running.

Thanks for the memories.<grin/>

G. Wade

Replies are listed 'Best First'.
Re^2: Perl Forth interpreter
by GrandFather (Saint) on May 30, 2009 at 01:02 UTC

    It was very largely for the memories that I did it! And yes, the inner loop is not right at all, but I'd forgotten almost as much about Forth as I once knew. If I were starting over I'd do it differently. :-D

    Major deficiencies are that it doesn't provide dictionary management, it doesn't manage compile/interpret switching properly, it doesn't facilitate variables, ...


    True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://766851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2021-05-12 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (125 votes). Check out past polls.

    Notices?