I'm developing a new lisp-dialect and want to use neko as the VM.

I'm wondering about the following:

1. How do I best implement a read-(compile)-eval loop?

2. What is the best way to tie in a new language? Should I "cross-compile" to the high-level language or go straight to byte-code?

For a first prototype, I guess you should do the following :

a) generate a .neko file on hard drive that is the translation of your lisp program (or input)

b) call nekoc to compile it

c) load the resulting module to execute it

The problem here is that each execution will be independant so if you compile each statement independantly, you will not be able to share variables.

More difficult, the neko compiler has a read-compile-eval loop (the Console mode, run using nekoc -console), so one solution might be to modify it, for example by using your own language parser that will construct a Neko AST. The console sources are available in neko/src/neko/Console.nml , but to directly interact with the Neko compiler you will have to use NekoML.

Nicolas

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to