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
[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: 2003-05-10 (20:42)
From: Eray Ozkural <exa@k...>
Subject: Re: [Caml-list] Re: productivity improvement
Oleg is probably going to get mad at such delays in a follow-up but 
nonetheless I have had very little time to write anything intelligible 
because of my unfortunate phd studies.  I am trying to catch up with some 
mails that I've neglected at the time.

For recall, Dave said that a measurable 2 or 3-fold improvement in code size 
could convince people to switch to ML.

On Sunday 20 October 2002 15:46, Dave Berry wrote:
> Way back when this thread started, I quoted another example: Andrew Appel's
> Tiger compiler.  This has three versions, one in C, one in Java, and one in
> SML.  The SML is shorter, but not to such a great extent.  (I need to
> recheck the actual figures).

What I would guess is that a C++ compiler implemented in Ocaml would improve 
code size considerably over one written in C. Even over those in C++, which 
seems to be the language of choice for efficient code nowadays. I have looked 
at some of the open source C++ compilers to see how the code organization was 
and I think that a C++ compiler does have the right amount of complexity to 
demonstrate our point about productivity.

I myself tried to go at some length previous summer by writing a combinatorial 
C++ parser with Parsec in Haskell. As you will guess, I quickly ran into a 
few hard resolution problems and then although I realized there was a nice 
LL(1) grammar that I could use, I didn't have enough time for the project (as 
you could also guess)

If somebody gets interested, I will try to clean up the parser and have it 
actually parse a subset of C++ so that we can begin some development on it. 
Then, if somebody pleases, it shouldn't be impossible to translate the code 
to ocaml or other functional languages. 

The reason I used Haskell was that I thought it would be interesting to see 
the pipeline effect of lazy monadic code in something like (pseudocode!)

    t <- parseProgram prog1;
    s <- semanticAnalyzer t;
    pr <- generatePR s;
    opr <- optimizePR pr;
    generateCode opr

I haven't really looked at any real compilers written in Haskell but I would 
think they use a fair amount of monadic functions.

But first I must program more data structures!!


Eray Ozkural (exa) <>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project:
www:  Malfunction:
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

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