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
Estimating the size of the ocaml community
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-02-03 (22:42)
From: Bardur Arantsson <list-caml-list@s...>
Subject: Re: [Caml-list] Estimating the size of the ocaml community
On Thu, Feb 03, 2005 at 01:58:33PM -0800, Paul Snively wrote:

> Hash: SHA1

> On Feb 3, 2005, at 1:16 PM, Thomas Fischbacher wrote:
> >(1) I by far do not have the flexibility in extending the language with
> >own syntax which I have in Lisp.

> I have to respectfully disagree with this: IMHO, entirely too much is 
> made of Lisp's macros (as distinct from Scheme's hygenic macros)! With 
> camlp4, I have the ability to go from any concrete syntax I have an 
> expander for to O'Caml's AST and back. This is used to good effect in 
> Graydon Hoare's One Day Compiler presentation.

Camlp4 has its own problems which I discovered when writing a parser

- When using quotations to construct the AST there is often only one (and
usually quite counterintuitive) way to construct a particular AST
fragment. The error messages are incredibly obtuse and when the line
numbers don't work properly this can be a royal PITA to get right.

- There is AFACT no way to "generate" identifiers in generated code so
that they are guaranteed not to clash with identifiers in outer/inner

- You cannot verify that the generated AST will actually be valid OCaml
(e.g. free of references to unbound variables) until the generated AST is
compiled. It's not a huge problem, but it means you have to test more for
syntactical(!) corner cases.

Personally, I'm hoping that MetaOCaml (or something similar) will make it
into standard OCaml... but I'm not holding my breath. Of course that
"only" solves the problem of how to generate code in a sane manner. It
doesn't really provide for an easier way to extend the syntax as such.

> >(7) I cannot easily (format t "DEBUG: compsite-thingy-bla-now-is ~A~%" 
> >bla).

> I don't quite follow; is there something wrong with Printf?

It can only print simple values, not compound values such as records,
objects, etc... Well, alright, it can use a custom printer, but there
shouldn't really be any need to have to write custom printers for
e.g. records when it's patently obvious how they should be printed (in
the absence of a more specific format).

Bardur Arantsson

- That which does not kill you only makes you stranger.
                                MisterQueue |