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_FAIL 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 69A92BBC4 for ; Thu, 5 Mar 2009 16:55:33 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEDALOEr0lQW+UCe2dsb2JhbACVAAEBFiIExC2ECAY X-IronPort-AV: E=Sophos;i="4.38,307,1233529200"; d="scan'208";a="22108516" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 05 Mar 2009 16:55:33 +0100 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LfFv0-0001Ht-L6 for caml-list@inria.fr; Thu, 05 Mar 2009 15:55:30 +0000 Received: from ks300734.kimsufi.com ([91.121.65.225]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Mar 2009 15:55:30 +0000 Received: from sylvain by ks300734.kimsufi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Mar 2009 15:55:30 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Sylvain Le Gall Subject: Re: ocaml ast to machine at runtime Date: Thu, 5 Mar 2009 15:55:22 +0000 (UTC) Message-ID: References: <19147175-3CFE-4AF5-9C8D-D286E5D2B058@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ks300734.kimsufi.com User-Agent: slrn/pre0.9.9-102 (Linux) Sender: news X-Spam: no; 0.00; le-gall:01 ocaml:01 runtime:01 ocaml:01 runtime:01 gcc:01 wrote:01 compile:01 parsing:01 functions:01 functions:01 ast:02 ast:02 binding:02 programming:03 On 05-03-2009, Joel Reymont wrote: > I would like to compile trading systems written in a pascal-like > programming language to OCaml AST at runtime, convert it to machine > code and use it from the same running > OCaml program (natdynlink?). > > Is it possible to do this without having gcc installed? > > The code I'm generating will need to be iterate over an array of > doubles or be called from within the loop on every array element. It > will also use a bunch of helper functions from my existing library. > > If I generate the code using LLVM then I'll need to write my helper > functions in C and the only value I get from OCaml would be the > parsing. If I write the helper functions in OCaml then I believe my > loop will be slow as hell due to all the wrapping and unwrapping of > OCaml values. > > Any suggestions? Why not using the LLVM OCaml binding? It is directly shipped with LLVM. So you can write the entire generator in OCaml... Regards, Sylvain Le Gall