Gerd Stolpmann proudly presents
NEWS: [April, 2001] JavaCaml has been updated such that it
can be compiled with O'Caml 3 and JDK 1.3. However, I currently have
no time to add missing features; actually the code is unchanged since
1998 (i.e. it is more or less dead). If somebody wants to take
JavaCaml over, please do it.
DESCRIPTION
The basis of the new interpreter I present here is Objective Caml, a
dialect of the ML family of languages developed at the INRIA institute
and available on the Internet, see the Caml homepage. It is
possible to execute programs compiled with Objective Caml on all
platforms running a Java virtual machine. The mainly interesting
point is to use this language for client-side WWW scripts running in
the browser which has some advantages:
- Objective Caml is a modern language whose small core has
very clear semantics and is accompanied by a rich library
- Objective Caml has powerful language constructs including
closures, modules, functors, classes, streams, it is strongly
typed and can represent polymorphic functions
- Objective Caml has many predefined data types including lists, arrays,
hash tables, strings, sets. It is simple to create new data types
- Objective Caml has good string processing features including
regular expressions
Objective Caml comes with two compilers, one generating bytecode and
another producing native executables. The bytecode has only very few
primitives (much fewer than Java), such that it seemed to be possible
to translate the C-language bytecode interpreter of Objective Caml
to Java.
And here is the result: JavaCaml. It is currently in a very early
stage, but can already run some demonstration programs. Some core
features of the Objective Caml language are not supported yet, so
please don't expect that your favourite OCaml application can already
be executed.
Objective Caml has been designed for stand-alone applications. When
running in a browser the environment is completely different and needs
a new set of libraries supporting what is required for applets. I have
begun such a library called Net_runtime which makes it possible that
JavaScript programs can call Objective Camls functions. This is
currently the only chance to communicate with the outer world since
the AWT toolkit of Java is invisible in JavaCaml. So programming
browser applications running in JavaCaml means generating HTML
fragments that can be sent to a superordinated JavaScript program and
there be put into an HTML frame. This is the same technique often used
in server-side WWW applications.