caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Eric Breck <ebreck@cs.cornell.edu>
Cc: caml-list@inria.fr
Subject: Re: On language extensions (was Re: [Caml-list] global record)
Date: Thu, 20 Jul 2006 15:16:18 +1000	[thread overview]
Message-ID: <1153372578.18872.13.camel@rosella.wigram> (raw)
In-Reply-To: <51E3580C-02A1-4344-A5AA-862B580015F1@cs.cornell.edu>

On Wed, 2006-07-19 at 21:12 -0400, Eric Breck wrote:
> > From: Daniel_Bünzli <daniel.buenzli@e...>

>  If I have to read someone else's code I want to
> > read caml code and not caml code augmented with the author's
> > syntactic obsessions.

> Succinctness is not precisely what I was after so much as locality -  

>  Such locality is a basic principle of software engineering,  
> and in this case I don't really know how to achieve it with only a  
> library (and not a syntax extension).

In my opinion, the difficulty here lies in the Ocaml 
programming model.

Precisely as you say above regarding locality .. the syntax
extensions should be localised. In particular, they should
be embedded in the file that uses them -- along with
documentation -- and not specified on the command line.

For example

syntax MyExtensions;;

which could itself be implemented in ocamlp4 perhaps,
and then *that* extension converted to a builtin part
of the language.

Felix implements syntax extensions with preprocessor
statements (which can be provided in a #included file).

Of course the syntax extension should contain documentation!

Having said that, I do agree excessive extensions make
code hard to read .. and probably defeat other tools
such as ocamldoc (which even if applied to expanded 
output may report on the expanded source when one would
prefer reporting on the unexpanded input).

This form of code generation is weak compared with
systems like MetaOcaml.

Similarly, Ocaml should have 

  import List;;
  .. List.fold_left ..

so that you are required to import a separately compiled
module before using it. As a sop to existing code, 

  open List;;

could imply import. grep for either 'open' or 'import'
is then enough to establish dependencies.

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2006-07-20  5:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-20  1:12 Eric Breck
2006-07-20  5:16 ` skaller [this message]
2006-07-20  6:29   ` Stefano Zacchiroli
2006-07-20  8:57     ` Jean-Marie Gaillourdet
2006-07-20 12:42 ` Bünzli Daniel
2006-07-20 12:40   ` Camlp4 mysteries (was Re: On language extensions (was Re: [Caml-list] global record)) Martin Jambon
2006-07-20 23:38     ` Alain Frisch
2006-07-21  0:11       ` Martin Jambon
2006-07-21  0:29       ` skaller
2006-07-21  0:31       ` Martin Jambon
  -- strict thread matches above, loose matches on Subject: below --
2006-07-19 17:14 [Caml-list] global record Eric Breck
2006-07-19 19:41 ` On language extensions (was Re: [Caml-list] global record) Daniel Bünzli
2006-07-19 19:57   ` Richard Jones
2006-07-19 20:22     ` Stefano Zacchiroli
2006-07-19 21:33   ` Nicolas Pouillard
2006-07-20  2:57   ` Martin Jambon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1153372578.18872.13.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=ebreck@cs.cornell.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).