Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

robin (1821)

robin
  (email not shown publicly)
about:blank

Journal of robin (1821)

Thursday May 23, 2002
09:50 AM

Source filtering, the O'Caml way

[ #5176 ]
Recently I've been playing with O'Caml, which is a charming language.

It has a source filtering mechanism called camlp4. At the heart of it is an extensible replacement parser, which makes it almost trivial to change or extend the language. One of the examples in the manual adds a new loop construct in six lines of code.

Of course, camlp4 itself is written not in ordinary O'Caml but in the "revised" (formerly "righteous") syntax invented by the author of camlp4.

It's interesting that several of the "big" changes planned for Perl 6 are already features of O'Caml: extensible syntax, currying, stable multithreading.

Oh, and it's (conceivably) faster than C++.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • (I've begun using lexical subs as well some time ago :-).)

    Do you know Scheme? One interesting thing in Scheme is continuations, which Ocaml (to my knowledge) is lacking, but parrot is promising to deliver.

    Scheme and Lisp in general are the prototype of extensible syntax languages. I haven't tried camlp4 yet, so dunno if it's going to be as clean.

    There are quite fast (and some very fast) scheme implementations as well. One thing that might make Scheme more similar to Perl than Ocaml, is that it's (general