Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 something...it would be awesome if I was and this was 
possible!

Chris


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners