From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA12946; Sat, 15 Nov 2003 14:51:02 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA13290 for ; Sat, 15 Nov 2003 14:51:00 +0100 (MET) Received: from mail1.tpgi.com.au ([203.12.160.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAFDow126949 for ; Sat, 15 Nov 2003 14:50:59 +0100 (MET) Received: from 203-219-16-195-syd-ts21-2600.tpgi.com.au (203-219-16-195-syd-ts21-2600.tpgi.com.au [203.219.16.195]) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id hAFDnYQ13814; Sun, 16 Nov 2003 00:49:35 +1100 Subject: Re: [Caml-list] Executable size? From: skaller Reply-To: skaller@ozemail.com.au To: John J Lee Cc: caml-list@inria.fr In-Reply-To: References: <20031112173335.GA32347@redhat.com> Content-Type: text/plain Message-Id: <1068900526.25869.77.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 15 Nov 2003 23:48:47 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 ozemail:01 runtime:01 runtime:01 ocamlrun:01 tut:99 101.:99 flx:01 dynamically:01 ffi:01 cygwin:01 python:01 currying:01 boxing:01 invoke:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2003-11-13 at 05:21, John J Lee wrote: > On Wed, 12 Nov 2003, Richard Jones wrote: > Probably this is a naive question, but: Is it impractical to have a > functional language that uses the C runtime? Felix does that. Its own runtime is tiny (it has a naive exact garbage collector .. only a page of source code or two). It also generates shared libraries by default, which don't include any runtime at all (you invoke the library with a driver like ocamlrun). Here is the Hello World program in Felix: ----------------------- include "std"; print "Hello World\n"; ------------------------- and the output for Linux x86 generated by g++ without optimisation: 20 -rwxrwxr-x 1 skaller skaller 18847 Nov 15 02:23 tut101.so It is run by this program: 72 -rwxrwxr-x 1 skaller skaller 69083 Nov 15 02:19 flx_run [Of course the C and C++ libraries are dynamically linked so are not included] > Does anyone have recommendations for languages (not necessarily > functional) with a compiler that generates small executables (including > runtime code) for multiple platforms (at least Unix and Windows), with a > decent FFI (foreign function interface), and preferably MS COM support? > > Am I really stuck with C++?? Felix generates simple ISO C++, so the output is portable. The foreign function interface .. well .. example: header "include "; type file = "FILE*"; fun fopen: string -> file = 'std::fopen($1.data(),"rt")'; MS_COM support you'll have to add yourself. Should be trivial using the above kind of mechanism. http://felix.sf.net It works fine on Linux and has been built with Cygwin on Windows. Ocaml, Python, and a C++ compiler are required. And some courage since it is 'pre-alpha' software :-) Read the tutorial to discover the functional features including first class functions, currying, pattern matching, etc. Note that polymorhism is fully parametric but compile time only at the moment since boxing is not used. ------------------- 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