[LLVMdev] OCaml Journal article: Building a Virtual Machine with LLVM

Jon Harrop jon at ffconsultancy.com
Sun Jan 25 07:16:22 PST 2009


Following on from the success of our previous OCaml Journal articles covering 
LLVM, we have begun a series dedicated to the design and implementation of 
high-level languages using LLVM. In particular, these new articles are more 
pragmatic in nature and go beyond describing working compilers to also 
discuss testing, debugging and the performance of LLVM-based compilers.

The first article in this new series has just been published:

http://ocamlnews.blogspot.com/2009/01/building-virtual-machine-using-llvm.html

This article describes a basic design for a High-Level Virtual Machine (HLVM) 
and walks through a core implementation written in OCaml that can JIT compile 
functions from a simple language (with unit, bool, int, float and array 
types) to optimized native code and execute them.

Future articles in this series will add tail calls, tuples, algebraic 
datatypes, run-time types, reflection, accurate garbage collection, 
dynamically-loaded libraries and FFI to C, first-class functions and many 
more features.

When our HLVM reaches a more advanced stage, with sum types and garbage 
collection, we shall release it as open source software and encourage others 
to build interoperable language implementations upon it, i.e. creating a 
common language run-time.

Many thanks,
-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e



More information about the llvm-dev mailing list