Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: [Caml-list] Caml productivity.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: artboreb@n...
Subject: RE: [Caml-list] Caml productivity.
"Pal-Kristian Engstad" <> wrote:

>I am also quite surprised by ocaml's speed. It's doing quite well on a lot
>of platforms. And I would concur that it does quite well when compared to C
>and Fortran. However, that is not quite enough. For me, it isn't enough that
>the compiler is doing a decent job. I want to have the capability to make
>the code even better. To do that, one needs to be able to make use of the
>hardware, i.e. get down to the bare bones of your platform. Yes, it will
>mean that you are giving up portability. Yes, it might be "unsafe", but then
>again, why are there unsafe set and get operations for arrays in ocaml?
> ....

OCaml not too bad?
If you want more I suggest to compile with ocamlopt with the switch -S
(keep intermediate assembly source output) and take a look. Maybe you'll
find the way to strip out some cpu cycles, or maybe you have a better
'faster' GC system. 

>Imagine that there is a special LZWC instruction that counts the number of
>leading zeroes in a 64-bit word. I would love to be able to write >something
>let lzc (x:int64) = inline
>regs res : int32 of  (** Work registers **)
>lzwc res, x (** Opcodes sent to the assembler **)
>return res              (** result of the computation **)

>let main =
>   Printf.printf "lzc %d = %d\n" 12 (lzc 12)

You can do such thing in OCaml calling a 'C' function, I don't see
where is the problem, even more inside 'C' functions you can code
inline assembler. So you can build your own critical time massive
cpu crunching code that way and use OCaml on the top (where C is bad)

Arturo Borquez

Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape!

Get your own FREE, personal Netscape Mail account today at

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: