Hi,

I am trying to understand the process of how Neko "bootstraps" itself. I obtained the latest Neko source via CVS and was able to build the neko.exe/dll (running on Windows XP).

However, I am not able to see how the neko compiler (nekoc.exe) is built. From the web site docs and email threads, I understand that neko bootstraps itself via nekoml, but I am not sure how this is accomplished.

Can someone take me through the steps that enables nekoc.exe and nekotools.exe to be built (presumably via nekoml code).

It's a bit complex :)

a) the neko compiler was first written in OCaml, enabling to compile a .neko file to a .n bytecode that can be run by the NekoVM

b) the nekoml compiler was then written in OCaml, which enabled the compilation of .nml files to .neko (and then to .n)

c) at this time, you could write a compiler in NekoML, but you would still need the Neko and NekoML OCaml compilers

d) port both the Neko and NekoML compilers from OCaml to NekoML. That's the most delicate step because at this time you find bugs in the NekoML compiler that need to be fixed twice... until you reach a fixpoint.

e) at this time, you don't need the Neko and NekoML OCaml compilers

The build process is done thanks to a precompiled version of the Neko and NekoML compilers stored in the neko/boot directory. When a new version of the compiler is made, the boot is updated as well.

The most difficult part is when you make a backward-incompatible change in the VM or the bytecode format. That require 3 compilations of the compiler with both old and new VM versions in order to properly update the compilers and check they are correctly working.

BTW: Really cool software. It has taken me a while to understand the potential, but it looks like a very promising project for running multiple scripted languages. Well done!

Thanks !

Nicolas

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

Reply via email to