Version française
Home     About     Download     Resources     Contact us    
Browse thread
HLVM stuff
[ 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 stuff
On Monday 28 September 2009 01:35:32 David McClain wrote:
> Yes, this is beginning to sound very interesting... So now that you
> have F#, which I understand to be some derivative of OCaml,

F# is superficially similar to OCaml, most notably its OCaml-like syntax, but 
there are some quite major differences:

http://www.strangelights.com/fsharp/wiki/default.aspx/FSharpWiki/FSharpAndOCaml.html

> why do you need HLVM?

Good question. I saw these important advantages realized in F# by Microsoft 
and wanted to bring those benefits to the OCaml/Linux world. There is 
no "need" to do so unless you refuse to use Windows and I am happily using 
Windows now. Moreover, the libraries available under Linux are dire in 
comparison to .NET. Hence I am no longer really motivated to work on HLVM. F# 
is a lot more fun and a lot more profitable. :-)

> Is F# using the LLVM?

No. F# is Microsoft's new programming language for .NET.

> or is it executing natively compiled code?

Yes. The F# compiler generates .NET assemblies containing CIL (Common 
Intermediate Language) that the CLR (Common Language Run-time) then JIT 
compiles the CIL to native code:

  http://en.wikipedia.org/wiki/File:CLR_diag.svg

This is true of the interactive F# REPL as well as compiled binaries.

>  From what I have garnered today in a quick scan of JIT docs, it
> appears that JIT cannot compete yet with native code. But if the
> timings you stated are for some kind of JIT against byte-codes, I am
> very impressed.

The timings I posted show JIT-compiled F# solving your problem orders of 
magnitude faster than native-code compiled with ocamlopt. OCaml's interpreted 
bytecode is even slower than its compiled native code, of course. I don't 
know how fast other native-code compiled languages like C, C++ and Fortran 
are in comparison except that some of my numerical F# code outperform's 
Intel's vendor-tuned Fortran running on Intel hardware.

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