Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #22799

Re: The most elegant Forth interpreter.

Newsgroups comp.lang.forth
Date 2013-05-19 13:58 -0700
References (12 earlier) <cqmdndLNpLy25ArMnZ2dnUVZ_uKdnZ2d@supernews.com> <ea377538-9443-4ff2-947a-7aba5834d05d@googlegroups.com> <8OqdnZLIxuEzVwrMnZ2dnUVZ_qadnZ2d@supernews.com> <fcd65b1e-644f-442a-8f2b-856662dd288f@googlegroups.com> <0NOdnXRxkpMGCgXMnZ2dnUVZ_sidnZ2d@supernews.com>
Message-ID <c01ea495-1298-41e4-9f5e-6dabddfe247a@googlegroups.com> (permalink)
Subject Re: The most elegant Forth interpreter.
From visualforth@rocketmail.com

Show all headers | View raw


On Sunday, May 19, 2013 5:12:59 AM UTC-4, Andrew Haley wrote:
> visualforth.com wrote:
> > On Saturday, May 18, 2013 2:38:38 PM UTC-4, Andrew Haley wrote:
> >> ... given an existing Forth I can tell you how to do it.
> > "given an existing Forth" - what do you need to be given?
> > Would 4e4th be okay? The 4e4th core is written at 
> > http://www.forth-ev.de/repos/4e4th/4e-core430G2553.s43
> > Please tell how to do it.

> Ouch.  That Forth isn't written in Forth, but in assembly language.
> This is going to make it painful to change.  Why do people do this?
> :-(

I guess this is for two reasons:
1. To get the resulting Forth work
2. To get the resulting Forth run fast

> And you'll have to create a table at the bottom of memory that
> contains a pointer to every word.  That's going to be the tricky part:
> the idea is that CREATE allocates a table index and creates the entry.

That's how I have built my own virtual engine in 1978 using 6502 machine code, before I heard about Forth. So that's not a problem for me - may be I should try this with a 6502 micro because that's one of the micros I am familiar with (the other one is the RX2000).

> For the high level code, consider something like this:

With other words - it will be better to write my own Forth!

> Depending on how powerful this assembler is, it might be possible to
> create a macro that does it.

I guess the best thing is to use our cross-assembler written in Forth and add those words which will be needed.

A while ago I had the idea it would be great to have three layers of Forth: 

The lowest layer is the machine dependent layer, which can use a variety of methods to be programmed (different kinds of threading etc). There should be a minimum word set which is really standardized. This layer would make it possible to port different Forth versions on different microprocessors without the need of using machine language or assembler. 

The next layer is a high level Forth layer which should be standardized, but can be available in different versions, too. Having the lowest layer available, this layer is machine independent and can be run on any microcomputer for which the lowest layer is available. 

The third layer is the application layer which is written for the specific application. Because of having a standardized medium layer, this application can be run on all Forth systems following this strategy - only hardware specific parts have to be ported, which shouldn't be a problem in this case. 

To not to confuse with a lot of different Forth versions, all applications and all standard deviations should run under special vocabularies, i.e. vocabulary names - this will be the fence between the standard and the extension. 

May be there is such a Forth available, I don't know. It would help newcomers to use applications which are already written instead of starting from scratch.

DB

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: The most elegant Forth interpreter. dirk.bruehl@usa.net - 2013-05-16 18:24 -0700
  Re: The most elegant Forth interpreter. Paul Rubin <no.email@nospam.invalid> - 2013-05-17 19:02 -0700
    Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-17 21:33 -0700
      Re: The most elegant Forth interpreter. Paul Rubin <no.email@nospam.invalid> - 2013-05-17 22:32 -0700
        Re: The most elegant Forth interpreter. Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-18 07:50 -0500
          Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-18 10:56 -0700
            Re: The most elegant Forth interpreter. Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-18 13:38 -0500
              Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-18 12:49 -0700
                Re: The most elegant Forth interpreter. Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-19 04:12 -0500
                Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-19 13:58 -0700
                Re: The most elegant Forth interpreter. Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-20 04:01 -0500
        Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-18 10:47 -0700
          Re: The most elegant Forth interpreter. Bernd Paysan <bernd.paysan@gmx.de> - 2013-05-19 01:23 +0200
        Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-18 18:44 -0700
          Re: The most elegant Forth interpreter. Paul Rubin <no.email@nospam.invalid> - 2013-05-19 20:41 -0700
            Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-19 23:25 -0700
      Re: The most elegant Forth interpreter. "Bill Leary" <Bill_Leary@msn.com> - 2013-05-18 06:15 -0400
        Re: The most elegant Forth interpreter. visualforth@rocketmail.com - 2013-05-18 10:34 -0700
  Re: The most elegant Forth interpreter. Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-05-18 05:30 -0500

csiph-web