Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Alwyn Goodloe <agoodloe@gradient.cis.upenn.edu>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: A Joseph Koshy <koshy@india.hp.com>, <caml-list@inria.fr>
Subject: Re: [Caml-list] embedded caml?
Date: Sun, 11 Nov 2001 12:43:09 -0500 (EST)	[thread overview]
Message-ID: <Pine.GSO.4.33.0111111239240.12309-100000@gradient.cis.upenn.edu> (raw)
In-Reply-To: <20011111182055.E16307@pauillac.inria.fr>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 2671 bytes --]

Xavier,

  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.


Alwyn Goodloe
agoodloe@gradient.cis.upenn.edu



On Sun, 11 Nov 2001, Xavier Leroy wrote:

> > I am trying to get O'Caml to run in an extremely resource constrained
> > environment.   To this end I am interested in getting the O'Caml
> > program to run in as small a memory footprint as possible (GC induced
> > latencies are not a problem).
> >
> > Today using OCaml 3.02 on FreeBSD 4.3, a simple hello world program
> > like, >> print_endline "Hello World";; << translates to
> >
> >         o 8554 bytes of interpreter bytecode, and,
>
> The ocaml bytecode linker, like the C linker, eliminates unused
> compilation units; but as soon as you reference a function from the
> Pervasives unit (e.g. print_endline), all of Pervasives gets linked
> in.  It is possible to construct a lightweight version of the standard
> library, and/or bypass its use altogether.  With that kind of hacks
> you could get to less than 1K for "hello world".
>
> >         o 111945 bytes of executable code (using the -custom switch to
> >           "ocamlc")
>
> Same answer.  Some of the runtime system services (e.g. marshalling,
> debugger interface, etc) can be eliminated if you don't need them.
> However, more than half of these 111K are composed of the bytecode
> interpreter and the GC / memory manager; you can't eliminate those :-)
>
> > I would like to ask if anyone has considered Caml for embedded
> > applications?
>
> I don't think this has been considered much (unless you count as
> "embedded" the Palm Pilot port of Caml Light that François Rouaix did
> a while ago).
>
> Generally speaking, I think Caml (and especially the Objective Caml
> implementation) is not really suitable if you don't have a 32-bit processor
> and at least a few hundred kilobytes of RAM.  If your memory
> constraints are tighter than this, I'm afraid a lower-level language
> is required.
>
> - 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
>

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


  reply	other threads:[~2001-11-11 17:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-08  6:17 A Joseph Koshy
2001-11-08  7:25 ` SooHyoung Oh
2001-11-08 11:30 ` Christopher Quinn
2001-11-11 17:20 ` Xavier Leroy
2001-11-11 17:43   ` Alwyn Goodloe [this message]
2001-11-13 20:26     ` Xavier Leroy
2001-11-15  8:33       ` [Caml-list] [Summary] " A Joseph Koshy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.33.0111111239240.12309-100000@gradient.cis.upenn.edu \
    --to=agoodloe@gradient.cis.upenn.edu \
    --cc=caml-list@inria.fr \
    --cc=koshy@india.hp.com \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox