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.8 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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id B3E93BC37 for ; Tue, 18 Aug 2009 17:21:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgDAH9jikpQRFuwWWdsb2JhbACafgEWFb1ehBkFgU4 X-IronPort-AV: E=Sophos;i="4.43,402,1246831200"; d="scan'208";a="44802412" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Aug 2009 17:21:17 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1MdQUu-00058b-Kd for caml-list@inria.fr; Tue, 18 Aug 2009 16:21:16 +0100 Date: Tue, 18 Aug 2009 16:21:16 +0100 To: caml-list@inria.fr Subject: OCaml and kernels (was: Re: [Caml-list] Jane Street is hiring) Message-ID: <20090818152116.GA18840@annexia.org> References: <1250027407.4019.123.camel@nyc-qws-007.delacy.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090818210723.c45efcaf.mle+ocaml@mega-nerd.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; ocaml:01 hars:01 ocaml:01 haskell:01 haskell:01 low-level:01 low-level:01 runtime:01 reimplement:01 twiddling:01 2009:98 garbage:01 wrote:01 wrote:01 inline:01 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. -- Richard Jones Red Hat