Version française
Home     About     Download     Resources     Contact us    
Browse thread
Good book about ML compilation ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Good book about ML compilation ?
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