Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] Threats on future of Camlp4
@ 2002-10-06 18:55 Daniel de Rauglaudre
  2002-10-06 19:23 ` Chris Hecker
                   ` (2 more replies)
  0 siblings, 3 replies; 40+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-06 18:55 UTC (permalink / raw)
  To: caml-list

Hi everybody,

I am very sorry to announce here that the attitude of the direction of
the caml team is seriously comprimizing the future of Camlp4. I would
like you to send messages to stop that. Thank you if you can help.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 40+ messages in thread
[parent not found: <200202061059.g16Ax2n25555@concorde.inria.fr>]
[parent not found: <3C60E263.D2E35B3A@tsc.uc3m.es>]
* Re: [Caml-list] syntax
@ 2002-02-05 21:47 Michael Vanier
  2002-02-06 12:24 ` Daniel de Rauglaudre
  2002-02-06 12:53 ` Achim Blumensath
  0 siblings, 2 replies; 40+ messages in thread
From: Michael Vanier @ 2002-02-05 21:47 UTC (permalink / raw)
  To: caml-list


I've looked at the revised syntax, and I like most of what I see (except
for the use of x.val instead of !x).  One question: how many shift-reduce
conflicts does the revised syntax have?  

Mike
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 40+ messages in thread
* [Caml-list] Syntax
@ 2002-02-05 14:18 Gerard Huet
  2002-02-05 14:49 ` Markus Mottl
                   ` (2 more replies)
  0 siblings, 3 replies; 40+ messages in thread
From: Gerard Huet @ 2002-02-05 14:18 UTC (permalink / raw)
  To: caml-list

At 13:05 05/02/02 +0100, Daniel de Rauglaudre wrote: 
>Hi, 
> 
>On Tue, Feb 05, 2002 at 12:53:39PM +0100, Remi VANICAT wrote: 
> 
>> So the fact that a library or a tool is written in revised or 
>> standard library doesn't change anything for those who use it. The 
>> only problem is for those who want to change the source, but it's 
>> not so hard to learn this syntax if you want to use it. 
> 
>Exactly.
Yessir. 
It is trivial to switch to revised syntax. It will take you one week to 
get used to True/False vs true/false, to use square brackets in [x :: l], 
and to write (list int) instead of (int list). I never missed the double 
semicolon, and many problems will ill-parenthesised matches just went into 
oblivion. What I missed most is that you can't anymore step through the 
toplevel with mouse cut-and-paste, because the inner let's are not accepted 
at toplevel, you have to write the godamn "value" keyword instead.
Until recently there was no point in pushing the revised syntax, because it 
was very hard to teach the language when the system's printer used another 
syntax than what you typed in. Now that there is smooth integration of 
camlp4 with ocaml with the 3.04, there is no excuse not to use the much 
superior revised syntax, in my opinion. Which does not mean that there 
should be a big concerted effort to switch all our code from one syntax to 
the next. 
I am currently developing a computational linguistics platform in ocaml, now
around 12000 loc in about 50 modules, mostly in revised syntax, some others 
borrowed from other sources or mechanically produced and still in vanila 
syntax, so what. The makefile does what is needed, and I never have any 
problem reading other people's programs from libraries or the hump, etc. 

The crucial point is that we need good tutorials, reference manuals, and
books 
in the revised syntax before being serious about "standardizing" in something 
else than the usual syntax. Once this material exists, then we can talk. 

Let me tell you about an experience I did recently, in using Ocaml as a 
publication language. In the first version of my paper, I said "we shall 
use as algorithmic meta-language OCaml under so-called revised syntax". 
Now one referee got very interested in the code, tried it on his machine
with ocaml 3.02, missed my remark about revised syntax, and said "it is too
bad these are not real programs which people can directly use". Another
referee got completely turned off by the code and said "remove all
proselytism about this weird Ocaml stuff, and use some pidgin algorithmic
language". Typical dilemna. 

What I ended up was writing a short presentation of an algorithmic 
meta-language which I called "Pidgin ML", without any proselytism about 
existing programming languages; it is only in the evaluation part of the 
paper that I reveal that Pidgin ML can be compiled and executed as such by
OCaml+Camlp4. So everybody is happy !

Just as a short plug for revised syntax, here is my introduction:
____________________________________

We shall use as {\sl meta language} for the description of our algorithms 
a pidgin version of the functional language ML. Readers familiar with ML 
may skip this section, which gives a crash overview of its syntax and 
semantics.

The core language has types, values, and exceptions. 
Thus, \verb:1: is a value of predefined type \verb:int:, whereas 
\verb:"CL": is a \verb:string:. 
Pairs of values inhabit the corresponding product type. Thus: 
\verb|(1,"CL") : (nat * string)|. 
Recursive type declarations create new types, 
whose values are inductively built from the associated constructors. 
Thus the Boolean type could be declared as a sum by: 
\verb:type bool = [True | False];:\\ 
Parametric types give rise to polymorphism. 
Thus if \verb:x: is of type \verb:t: and \verb:l: is of type 
\verb:(list t):, we construct the list adding \verb:x: to \verb:l: 
as \verb|[x :: l]|. The empty list is \verb:[]:, of (polymorphic) type 
\verb:(list 'a):. Although the language is strongly typed, explicit type 
specification is rarely needed from the designer, since principal types 
may be inferred mechanically.

The language is functional in the sense that functions are first class 
objects. Thus the doubling integer function may be written as 
\verb:fun x -> x+x:, and it has type \verb:int -> int:. It may be associated 
to the name \verb:double: by declaring: \verb:value double = fun x -> x+x;:\\ 
Equivalently we could write: \verb:value double x = x+x;:\\ 
Its application to value \verb:n: is written as \verb:(double n): or even 
\verb:double n: when there is no ambiguity. Application associates to the 
left, and thus \verb:f x y: stands for \verb:((f x) y):. 
Recursive functional values are declared with the keyword \verb:rec:. 
Thus we may define the factorial function as:\\ 
\verb:value rec fact n = n*(fact (n-1));:\\ 
Functions may be defined by pattern matching. Thus the first projection of 
pairs could be defined by:\\ 
\verb:value fst = fun [ (x,y) -> x ];:\\ 
or equivalently (since there is only one pattern in this case) by:\\ 
\verb:value fst (x,y) = x;:\\ 
Pattern-matching is also usable in \verb:match: expressions which generalise 
case analysis, 
such as: \verb:match l with [ [] -> True | _ -> False ]:, which 
tests whether list \verb:l: is empty, using underscore as catch-all 
pattern.

Evaluation is strict, which means that \verb:x: is evaluated before 
\verb:f: in the evaluation of \verb:(f x):. The \verb:let: expressions 
permit to sequentialise computation, and to share sub-computations. Thus 
\verb:let x = fact 10 in x+x: will compute \verb:fact 10: first, 
and only once. 
An equivalent postfix \verb:where: notation may be used as well. Thus 
the conditional expression \verb:if b then e1 else e2: is equivalent to: 
\verb:choose b where choose = fun [ True -> e1 | False -> e2]:.

Exceptions are declared with the type of their parameters, like in: 
\verb:exception Failure of string;:
An exceptional value may be raised, like in: 
\verb:raise (Failure "div 0"): and handled by a \verb:try: switching on 
exception patterns, such as:
\verb:try expression with [ Failure s -> ... ]:.
Other imperative constructs may be used, such as 
references, mutable arrays, while loops and I/O commands, 
but we shall seldom need them. Sequences of instructions are 
evaluated in left to right regime in \verb:do: expressions, such as: 
\verb:do {e1; ... en}:. 

ML is a {\sl modular} language, in the sense that sequences of type, value 
and exception declarations may be packed in a structural unit called a 
\verb:module:, amenable to separate treatment. 
Modules have types themselves, called {\sl signatures}. Parametric 
modules are called {\sl functors}. The algorithms presented in this paper 
will use in essential ways 
this modularity structure, but the syntax ought to be self-evident.

Readers uninterested in computational details may think of ML 
definitions as recursive equations over inductively defined algebras. Most 
of them are simple primitive recursive functionals. 
___________________________________________________
At this point, note that Pidgin ML has no objects (not even records!) nor
labels.

And later on I spill the beans:
Pidgin ML definitions may actually be directly executed as Objective Caml 
programs \cite{ocaml}, under the so-called revised syntax \cite{camlp4}. 

>> By the way, is there any caml-mode for Emacs and the revised syntax ? 
> 
>I don't think so but there is a request for that (Gérard Huet asked 
>me yesterday). I use a very old caml-light-or-what emacs mode and I 
>am too lazy to look at emacs-lisp to create my mode.

This is an important point. I myself use a slighly hacked version of Tuareg 
as an interim solution. I shall have a look at otags, which, being built 
with camlp4 support, ought to be parametrizable (?).

I suggest this syntax problem should be seriously considered, but as a 
long-term effort, encompassing development tools and documentation and 
training material. This is not a battle that can be won by one round of 
email flame.

Gerard


-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2002-10-13  9:02 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-06 18:55 [Caml-list] Threats on future of Camlp4 Daniel de Rauglaudre
2002-10-06 19:23 ` Chris Hecker
2002-10-06 19:52   ` Daniel de Rauglaudre
2002-10-06 21:01   ` brogoff
2002-10-06 21:09     ` Daniel de Rauglaudre
2002-10-06 19:29 ` Oleg
2002-10-06 20:01   ` Daniel de Rauglaudre
2002-10-06 20:24     ` Alessandro Baretta
2002-10-06 20:24       ` Daniel de Rauglaudre
     [not found]         ` <200210062143.g96Lhix15834@orchestra.cs.caltech.edu>
2002-10-07  2:47           ` Daniel de Rauglaudre
2002-10-06 20:28     ` Dave Mason
2002-10-06 20:50       ` Daniel de Rauglaudre
2002-10-06 20:45     ` Oleg
2002-10-06 21:03       ` Daniel de Rauglaudre
2002-10-06 21:46         ` Florian Douetteau
2002-10-07  2:56           ` Daniel de Rauglaudre
2002-10-06 23:54     ` Markus Mottl
2002-10-07  9:06       ` Daniel de Rauglaudre
2002-10-11 11:34       ` Kontra, Gergely
2002-10-11 12:56         ` Alessandro Baretta
2002-10-11 13:15         ` [Caml-list] Future " Daniel de Rauglaudre
2002-10-12 21:45           ` Oleg
2002-10-13  9:02             ` Daniel de Rauglaudre
2002-10-11 16:36         ` [Caml-list] Syntax brogoff
2002-10-07  7:21 ` [Caml-list] Threats on future of Camlp4 Sven LUTHER
2002-10-07  8:52   ` Daniel de Rauglaudre
2002-10-07 11:25     ` Sven LUTHER
2002-10-07 11:30       ` Daniel de Rauglaudre
2002-10-07 11:55         ` Sven LUTHER
2002-10-08  7:57     ` Alessandro Baretta
     [not found]       ` <nhalm59cf0s.fsf@malabar.mitre.org>
2002-10-08 14:05         ` Alessandro Baretta
     [not found] <200202061059.g16Ax2n25555@concorde.inria.fr>
2002-02-06 12:09 ` [Caml-list] Syntax Diego olivier FERNANDEZ PONS
     [not found] <3C60E263.D2E35B3A@tsc.uc3m.es>
2002-02-06 10:08 ` Diego olivier FERNANDEZ PONS
  -- strict thread matches above, loose matches on Subject: below --
2002-02-05 21:47 [Caml-list] syntax Michael Vanier
2002-02-06 12:24 ` Daniel de Rauglaudre
2002-02-06 12:53 ` Achim Blumensath
2002-02-05 14:18 [Caml-list] Syntax Gerard Huet
2002-02-05 14:49 ` Markus Mottl
2002-02-05 15:16 ` Jean-Francois Monin
2002-02-05 17:51 ` Diego olivier FERNANDEZ PONS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox