Version française
Home     About     Download     Resources     Contact us    
Browse thread
HLVM?
[ 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] HLVM?
On Saturday 26 September 2009 17:33:41 David McClain wrote:
> Hello Jon,
>
> I searched around for information on HLVM, and what, in particular,
> makes it so well suited for scientific computing. I also have a long-
> standing interest in scientific computing and OCaml, dating back to
> 1999 when I created my NML system.
>
> However, wherever I found a reference to the HLVM architecture, all I
> really found was a short blurb telling me to subscribe to your OCaml
> Journal.

The motivation behind the HLVM project is described here:

  http://www.ffconsultancy.com/ocaml/hlvm/

> Can you provide some gratis information about what makes HLVM so well
> suited to scientific computing?

HLVM is specifically designed with scientific computing in mind and, in 
particular, aims to provide a performance profile better suited to scientific 
computing. Some sacrifices have been made (e.g. polymorphic recursion) but 
the preliminary results are encouraging. For example, HLVM already thrashes 
OCaml on most numerical benchmarks:

http://flyingfrogblog.blogspot.com/2009/03/performance-ocaml-vs-hlvm-beta-04.html

HLVM also provides native code performance directly from the REPL 
out-of-the-box and offers some useful features that OCaml lacks such as 
generic printing. Other numerical types (byte, sbyte, int8, uint8, int16, 
uint16, int32, uint32, int64, uint64, float32, complex32, complex64) are also 
easy to add and will be vastly more efficient than OCaml's.

However, HLVM is currently missing some core features. Most notably, 
polymorphism and a parallel GC. I intend to implement polymorphism by adding 
a monomorphization stage before JIT compilation and implement a parallel GC 
along the lines of the oc4mc project's.

In essence, improvements in code generation and run-time data representation 
will make HLVM several times faster than OCaml for technical computing and 
improvements in parallelism will make it several times faster again. So I 
expect to get at least an order of magnitude performance improvement over 
OCaml in the end.

> Something that might prompt one to actually subscribe to your journal?

The OCaml Journal articles about HLVM describe the decisions that underpin 
HLVM's current design and the details of how those were implemented in OCaml 
using LLVM. In particular, the current OCaml Journal articles do *not* 
describe how HLVM can be used for scientific computing because it is still an 
experimental project and is likely to undergo major revisions (when I get to 
work on it again!). In other words, the articles are aimed at language 
implementors and not end users.

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