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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3F3B6BC37 for ; Thu, 20 Aug 2009 22:52:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApECAMdUjUrUnwdpmWdsb2JhbACCIphpAQEBAQEGDQoHE70xhBgF X-IronPort-AV: E=Sophos;i="4.43,416,1246831200"; d="scan'208";a="31380308" Received: from relay.pcl-iptrial02.plus.net (HELO PCL-iptrial02.plus.net) ([212.159.7.105]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Aug 2009 22:52:19 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0FABNUjUrUnw6S/2dsb2JhbACCItZYhBgF Received: from ptb-relay02.plus.net ([212.159.14.146]) by PCL-iptrial02.plus.net with ESMTP; 20 Aug 2009 21:52:19 +0100 Received: from [87.114.1.46] (helo=leper.local) by ptb-relay02.plus.net with esmtp (Exim) id 1MeEcM-0001Sk-5l for caml-list@yquem.inria.fr; Thu, 20 Aug 2009 21:52:18 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Good book about ML compilation ? Date: Thu, 20 Aug 2009 23:02:48 +0100 User-Agent: KMail/1.9.9 References: <20090820184052.GA28533@happyleptic.org> In-Reply-To: <20090820184052.GA28533@happyleptic.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200908202302.48363.jon@ffconsultancy.com> X-Plusnet-Relay: b6f2132b826fb4082362b67ab2573572 X-Spam: no; 0.00; compilation:01 ocaml:01 lambda:01 advices:01 ocaml:01 compiler:01 compiler:01 compilation:01 structs:01 2009:98 img:98 frog:98 sml:01 wrote:01 compilers:01 On Thursday 20 August 2009 19:40:52 rixed@happyleptic.org wrote: > Hello ! > > Suppose I want to learn how ML is compiled, and especialy how OCaml is > compiled, it's various internal lambda representations and the like. > Would this book : > > http://www.amazon.com/Modern-Compiler-Implementation-Andrew-Appel/dp/052160 >7647/ > > be a good one ? > > It's hard to tell what this book's worth from the customer advices ; it's > especialy hard to tell if it fits well to OCaml or not. I found that book often glossed over aspects of the compiler that I was unable to implement myself at the time. That was frustrating. I also found SML cumbersome compared to OCaml. I much preferred another of Appel's books as an introduction to writing a compiler: http://www.amazon.com/Compiling-Continuations-Andrew-W-Appel/dp/052103311X/ref=pd_sim_b_3_img However, you could probably learn far more efficiently from another resource. In particular, you can easily thrash today's ML compilers by using some of the excellent tools and libraries like LLVM and more modern techniques like monomorphization during JIT compilation. You might also want tuples as structs to relieve the stress on the GC. These are some of the techniques I am using for HLVM and the results speak for themselves (and I am describing them in detail in OCaml Journal articles). If you want to learn how ML is (or should be) compiled then I think your best bet is probably to ask here. I also recommend reading the source code to the OCaml and F# compilers. Are you also interested in GCs? -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e