caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Is Caml good for embedded systems?
@ 2004-02-04 13:28 Leszek.Holenderski
  2004-02-04 14:29 ` Basile Starynkevitch
  0 siblings, 1 reply; 4+ messages in thread
From: Leszek.Holenderski @ 2004-02-04 13:28 UTC (permalink / raw)
  To: caml-list

Hello,

I wonder if anybody attempted to use Caml (or any of its variants) to program
embedded systems?

The main obstacle, as I see it, is a rather poor arithmetic. It seems that the
only directly supported numerical type is 31-bit integers. Everything else
(floats, 32-bit integers, fixed-point integers) has to go via pointers.

By the way, has anybody implemented a library for fixed-point arithmetic?

Leszek

-----------------------------------------------------
Leszek Holenderski, Philips Research, The Netherlands

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Is Caml good for embedded systems?
  2004-02-04 13:28 [Caml-list] Is Caml good for embedded systems? Leszek.Holenderski
@ 2004-02-04 14:29 ` Basile Starynkevitch
  0 siblings, 0 replies; 4+ messages in thread
From: Basile Starynkevitch @ 2004-02-04 14:29 UTC (permalink / raw)
  To: Leszek.Holenderski, caml-list

On Wed, Feb 04, 2004 at 02:28:20PM +0100, Leszek.Holenderski@philips.com wrote:

> I wonder if anybody attempted to use Caml (or any of its variants)
> to program embedded systems?

You didn't define what you mean by embedded systems... There are lots
of various definitions, and you didn't gave any (real or fictiuous)
examples, so we have to guess.

Some old version of Caml-light (not Ocaml) has been ported to some old
Palm PDA, IIRC.

IIRC, someone experimented embedding Ocaml [or some Caml variant...?]
(using the bytecode interpreter) inside the Linux kernel.

> The main obstacle, as I see it, is a rather poor arithmetic. It
> seems that the only directly supported numerical type is 31-bit
> integers. Everything else (floats, 32-bit integers, fixed-point
> integers) has to go via pointers.

I'm not sure that the arithmetic is poor enough to be a problem in
practice (but YMMV).

I see others potential issues

1. embedded systems usually are extremely tight on memory space, and
the runtime does take some space.

2. The current runtime requires floating point (and also some IO
support) in the runtime - this can be worked around with some 
work...

3. most importantly, embedded systems usually have significant real
time requirements, and the Ocaml garbage collector, even if it is very
performant, is not exactly realtime (and coding realtime GC is a
nightmare, and has important costs), but behave nicely even in
interactive usage.


Still, I tend to believe that the current Ocaml is usable in embedded
systems, provided they are powerful enough (i.e. a 32bit CPU, with at
least 16Mb RAM... ie something which is not smaller than 10times less
my average desktop)....

What kind of embedded systems do you have in mind?

-- 
Basile STARYNKEVITCH -- basile dot starynkevitch at inria dot fr
Project cristal.inria.fr - INRIA Rocquencourt
http://cristal.inria.fr/~starynke --- all opinions are only mine 

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Is Caml good for embedded systems?
@ 2004-02-06  9:26 Leszek.Holenderski
  0 siblings, 0 replies; 4+ messages in thread
From: Leszek.Holenderski @ 2004-02-06  9:26 UTC (permalink / raw)
  To: caml-list

Kenneth Oksanen wrote:
> 
> >I wonder if anybody attempted to use Caml (or any of its variants) to
> >program embedded systems?
> 
> It seems your question didn't quite get the discussion it deserved,
> especially if you mean relatively small embedded systems (say, a
> hundred kilobtres of RAM).

I was just probing into the subject and I didn't expect much. This rather
confirms my early suspicion that Caml is not good for programming embedded
systems.

> A few years ago a friend of mine, Lars Wirzenius, working on
> such systems did a search trying to find existing systems, but came
> out empty handed.  So we wrote a concise LISP system, Hedgehog, for
> his task.  Here's the blurb about it:
> ...
> Lars' employer has the Hedgehog tutorial on-line:
>         http://www.oliotalo.fi/hedgehog/hoglisp.html
> Lars' weblog also gives some information:
>         http://liw.iki.fi/liw/log/2003-Hedgehog-Lisp.html

Thanks for the info. I'd prefer something natively compiled though.

Leszek

-----------------------------------------------------
Leszek Holenderski, Philips Research, The Netherlands

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Is Caml good for embedded systems?
       [not found] <md5:958EBD708C4668D189128BAA6CBC00B2>
@ 2004-02-05 16:43 ` Leszek.Holenderski
  0 siblings, 0 replies; 4+ messages in thread
From: Leszek.Holenderski @ 2004-02-05 16:43 UTC (permalink / raw)
  To: caml-list

Basile Starynkevitch wrote:
> 
> On Wed, Feb 04, 2004 at 02:28:20PM +0100, Leszek.Holenderski@philips.com wrote:
> 
> > I wonder if anybody attempted to use Caml (or any of its variants)
> > to program embedded systems?
> 
> You didn't define what you mean by embedded systems... There are lots
> of various definitions, and you didn't gave any (real or fictiuous)
> examples, so we have to guess.

I don't have any specific kind of embedded systems in mind. I was just probing,
to check whether Caml could be advertised for embedded programming in Philips.
Since Philips is involved in embedded systems of various kinds I didn't want to
limit the subject. The simplest example would be video processing (say, digital
TV and 3D TV).

I've been promoting Caml for desktop programming for some time now (with rather
modest results so far :) and I'd like to try another strategy to introduce Caml
in Philips.

> Some old version of Caml-light (not Ocaml) has been ported to some old
> Palm PDA, IIRC.
>
> IIRC, someone experimented embedding Ocaml [or some Caml variant...?]
> (using the bytecode interpreter) inside the Linux kernel.

I'd prefer native code. Also, something lighter than Linux.

> > The main obstacle, as I see it, is a rather poor arithmetic. It
> > seems that the only directly supported numerical type is 31-bit
> > integers. Everything else (floats, 32-bit integers, fixed-point
> > integers) has to go via pointers.
> 
> I'm not sure that the arithmetic is poor enough to be a problem in
> practice (but YMMV).

It is. In embedded programming you often (over)use various encodings, say
packing 4 bytes (colour components) into one 32-bit word.

> I see others potential issues
> 
> 1. embedded systems usually are extremely tight on memory space, and
> the runtime does take some space.

Not necessarily. In video processing you often have access to 16, 32 or 64MB.

> 2. The current runtime requires floating point (and also some IO
> support) in the runtime - this can be worked around with some
> work...

Didn't know. This is serious.

> 3. most importantly, embedded systems usually have significant real
> time requirements, and the Ocaml garbage collector, even if it is very
> performant, is not exactly realtime (and coding realtime GC is a
> nightmare, and has important costs), but behave nicely even in
> interactive usage.

In most cases you can live with it. Hard real-time embedded applications are in
fact not that common. And even then only a small part is critical, usually.

> Still, I tend to believe that the current Ocaml is usable in embedded
> systems, provided they are powerful enough (i.e. a 32bit CPU, with at
> least 16Mb RAM... ie something which is not smaller than 10times less
> my average desktop)....

That's what I hope for, and that's why I'd be very interested to know if
anybody has some evidence for this.

Leszek

---------------------------------------------------------------
Leszek Holenderski, Philips Research, The Netherlands

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-06  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-04 13:28 [Caml-list] Is Caml good for embedded systems? Leszek.Holenderski
2004-02-04 14:29 ` Basile Starynkevitch
     [not found] <md5:958EBD708C4668D189128BAA6CBC00B2>
2004-02-05 16:43 ` Leszek.Holenderski
2004-02-06  9:26 Leszek.Holenderski

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).