English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] extensible records again
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-03-22 (10:24)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] extensible records again

On Mar 22, 2004, at 11:32 AM, Oleg Trott wrote:

> Ville-Pertti Keinonen wrote:
>> How would you handle interactive sessions?

...after writing this, I realized that the obvious - if the compiler 
isn't a crippled implementation, you can implement a read-eval-print 
loop in a few lines of Scheme. ;-)

> It would have the same limitations as OCaml, obviously: interactive in 
> bytecode only (this has long been one of my biggest gripes about 
> OCaml, actually). FWIW, I don't think writing a Scheme-to-OCaml 
> compiler is a very useful waste of one's time, just that it should be 
> about as easy as writing an interpreter for Scheme in OCaml.

You still need eval.  For a straightforward implementation, the code 
difference between an interpreter and a compiler would be small enough 
that you could have both and use the interpreter for the interactive 
top-level and eval.

But still, I think any trivial implementation of Scheme in OCaml is 
going to be far from optimal (e.g. you'd have to do something nasty to 
avoid having ints both tagged and boxed), which is part of the reason 
why I implemented an interpreter (which could probably be turned into a 
simple compiler in a day or two), along with the fact that the main use 
is embedding in native compiled OCaml programs to make them scriptable 
(and since it ended up being considerably faster than e.g. guile, it's 
definitely not bad for that purpose).

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