Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] embedded caml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] embedded caml?
>   You are probably right BUT many embedded environments are approaching
> what you describe. J2ME for example is intended to run in such an
> environment. I've always said anything that Java can do OCAML
> can do faster with less resources. Also note that OHaskell also
> seems intended for similar apps. Seems like OCAML would work
> just as well.

This is probably getting off-topic for this list.  At any rate, I have
some experience working with smart cards, which are fairly small
embedded systems (a state-of-the-art smart card has an 8-bit
processor, 5 Mhz clock, 2K RAM, 16K EEPROM, 64K ROM), and I can say
with some confidence that all the system you mention (J2ME, etc)
definitely do not fit in such a small embedded system.

Like OCaml, J2ME won't work well unless you have a 32-bit processor
and a few hundred K of RAM.  For Java, it's a big improvement over the
regular JDK implementation, which requires a few megabytes of RAM just
to start up.  But viewed from a Caml standpoint, it basically took Sun
5 years to shrink their JVM to the point where Caml Light and OCaml
have been since the beginning.  Don't be fooled by their marketing.

For smaller systems such as smart cards, Sun had to develop Java Card,
which is a much smaller subset of the JVM, where they throw out
garbage collection, threads, floating-point arithmetic, long integers,
and about 95% of the Java standard library.  With these drastic cuts,
it fits on a smart card, but programming in Java Card is definitely
much lower-level than in full Java, and the benefits of using Java in
this context, as opposed to (say) UCSD Pascal, are not obvious.

So, I stand with my claim that if the original poster is interested in
embedded systems that do not have a 32-bit processor and at least a
few hundred K of RAM, then Caml is not appropriate, and C might remain
his best bet.

This said, there are plenty of bigger embedded systems where OCaml
could make sense.  PDAs are a well-known example; network routers are
another.  Heck, even the electronic ignition system in your car
probably consists in a PowerPC with a few megabytes of RAM.

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr