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.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 22CCFBC37 for ; Tue, 18 Aug 2009 17:56:21 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALNriko+3JIE/2dsb2JhbADYeIQZBYFOXA X-IronPort-AV: E=Sophos;i="4.43,403,1246831200"; d="scan'208";a="44803810" Received: from vs.philou.ch ([62.220.146.4]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Aug 2009 17:56:20 +0200 Received: by vs.philou.ch (Postfix, from userid 1000) id C0C041F283A0; Tue, 18 Aug 2009 17:56:52 +0200 (CEST) Date: Tue, 18 Aug 2009 17:56:52 +0200 From: Philippe Strauss To: caml-list@inria.fr Subject: Re: OCaml and kernels (was: Re: [Caml-list] Jane Street is hiring) Message-ID: <20090818155652.GA30171@vs.philou.ch> References: <200908171459.01872.toots@rastageeks.org> <7c737f300908171302q6c251441u35ed3bd99552bd46@mail.gmail.com> <200908171526.52574.toots@rastageeks.org> <3c1674c90908171430m12c4a3e7pa96cc5e60df72b17@mail.gmail.com> <20090818084452.f9df0801.mle+ocaml@mega-nerd.com> <3c1674c90908171622j79ec5df1ob4e6236dff3a1b36@mail.gmail.com> <20090818093300.a041d75a.mle+ocaml@mega-nerd.com> <4A8A8979.4010705@bik-gmbh.de> <20090818210723.c45efcaf.mle+ocaml@mega-nerd.com> <20090818152116.GA18840@annexia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090818152116.GA18840@annexia.org> User-Agent: Mutt/1.5.13 (2006-08-11) X-Spam: no; 0.00; ocaml:01 0100,:01 hars:01 ocaml:01 haskell:01 haskell:01 low-level:01 low-level:01 runtime:01 reimplement:01 twiddling:01 c--:01 2009:98 2009:98 garbage:01 On Tue, Aug 18, 2009 at 04:21:16PM +0100, Richard Jones wrote: > On Tue, Aug 18, 2009 at 09:07:23PM +1000, Erik de Castro Lopo wrote: > > Florian Hars wrote: > > > > > Erik de Castro Lopo schrieb: > > > > That makes sense. I do quite low level stuff as well, even Linux device > > > > drivers and that is not ever going to be done in Ocaml or Haskell :-). > > > > > > People do use Haskell in developing OS kernels, and you can't get more > > > low-level than that: > > > > > > http://ertos.nicta.com.au/research/l4.verified/approach.pml > > > > The Linux kernel which is the one I am interested in is C only. For > > the Linux kernel I very much doubt it is ever going to be possible to > > write drivers in Ocaml or Haskell even if that is possible for other > > kernels now. > > Kernel hackers would hate people using any language other than C for > Linux kernel modules. But that doesn't mean a modified OCaml is a bad > choice for writing a kernel. > > It's relatively low-level when you need it to be, and it wouldn't be > too much work to separate out the runtime and reimplement it on top of > baremetal. It would also be interesting to see if the supposed > massive overheads of garbage collection are in reality better than > bloating every structure with an additional reference count field. > > There are some missing features to really make it possible though: > > - inline assembly > > - support for ELF (eg. putting code/data directly into named sections) > > - bit fields / bit twiddling (can probably be done with macros) > > - better optimization of int32 and int64 types > > Of the above, inline assembly is the one I'd really like to see added > to OCaml. And having int32 be optimized to an int on 64 bit > platforms. > > Rich. two interesting projects in that direction: c-- (cminusminus) bit-c by jonathan shapiro -- Philippe Strauss http://philou.ch