
Hi - Brace yourself... I work in an environment where FORTH is still used. I've been thinking about writing a G-machine interpreter in FORTH so that one could write Haskell like programs that would compile down and run "graph-reduction" style on the FORTH machine. Many developers think FORTH is nice, but the language is so, shall we say, "terse". I'm curious about what people think about this; having the expressiveness of a Haskell-like language that compiles to this environment might provide the best of both worlds, simple hardware architecture and an advanced programming language. let me know what you think, -andrew

Andrew Harris writes:
Brace yourself... I work in an environment where FORTH is still used.
I've been thinking about writing a G-machine interpreter in FORTH so that one could write Haskell like programs that would compile down and run "graph-reduction" style on the FORTH machine.
let me know what you think,
Nice. Just two questions. Does your FORTH has a decent memory management system, permitting to implement GC? Do you have some idea how to modify the standard threading execution of FORTH in order to have laziness? Jerzy Karczmarczuk

Actually I am very impressed from the FORTH simplicity and efficiency.
I was developing one FORTH system for DOS a couple of years ago and I
think it is very useful for small programs that have to perform low
level/hardware tasks. Unfortunatelly it doesn't scale well for larger
applications. I don't know how well it can be used as G-machine
interpreter but its execution model has a lot of common with STG
machine. In STG each closure has a header word which is a pointer to
its entry code. In FORTH each procedure has a header word which also
points to some entry code. The entry code receives the address of the
entered procedure in special (usually EBX on x86) register just like
in STG (where the used register is ESI). The execution of any FORTH
program is a sequence of jumps from one entry code to another just
like in STG. Of course STG is much more complicated because the
closures are dynamically allocated and there is a garbage collector
too. Thanks to its simple execution model I still think that FORTH is
the fastest interpreted language, just like STG is the fastest virtual
machine for Haskell.
Cheers,
Krasimir
On 6/1/05, Andrew Harris
Hi -
Brace yourself... I work in an environment where FORTH is still used.
I've been thinking about writing a G-machine interpreter in FORTH so that one could write Haskell like programs that would compile down and run "graph-reduction" style on the FORTH machine.
Many developers think FORTH is nice, but the language is so, shall we say, "terse".
I'm curious about what people think about this; having the expressiveness of a Haskell-like language that compiles to this environment might provide the best of both worlds, simple hardware architecture and an advanced programming language.
let me know what you think, -andrew _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I always thought Forth was way cool, but I've never managed to get anything significant written in it. I think that Forth has echoes of the "point-free" style in Haskell, but Haskell is a lot friendlier. Is the Forth environment part of the hardware? If your Forth is just a threaded interpreter written in software then it seems wasteful to compile Haskell down to an interpreted environment. If it's part of the hardware then I think it would be (at the very least) an interesting exercise. Mike
Date: Wed, 1 Jun 2005 17:25:24 -0400 From: Andrew Harris
Reply-To: Andrew Harris Hi -
Brace yourself... I work in an environment where FORTH is still used.
I've been thinking about writing a G-machine interpreter in FORTH so that one could write Haskell like programs that would compile down and run "graph-reduction" style on the FORTH machine.
Many developers think FORTH is nice, but the language is so, shall we say, "terse".
I'm curious about what people think about this; having the expressiveness of a Haskell-like language that compiles to this environment might provide the best of both worlds, simple hardware architecture and an advanced programming language.
let me know what you think, -andrew

Andrew Harris wrote:
I've been thinking about writing a G-machine interpreter in FORTH so that one could write Haskell like programs that would compile down and run "graph-reduction" style on the FORTH machine.
Many developers think FORTH is nice, but the language is so, shall we say, "terse".
I'm curious about what people think about this; having the expressiveness of a Haskell-like language that compiles to this environment might provide the best of both worlds, simple hardware architecture and an advanced programming language.
IMHO Koopman's "TIGRE" (http://www.ece.cmu.edu/~koopman/tigre/) might be a close approximation of what you want. I had some (rather non-serious) experience with Forth, and I had great pleasure reading Koopman's paper on TIGRE. Unfortunately I couldn't find any further development on this topic (although I saw some later Koopman's publications on Forth itself). I guess, only someone "thinking Forth" (as in the Brodie's book) might develop such a thing. Dimitry Golubovsky Middletown, CT
participants (5)
-
Andrew Harris
-
Dimitry Golubovsky
-
karczma@info.unicaen.fr
-
Krasimir Angelov
-
Michael Vanier