- some documentation for writing compilers using NekoML+Neko

That's the part I'm looking forward to.  Should speed up my development
in this area considerably... Nicolas, after following your advice, it
really does seem my best be for compiler development would be to use
Neko!

Lee



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nicolas
Cannasse
Sent: 12 March 2006 16:43
To: Neko intermediate language mailing list
Subject: Re: [Neko] OCaml

> Hi,
> 
> I'm just discovering the powerfull OCaml language.
> There already been a question about differences with NekoML, but can
you
> summurize the differences between the two languages, and also the two
VM ?

NekoML is more "light" than OCaml, it include only the Core ML type
system. In particular, it does not include the following ocaml advanced
features :
- local modules , signatures , functors
- polymorphic variants ( `A )
- labels (and optional arguments)
- objects
- native compilation

The syntax is different, it's more C-friendly in NekoML.

The most big difference is that the OCaml VM forget everything about
types in the bytecode. It simply express the different constructs in
terms of array accesses. It's optimized for speed so no runtime check is
performed. It means that any untyped usage can crash the VM :

Obj.magic() := 1;;

Since NekoML is using the NekoVM, it's memory safe. No invalid bytecode
can crash the VM. Also, it enables to have more runtime informations
about values.

In OCaml for example "Some 33" is represented as a array of size 1
containing the integer 33. This is the same runtime representation as
"ref 33" for example.

In NekoML, tagged values also carry a printer, and there is polymorphic
"print" that will display nicely any constructor :

print(Some 1); will then display "Some(1)"

It save debugging time when you want to print some value you don't have
to write a custom printer (only ocaml toplevel can do that
automaticaly).

One important difference also is dynamic loading : Neko is designed so
that every module and C library is dynamicly loaded whereas OCaml favor
static linkage everywhere.

> And, is there something equivalent, or planned to be, to Cammlp4 in
neko ?

Stream parsers are already part of NekoML.
There is no planned syntactic extensibility.

> And also another (new for me) feature that I discovered in OCaml : the
> reversible debugger ! can this be implemented easily (is it planned
though ?)
> in Neko ?

The reversible debugger is not implemented in OCaml for every platform.
In particular, it doesn't work on Windows. It's of course feasible to
have such tool in Neko, but not planned.

> and the last question : what are the future plans for neko btw ?

Right now for 1.3 and later :

- Just-In-Time for x86
- Continuations
- some documentation for writing compilers using NekoML+Neko

Nicolas

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

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

Reply via email to