From: "Jonathan Kimmitt" <jonathan@kimmitt.co.uk>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Ocaml on an embedded arm system (no linux)
Date: Sat, 21 Sep 2013 14:08:47 +0200 [thread overview]
Message-ID: <sympa.1379764382.5739.796@inria.fr> (raw)
In-Reply-To: <CAKdt_-aRvGpXTnAC4T5QmLpi8d3FeC+zv9Rt4D56vAFiJr0QxA@mail.gmail.com>
It is perfectly possible to run OCAML on an ARM with 196K of memory. For this
purpose the code density will only be a bit worse than a C compiler for the
same complexity of algorithm. The ocapic distribution achieves some of its
savings by using primitives that access the hardware directly. So this saves
quite a bit in library code. However what you propose to do is to implement
the bytecode toplevel on the ARM. This can not be done with less than about 2
megs of RAM, and some features would have to be left out. The primary
functions that need the space are to do with parsing and compiling your input
to bytecode and linking it incrementally with the provided libraries, all of
which takes significant space. If you want something non-trivial to run you
need to allow decent amounts of space for heap objects and garbage collection
efficiency.
If you only want a fixed program to run this is more realistic for 192K and in
theory the Ocaml code could be flashed. You still need to tweak things I would
guess if the garbage collector has to work in 196K or potentially 20K. If you
use native code generation the interpreter can be omitted which will save
quite a bit. Be prepared to write the vast of libraries yourself such as
anything to do with I/O. Standard libraries for list manipulation would not
need to be changed. A certain style of OCaml when written will save you quite
a bit of memory, especially if you use it to write device drivers and such
like where it is important not to continually allocate objects.
next prev parent reply other threads:[~2013-09-21 12:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-20 14:13 Dwight Schauer
2013-09-20 15:54 ` Gerd Stolpmann
2013-09-20 16:19 ` Dwight Schauer
2013-09-20 16:46 ` Gerd Stolpmann
2013-09-21 12:08 ` Jonathan Kimmitt [this message]
2013-09-23 12:30 ` Goswin von Brederlow
2013-09-23 21:10 ` Anil Madhavapeddy
2013-09-30 13:48 ` Goswin von Brederlow
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=sympa.1379764382.5739.796@inria.fr \
--to=jonathan@kimmitt.co.uk \
--cc=caml-list@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