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 KAA29467; Thu, 13 Nov 2003 10:06:42 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA00904 for ; Thu, 13 Nov 2003 10:06:40 +0100 (MET) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hAD96b121009 for ; Thu, 13 Nov 2003 10:06:39 +0100 (MET) Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1AKDQt-0002cH-00 for ; Thu, 13 Nov 2003 09:06:31 +0000 Date: Thu, 13 Nov 2003 09:06:31 +0000 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Executable size? Message-ID: <20031113090631.GA10018@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i From: Richard Jones X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 run-time:01 shifts:01 boxing:01 freshmeat:01 dbi:99 threads:01 ltd:98 compilers:01 ocaml:01 ocaml:01 garbage:01 nov:01 compile:02 0300,:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Nov 13, 2003 at 07:14:15AM +0300, Kamil Shakirov wrote: [bogus hello world example] There are two factors which are actually important when comparing executable size: (1) How space efficient are the two compilers when compiling similar code. You would have to compare things like two functions which performed the same operation, or two equivalent for loops, etc. It's likely that OCaml must generate a bit more machine code, because (a) it has to add various run-time bounds checks, and (b) it has to do more bit shifts and boxing because of the representation of OCaml values. (2) How much less code do you have to write in OCaml because it has efficiency features like polymorphism, garbage collection, data structure matching and so on. These features means you have to write, & hence compile, less code overall. I would suggest that (2) outweighs (1), but I've not measured it. Rich. -- Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj Merjis Ltd. http://www.merjis.com/ - improving website return on investment PTHRLIB is a library for writing small, efficient and fast servers in C. HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/ ------------------- 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