Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Another todo: Forth as compiler

3 views
Skip to first unread message

Dan Sugalski

unread,
Feb 19, 2004, 7:53:11 AM2/19/04
to perl6-i...@perl.org
While the actual compiler code is evil, doing all sorts of things it
ought not do with absolute addresses (and therefore non-JITtable),
the forth compiler does work, and will compile things. It ought,
actually, to be able to be integrated in as a compiler.

Your task, if you're interested, is to thump it such that forth.pasm
*can* be loaded in as a compiler module such that you can do:

compile P5, ForthCompiler, "1 2 + ."

and have 3 print out. Should be easy, relatively speaking.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Leopold Toetsch

unread,
Feb 19, 2004, 8:51:09 AM2/19/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:
> While the actual compiler code is evil, doing all sorts of things it
> ought not do with absolute addresses (and therefore non-JITtable),
> the forth compiler does work, and will compile things. It ought,
> actually, to be able to be integrated in as a compiler.

> Your task, if you're interested, is to thump it such that forth.pasm
> *can* be loaded in as a compiler module such that you can do:

> compile P5, ForthCompiler, "1 2 + ."

> and have 3 print out. Should be easy, relatively speaking.

Three Notes WRT that:

1) examples/assembly/nano_forth2.pasm uses PCC to implement such a
compiler. No address hacks, but likely a bit slower.

2) I've checked in the "compreg Sx, Py" opcode, where Py is a Parrot Sub.

3) I'll check in an example soon, how to load and run a compiler
written in C and residing in a shared lib.

I'm just waiting for some ok WRT the platform patch, which I've pending
too.

leo

0 new messages