Version française
Home     About     Download     Resources     Contact us    
Browse thread
bug in "developing applications with objective caml" (english translation)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Paul Snively <psnively@m...>
Subject: Re: [Caml-list] Re: some comments on ocaml{lex,yacc} from a novice's POV
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Apr 3, 2005, at 10:44 PM, Erik de Castro Lopo wrote:

> On Mon, 4 Apr 2005 13:42:03 +1000 (EST)
> "Jack Andrews" <effbiae@ivorykite.com> wrote:
>
>> here's the usual calc example that generates a parser:
>>
>>  (define expr-parser
>>   (lalr-parser
>>    ; Terminal symbols
>>    (ID + - * /)
>>    ; Productions
>>    (e (e + t)    : (+ $1 $3)
>>       (e - t)    : (- $1 $3)
>>       (t)        : $1)
>>    (t (t * f)    : (* $1 $3)
>>       (t / f)    : (/ $1 $3)
>>       (f)        : $1)
>>    (f (ID)       : $1)))
>>
>> isn't that nice?!?
>
> Yes.
>
>> compare with caml solutions? compare with any other solution?
>
> There are parsers for Haskell which would compare very favourably
> with your lisp parser. I haven't used them myself but I've seen
> example code somewhere.
>
ONAE's cf's parser combinators, perhaps, if the point is to have an 
"in-native-code" solution. See also the Spirit parser generator 
framework in the Boost libraries for C++, at <http://www.boost.org> or 
<http://spirit.sourceforge.net>.

>> i'm told there are good scheme compilers.
>
> Since scheme is a dynamically typed language, scheme compilers are
> unlikely to ever produce code as fast as a compiler for a statically
> typed langugae like ocaml.
>
It's hard, but by making the closed-world assumption and doing some 
careful type inference, it's possible to be competitive: see the 
Stalin, Bigloo, and Gambit compilers.

> Erik
> -- 
> +-----------------------------------------------------------+
>   Erik de Castro Lopo  nospam@mega-nerd.com (Yes it's valid)
> +-----------------------------------------------------------+
> " ... new TV ad for Microsoft's Internet Explorer e-mail program which
> uses the musical theme of the "Confutatis Maledictis" from Mozart's
> Requiem. "Where do you want to go today?" is the cheery line on the
> screen, while the chorus sings "Confutatis maledictis, flammis acribus
> addictis,". This translates to "The damned and accursed are convicted
> to the flames of hell."
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
Best regards,
Paul

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iEYEARECAAYFAkJRe9gACgkQO3fYpochAqKNyQCg8wks+wUbD9phOo2/7p9s+uDc
u+sAn1bc3LOKJJyVDMrIsKqtiIFOFrv8
=KmnK
-----END PGP SIGNATURE-----