Martin Percossi a écrit :
Hello neko list,
First, I am very impressed with neko. You've done a fantastic job with it.
Second, I would like to use neko as a basis for creating my own language,
which will be a dynamically-typed language with functional features. In
fact, I'm so lazy that I even want to use nekoml as the language in which
I write my translator (to neko code), simply because that means I can copy
the code you've written and change the syntax as my heart desires (it's
pretty much just cosmetic changes + pattern matching [which is also
defined for nekoml so that's nice!]). It goes without saying that should
this ever get the point of release, credit will be given where it is due.
To this end, I would like some clarification as to the build process for
neko. As I understand it:
1. c files get compiled in order to produce the bytecode interpreter -- so
from this point on, in theory we can run ".n" files
2. standard libraries -- based on C-primitives -- get built.
3. neko, and nekoml are built from nekoml source
4. in the tools directory, we create a "nekoc" and "nekomlc" executable
*from the bootstrap bytecode for the relevant compiler*. NOTE: NOT from
the code built in step 3.
Hi,
This is not exact. The Makefile does the following :
compiler:
(cd src; ${NEKO_EXEC} nekoml -v neko/Main.nml nekoml/Main.nml)
(cd src; ${NEKO_EXEC} nekoc -link ../boot/nekoc.n neko/Main)
(cd src; ${NEKO_EXEC} nekoc -link ../boot/nekoml.n nekoml/Main)
a) run nekoml (using boostrapped compiler) to recompile neko+nekoml
b) use boostrapped nekoc to link neko/Main.n and nekoml/Main.n with all
the modules they are using and replace the previously boostrapped code.
You can use nekoc -link to merge several .n's but there's a limitation
which is that you can't declare functions before using
$loader.loadmodule in a .neko file (you must load all its dependencies
before doing anything else).
Best,
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)