From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 432C3BBAF for ; Thu, 7 Aug 2008 09:38:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuAAAHNDmkjBtPs+mmdsb2JhbACRPwEBAQEBBgcIBxEFmno X-IronPort-AV: E=Sophos;i="4.31,319,1215381600"; d="scan'208";a="13780138" Received: from mailgw4.ericsson.se ([193.180.251.62]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Aug 2008 09:38:36 +0200 Received: from mailgw4.ericsson.se (unknown [127.0.0.1]) by mailgw4.ericsson.se (Symantec Mail Security) with ESMTP id EB7EE21413; Thu, 7 Aug 2008 09:38:35 +0200 (CEST) X-AuditID: c1b4fb3e-a8684bb000007a96-1d-489aa67b1c50 Received: from esealmw126.eemea.ericsson.se (unknown [153.88.254.123]) by mailgw4.ericsson.se (Symantec Mail Security) with ESMTP id E0E96213DF; Thu, 7 Aug 2008 09:38:35 +0200 (CEST) Received: from esealmw128.eemea.ericsson.se ([153.88.254.172]) by esealmw126.eemea.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 7 Aug 2008 09:38:35 +0200 Received: from [153.88.45.121] ([153.88.45.121]) by esealmw128.eemea.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 7 Aug 2008 09:38:35 +0200 Message-ID: <489AA67B.2030300@ericsson.com> Date: Thu, 07 Aug 2008 09:38:35 +0200 From: "Ulf Wiger (TN/EAB)" User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: peng.zang@gmail.com Cc: caml-list@yquem.inria.fr, Ben Aurel Subject: Re: [Caml-list] native vs bytecode References: <74a4f4670808061258q30513bbdl446240feab3fdc36@mail.gmail.com> <200808061609.38758.peng.zang@gmail.com> In-Reply-To: <200808061609.38758.peng.zang@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Aug 2008 07:38:35.0380 (UTC) FILETIME=[995FCB40:01C8F860] X-Brightmail-Tracker: AAAAAA== X-Spam: no; 0.00; bytecode:01 hash:01 bytecode:01 ocaml:01 ocaml:01 erlang:01 kloc:01 byte:01 transitions:01 compilation:01 peng:98 peng:98 dynamically:01 dynamically:01 compile:01 Peng Zang skrev: > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > What do you mean by "dynamically load"? > > You cannot mix native and bytecode generally speaking. > > I don't know of any speed comparisons of OCaml bytecode. You can > always compile to native code, which is faster, so I don't understand > why you would want to run anything large with bytecode. > > Peng I don't know how it is for ocaml, but in Erlang, it wouldn't be considered strange to mix native and bytecode. The main reason is that native code increases memory footprint compared to the very compact bytecode. In systems with hundreds of KLOC of code, this can make a significant difference. There is a performance penalty when switching from native to byte code, so one needs to try to minimize the number of transitions in order not to cancel the effect of native compilation. Historically, it's been a problem that while native code could be dynamically loaded, old code couldn't be purged after code upgrade. I believe this problem is solved now, or will be soon. Again, I don't know how relevant this is to Ocaml. It was mainly intended as an answer to the question why one would like to mix native and bytecode. BR, Ulf W