From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 04D1A7EE49 for ; Sat, 21 Sep 2013 14:08:53 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.90,952,1371074400"; d="scan'208";a="33787490" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 21 Sep 2013 14:08:52 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id EB73A7EE4A; Sat, 21 Sep 2013 14:08:52 +0200 (CEST) Date: Sat, 21 Sep 2013 14:08:47 +0200 To: caml-list@inria.fr In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7BIT From: "Jonathan Kimmitt" X-Mailer: Sympa 6.1.17 Subject: Re: [Caml-list] Ocaml on an embedded arm system (no linux) 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.