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
Stream parser/make_lexer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-06-26 (12:19)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] Stream parser/make_lexer
On Sun, Jun 26, 2005 at 12:12:40PM +0200, Sen Horak wrote:
> Also, is the make_lexer/stream parser way of building a parser
> deprecated? I find it a convenient way to build small parsers quickly.
> Or do most ocaml programmers just use ocamllex/ocamlyacc for
> everything?

I sometimes used the Stream-Module.
But in the last time I switched more to ocamllex/ocamlyacc.
The reason is, that I find them a good tool for many things.
But I didn't tried the camlp4-stuff. It may be more easy to
write complicated parsers with thema and maybe more elegant.

But one reason to use ocamllex/ocamlyacc is that they are
similar to lex/yacc, and therfore, if programming in a
commercial field, porting the Ocaml-software back to C
(even if not really happy about this), is easier.

So during the next days and weeks I think I will develop
some software twice: in C and the same program also in OCaml.
This will yield insights to how much easier and safer it is to develop
in OCaml than in C.

I just yesterday got a "Bus error" because one function
was not/bad implemented in the C version. I didn't ported
that stuff to OCaml now, but it is planned.
And OCaml had warned me that there is a problem.

(But, btw: using -Wall from gcc would have warned me, but
 OCaml wouldn't compile the code...)
So, using ocamllex/ocymlyacc has some advantages that are
not in the programming field itself... but in the working
environment / where you want to use your software.

It's really hard to start with OCaml and then restrictions
say that you have to use C instead... but that's how it is.