caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Moving from caml Light to CSL
@ 1996-02-14  9:23 Guy.Cousineau
  1996-02-14 23:38 ` Christophe Raffalli
  0 siblings, 1 reply; 2+ messages in thread
From: Guy.Cousineau @ 1996-02-14  9:23 UTC (permalink / raw)
  To: caml-list; +Cc: cousineau



Hi!

this is to report on my experience about  moving from caml Light to CSL
and ask for advices on how to do that.

First, let me express my enthusiasm about the native code compiler
(clsopt).
I have translated to CSL the MLgraph library and tested it on some
programs involving heavy geometry computations.

At first, I have been disappointed by the byte code execution times
which were exactly the same than in Caml Light.  This is certainly
partly due to my translation (see below) but mainly due to the
fact that my examples involve heavy complex numbers computations
(therefore essentially floating point computation) and output
of big PostScript files (again mainly involving printing floating
point numbers).

On the other hand, when I compiled my modules with cslopt,
I noticed a speedup factor of 12 for the computations
and of 4-5 for the output.  This is very impressive.


Now, about the translation from Caml Light to CSL. I was faced
with a dilemna.  I could either perform a deep translation which
could fully benefit from the CSL module constructs or a surface
translation which could enable me to keep a source code that
would remain (almost) compatible with Caml Light.

I chose the latter because I do not want to have to maintain
2 sets of different source files for MLgraph. I guess that many
people who devellop applications with Caml will have the
same problem.  At some point, we shall make a decisive move
to CSL but it is to early to do that.

Now, if we try to keep a unique set of souce files for both languages,
we have to add 2 compatibility files  butit is not enough.  

Some preprocessing is required for instance because
#open "geometry";;    in Caml light
should become
open Geometry;;  in CSL

In fact, it might be the only problem assuming that compatibility
files eliminate  lexical problems.  For instance, if you use
characters, you have to add a variable definition for each
explicitly used character:
let space_char = ` ` ;;  for Caml Light
let space_char = ' ' ;;  for CSL

So,  my question is:  should we each write our compatibilty files
and preprocessors or  should the community adopt  common
format for compatibility files and preprocessor?

Anyway, thanks a lot for making CSL available.

--Guy Cousineau





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Moving from caml Light to CSL
  1996-02-14  9:23 Moving from caml Light to CSL Guy.Cousineau
@ 1996-02-14 23:38 ` Christophe Raffalli
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Raffalli @ 1996-02-14 23:38 UTC (permalink / raw)
  To: Guy.Cousineau; +Cc: caml-list, cousineau



Hi,
   
I also faced the problem of having compatibility between CSL and CL. I choosed
to use the tool "convert" coming with the distribution. Then if you capitalize
your Constructors and record fields in the right way, if you do not use where
and limit fun to single case matching, then the result produced by convert
seems directly compilable by CSL. So I have only to modify my caml code to
respect the above convention and I can produce directly usable CSL code in an
automatic way (thanks to convert).

This is better than having small functions because, as far as I know there is
still no inlining in csl.

----
Christophe Raffalli
Dept. of Computer Sciences
Chalmers University of Technology

URL: http://www.logique.jussieu.fr/www.raffalli




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-02-15 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-02-14  9:23 Moving from caml Light to CSL Guy.Cousineau
1996-02-14 23:38 ` Christophe Raffalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).