Version française
Home     About     Download     Resources     Contact us    
Browse thread
Performance questions, -inline, ...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] Performance questions, -inline, ...
Jon Harrop wrote:
> You mean it might be possible to recover the performance of C from numerical 
> code with high-level abstractions? Yes. Indeed, I would like to see this 
> done. However, I've never heard of an implementation of any language that can 
> do this.
>   
<shameless plug>
With MetaOCaml you can -- see either the long version
http://www.cas.mcmaster.ca/~carette/scp_metamonads.pdf
or the more condensed version
http://www.cas.mcmaster.ca/~carette/metamonads/index.html
</shameless plug>

With a little bit of work, you can achieve all of
> The simplest route to recovering C performance here is:
>
> . Inline "( +. )".
> . Inline "op1".
> . Type-specialize "op1".
> . Hoist bounds checks.
>   
automatically.  There are three drawbacks:
1) the code you write no longer looks like O'Caml but Lisp instead [can 
be fixed with enough campl4 hacking]
2) the error messages can be very difficult to figure out [could be 
improved a lot if monads were integrated in O'Caml]
3) metaocaml is not as well supported as ocaml

Jacques