Incrementally implementing a simple ML compiler using LLVM

Jon Harrop <usenet@jdh30.plus.com>
Mon, 26 Nov 2007 22:53:09 +0000

          From comp.compilers

Related articles
Incrementally implementing a simple ML compiler using LLVM usenet@jdh30.plus.com (Jon Harrop) (2007-11-26)
Re: Incrementally implementing a simple ML compiler using LLVM torbenm@app-2.diku.dk (2007-11-27)
Re: Incrementally implementing a simple ML compiler using LLVM gneuner2@comcast.net (George Neuner) (2007-11-28)
Re: Incrementally implementing a simple ML compiler using LLVM pertti.kellomaki@tut.fi (=?ISO-8859-1?Q?Pertti_Kellom=E4ki?=) (2007-11-29)
Re: Incrementally implementing a simple ML compiler using LLVM jo@durchholz.org (Joachim Durchholz) (2007-11-29)
Re: Incrementally implementing a simple ML compiler using LLVM usenet@jdh30.plus.com (Jon Harrop) (2007-11-30)
| List of all articles for this month |
From: Jon Harrop <usenet@jdh30.plus.com>
Newsgroups: comp.compilers
Date: Mon, 26 Nov 2007 22:53:09 +0000
Organization: Flying Frog Consultancy Ltd.
Keywords: functional, practice
Posted-Date: 26 Nov 2007 20:20:19 EST

I recently tried the Low-Level Virtual Machine (LLVM) project and found that
I can use its OCaml bindings to write native-code compilers with ease.


I would like to use this technology to create a simple compiler for a
language similar to OCaml but with no baggage (e.g. I have no desire
to support 63-bit integers!). However, I am completely new to this (I
am a computational physicist/dabbler) so I'd really appreciate a
little assistance.


I already have a really bare-bones compiler for a first-order language
with a single type (int) that can compile a Fibonacci program to
x86-64 native code.


I'm not even sure what my milestones should be but I assume I should
add more types (e.g. function pointers), boxed values and a garbage
collector next.


Until now I have only been superficially aware of boxing (in the
context of optimization). What exactly is the simplest run-time
representation of a boxed value? Is it a pointer to a >=1 word-sized
block?


Is the Cheney semi-space GC a suitable starting point? Is there an
abstract interface for using a GC from generated code that I could
adhere to?


Is there anything else that I should be aware of?


--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.