caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Caml vs. Caml Light
@ 1992-12-29 14:58 Xavier Leroy
  0 siblings, 0 replies; only message in thread
From: Xavier Leroy @ 1992-12-29 14:58 UTC (permalink / raw)
  To: caml-list, steck

In reply to Paul Steckler's questions:

> What do I gain/lose by using Caml Light vs. CAML?

Things that work better in Caml:

* Arbitrary precision rational arithmetic (state-of-the-art
  implementation, very efficient).
* Overloading with compile-time resolution. Nice for e.g. programs
  that use mixed arithmetic a lot.
* Ability to embed ``object languages'', i.e. to call user-defined
  parsers from within the Caml parser.
* Powerful macros (at the level of the abstract syntax tree).
* Tools to write pretty-printers.
* Dynamic objects, for meta-level programming (eval) and type-safe
  structured I/O.
* Much more library functions (I would say "far too much", but that's
  a question of personal taste).

Things that work better in Caml Light:

* Much smaller, slightly faster, much more responsive (see below).
* High portability. Caml Light programs run unchanged on many
  platforms. The Caml Light system is easy to port to new platforms.
* Separate compilation is well supported.
* The module system is simple but highly practical.
* Streams and stream matching, providing a very simple way to write
  parsers.
* Better documentation.

> Are the input languages identical?

Not quite, but you can program for quite a while before noticing the
differences (unless you use the most advanced features of Caml, of
course). Actually, you'll notice much earlier the differences between
the Caml library and the Caml Light library. Overall, porting from
Caml to Caml Light is relatively easy.

> Is the performance comparable?

Caml produces native machine code, while Caml Light produces bytecode
for an abstract machine, which is interpreted later, hence Caml Light
should be much slower than Caml. But Caml Light has a more efficient
execution model, and above all a much better garbage collector: Caml
routinely spends more than half the time in garbage collection; with
Caml Light, this goes down to 10% or less. Overall, Caml Light is
slightly faster. This depends a lot on your application (Caml is
faster than Caml Light on raw integer arithmetic, but slower on
function calls) and on your machine (Caml works better on CISCs, Caml
Light really shines on RISCs).

- Xavier Leroy


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1992-12-30 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1992-12-29 14:58 Caml vs. Caml Light Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).