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] productivity improvement
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-17 (18:32)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] Re: Camlp4 optimizations (was: productivity improvement)

>I was thinking: could camlp4 help in such endavours?  One could even
>imagine that for numerical intensive applications, some Camplp4
>routines produce C (say) code that is (transparently for the user)
>callable from the main program...  All that in a safe way...  Am I
>dreaming here about the possibilities of camlp4 or is it possible?

camlp4 can generate C with no problem (although I don't know if it can 
create another file, but I don't see why not, it can run arbitrary caml 
code during parsing).

The biggest problem with making ocaml look nice and pretty for numerical 
code is that there is no overloading (of functions or operators), and 
camlp4 doesn't have access to types, so you can't have both:

s*a (scalar times matrix)
a*b (matrix times matrix)

What code would the * operator generate in camlp4?  This needs to be fixed 
at a deeper level than syntax (which is where camlp4 operates...and 
operates well! :).  Althought hopefully it's fixed in a way that doesn't 
require a runtime type-check if the information is available at compile time.

Or, maybe I'm missing would be awesome if I was and this was 


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