caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] syntax foo
@ 2002-02-05 20:48 james woodyatt
  2002-02-05 21:21 ` Jérôme Marant
  0 siblings, 1 reply; 10+ messages in thread
From: james woodyatt @ 2002-02-05 20:48 UTC (permalink / raw)
  To: The Trade

everyone--

I have been keeping my opinions on this subject to myself in the hopes 
that it would not be *me* who would initiate a debate I'm sure many will 
find unwelcome.  Now that the subject has come up and everyone who 
really wants to opt out has written mail filters, I feel safe to join.

I've studied the revised syntax.  I've studied and mastered the standard 
syntax.  Here's what I think about them:

	+ The standard syntax is weird.  But it's not half as weird as 
Perl.  I come from Perl culture.  I am not here to complain about syntax.

	+ The revised syntax is clean.  But it feels "chunky"-- I see a lot 
more brackets and braces.  I've grown accustomed to the free-verse style 
available in the standard syntax, even if it is weird.  But I am not 
here to complain about syntax.

	+ Like with Ocaml, I learned Perl 5 on my own time.  They're 
changing the syntax again in Perl 6.  I plan to learn Perl 6 only when 
I'm paid for it.

	+ With the inclusion of camlp4 in the distribution, I don't have to 
care about the syntax of the language.  There's a parser and a printer 
to handle any conversions I may ever need to make.  If there isn't, I 
can write one.  In the end, the syntax is irrelevant; it's the semantics 
I care about.  I am not here to complain about syntax.

Here's why I don't want to see the Ocaml team make any changes to the 
syntax: I'm certain they have more important things they could be 
doing.  Like, for example, support for dynamic loading of native code on 
Mac OS X.


--
j h woodyatt <jhw@wetware.com>
"...the antidote to misinformation is more information, not less."
                                                      --vinton cerf

-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-05 20:48 [Caml-list] syntax foo james woodyatt
@ 2002-02-05 21:21 ` Jérôme Marant
  2002-02-06 15:30   ` Brian Rogoff
  0 siblings, 1 reply; 10+ messages in thread
From: Jérôme Marant @ 2002-02-05 21:21 UTC (permalink / raw)
  To: The Trade

On Tue, Feb 05, 2002 at 12:48:06PM -0800, james woodyatt wrote:

Hi James,

> 	+ With the inclusion of camlp4 in the distribution, I don't have to 
> care about the syntax of the language.  There's a parser and a printer 
> to handle any conversions I may ever need to make.  If there isn't, I 
> can write one.  In the end, the syntax is irrelevant; it's the semantics 
> I care about.  I am not here to complain about syntax.
> 
> Here's why I don't want to see the Ocaml team make any changes to the 
> syntax: I'm certain they have more important things they could be 
> doing.  Like, for example, support for dynamic loading of native code on 
> Mac OS X.

  I agree with all what you said. The current syntax is the one that was
  adopted in the very beginning of Caml. Its syntax is the one which
  make Caml different from other languages and it has been adopted by
  people all over the years. Changing it would make the 'OCaml touch'
  go away.
  
  People who want a Haskell-like syntax will have to go for Haskell or
  use camlp4 which seem to do the job pretty well regarding what people
  say about it.

  So, please stop pestering OCaml authors with syntactic considerations,
  I have no doubt that there are higher priority improvements.
  (it's up to them to decide or not on this though).

  Cheers,

-- 
Jérôme Marant <jerome@marant.org>
              <jerome.marant@free.fr>

http://marant.org
              
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-05 21:21 ` Jérôme Marant
@ 2002-02-06 15:30   ` Brian Rogoff
  2002-02-06 18:25     ` Markus Mottl
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Brian Rogoff @ 2002-02-06 15:30 UTC (permalink / raw)
  To: caml-list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1981 bytes --]

On Tue, 5 Feb 2002, [iso-8859-15] Jérôme Marant wrote:
> On Tue, Feb 05, 2002 at 12:48:06PM -0800, james woodyatt wrote:
> > Here's why I don't want to see the Ocaml team make any changes to the
> > syntax: I'm certain they have more important things they could be
> > doing.  Like, for example, support for dynamic loading of native code on
> > Mac OS X.
>
>   I agree with all what you said. The current syntax is the one that was
>   adopted in the very beginning of Caml. Its syntax is the one which
>   make Caml different from other languages and it has been adopted by
>   people all over the years. Changing it would make the 'OCaml touch'
>   go away.

Wow, I thought I'd stop at one post, but I can't let this one go.

Caml syntax is *not* why people like Caml. I'd go as far as to say that
lots of people adopt it in spite of its flawed (though not awful, like
Perl) syntax. To paraphrase American political soundbites, "It's the
sematics, stupid!". (PS: No, I'm not calling you stupid.)

>   People who want a Haskell-like syntax will have to go for Haskell or

The syntactic differences between Haskell and OCaml are insignificant
beside the semantic ones.

>   So, please stop pestering OCaml authors with syntactic considerations,
>   I have no doubt that there are higher priority improvements.
>   (it's up to them to decide or not on this though).

Priority is certainly subjective, but I agree with Gerard Huet who said
that we're really a long way from being ready with regards to tools
and documentation, and with Benjamin Pierce who says that a syntax change
now would be detrimental to OCaml's growing popularity as it would
make it harder on authors. Sophisticated OCamlists may adopt Revised
syntax now, or as they need it.

-- Brian
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 15:30   ` Brian Rogoff
@ 2002-02-06 18:25     ` Markus Mottl
  2002-02-06 19:58       ` Lauri Alanko
  2002-02-07  1:43       ` Brian Rogoff
  2002-02-06 19:08     ` Alexander V. Voinov
  2002-02-06 19:10     ` David Brown
  2 siblings, 2 replies; 10+ messages in thread
From: Markus Mottl @ 2002-02-06 18:25 UTC (permalink / raw)
  To: caml-list

On Wed, 06 Feb 2002, Brian Rogoff wrote:
> On Tue, 5 Feb 2002, [iso-8859-15] Jérôme Marant wrote:
> >   People who want a Haskell-like syntax will have to go for Haskell or
> 
> The syntactic differences between Haskell and OCaml are insignificant
> beside the semantic ones.

This is definitely not true: Haskell is sensitive to layout, which alone
makes it very different from a syntactic point of view. Though this
lets Haskell-programs look very nice to the human eye, it also makes
other things more difficult, e.g. using preprocessors or automatic code
generation. The parser is also more difficult to implement.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 15:30   ` Brian Rogoff
  2002-02-06 18:25     ` Markus Mottl
@ 2002-02-06 19:08     ` Alexander V. Voinov
  2002-02-06 19:10     ` David Brown
  2 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Voinov @ 2002-02-06 19:08 UTC (permalink / raw)
  To: Brian Rogoff; +Cc: caml-list

Hi All,

Brian Rogoff wrote:
> Caml syntax is *not* why people like Caml. ......................

I agree completely. I would have been using Caml much more than I am if
I felt myself comfortable with the syntax.

Alexander
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 15:30   ` Brian Rogoff
  2002-02-06 18:25     ` Markus Mottl
  2002-02-06 19:08     ` Alexander V. Voinov
@ 2002-02-06 19:10     ` David Brown
  2 siblings, 0 replies; 10+ messages in thread
From: David Brown @ 2002-02-06 19:10 UTC (permalink / raw)
  To: caml-list

On Wed, Feb 06, 2002 at 03:30:47PM +0000, Brian Rogoff wrote:

> Caml syntax is *not* why people like Caml. I'd go as far as to say that
> lots of people adopt it in spite of its flawed (though not awful, like
> Perl) syntax. To paraphrase American political soundbites, "It's the
> sematics, stupid!". (PS: No, I'm not calling you stupid.)

For myself, the Ocaml syntax is actually what won me over from SML.
Only later did I discover much of the other benefits of Ocaml.

Dave Brown
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 18:25     ` Markus Mottl
@ 2002-02-06 19:58       ` Lauri Alanko
  2002-02-06 20:41         ` Markus Mottl
  2002-02-07  1:43       ` Brian Rogoff
  1 sibling, 1 reply; 10+ messages in thread
From: Lauri Alanko @ 2002-02-06 19:58 UTC (permalink / raw)
  To: caml-list

On Wed, Feb 06, 2002 at 07:25:55PM +0100, Markus Mottl wrote:
> On Wed, 06 Feb 2002, Brian Rogoff wrote:
> > The syntactic differences between Haskell and OCaml are insignificant
> > beside the semantic ones.
> 
> This is definitely not true: Haskell is sensitive to layout, which alone
> makes it very different from a syntactic point of view. Though this
> lets Haskell-programs look very nice to the human eye, it also makes
> other things more difficult, e.g. using preprocessors or automatic code
> generation. The parser is also more difficult to implement.

Note that the layout rule in Haskell is _optional_. You can always use
explicit braces and semicolons and forget about indentation. So at least
your point on code generation doesn't hold.

Personally, I find Haskell's syntax (with or without the layout rule)
infinitely more convenient than OCaml's. Anything that uses "end" to mark
the end of a block is hopelessly clumsy and old-fashioned. :)

The sorest lack in both the old and the revised syntax is the need for a
let*-form, ie. a sequence of bindings, each of which is in the scope of the
previous ones. I _so_ hate doing this:

let foo = bar in
  let baz = quux in
    let fnord = fnarp in
      ...
      
Here foo occurs free in quux and baz occurs free in fnarp. So I have to
write "in let" between every binding, which is annoying, as is also the
nesting. I would prefer something like this:

let* foo = bar;
     baz = quux;
     fnord = fnarp; 
in
     ...
     
(Possibly even without the "in", it is also ugly.)

That should be enough whining for now. Thankfully, camlp4 allows everyone to
fix these issues according to their own preferences.


Lauri Alanko
la@iki.fi
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 19:58       ` Lauri Alanko
@ 2002-02-06 20:41         ` Markus Mottl
  2002-02-06 20:47           ` Alexander V. Voinov
  0 siblings, 1 reply; 10+ messages in thread
From: Markus Mottl @ 2002-02-06 20:41 UTC (permalink / raw)
  To: caml-list

On Wed, 06 Feb 2002, Lauri Alanko wrote:
> Note that the layout rule in Haskell is _optional_. You can always use
> explicit braces and semicolons and forget about indentation. So at least
> your point on code generation doesn't hold.

Ok.

> Personally, I find Haskell's syntax (with or without the layout rule)
> infinitely more convenient than OCaml's. Anything that uses "end" to mark
> the end of a block is hopelessly clumsy and old-fashioned. :)

I agree that Haskell-code looks much nicer than OCaml-code. The question
is whether anybody would want to write an advanced parser for OCaml...

> The sorest lack in both the old and the revised syntax is the need for a
> let*-form, ie. a sequence of bindings, each of which is in the scope of the
> previous ones. I _so_ hate doing this:
> 
> let foo = bar in
>   let baz = quux in
>     let fnord = fnarp in
>       ...

Well, one doesn't have to indent each line, of course. It's still a bit
painful to have all those "let"s and "in"s.

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 20:41         ` Markus Mottl
@ 2002-02-06 20:47           ` Alexander V. Voinov
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Voinov @ 2002-02-06 20:47 UTC (permalink / raw)
  To: Markus Mottl; +Cc: caml-list

Hi All,

Markus Mottl wrote:
> > let*-form, ie. a sequence of bindings, each of which is in the scope of the

I also don't understand (maybe I've read this long ago and forgot the
underlying reasoning) why the burden on distinguishing between 'let' and
'let rec' is laid on the programmer? Can't a parser figure out when a
function is recursive and when not? I believed that in a functional
language all functions are recursive by default.

Alexander
-------------------
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] 10+ messages in thread

* Re: [Caml-list] syntax foo
  2002-02-06 18:25     ` Markus Mottl
  2002-02-06 19:58       ` Lauri Alanko
@ 2002-02-07  1:43       ` Brian Rogoff
  1 sibling, 0 replies; 10+ messages in thread
From: Brian Rogoff @ 2002-02-07  1:43 UTC (permalink / raw)
  To: Markus Mottl; +Cc: caml-list

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=X-UNKNOWN, Size: 1207 bytes --]

On Wed, 6 Feb 2002, Markus Mottl wrote:
> On Wed, 06 Feb 2002, Brian Rogoff wrote:
> > On Tue, 5 Feb 2002, [iso-8859-15] Jérôme Marant wrote:
> > >   People who want a Haskell-like syntax will have to go for Haskell or
> >
> > The syntactic differences between Haskell and OCaml are insignificant
> > beside the semantic ones.
>
> This is definitely not true: Haskell is sensitive to layout, which alone
> makes it very different from a syntactic point of view. Though this
> lets Haskell-programs look very nice to the human eye, it also makes
> other things more difficult, e.g. using preprocessors or automatic code
> generation. The parser is also more difficult to implement.

Parsing is easy, even for "hard" to parse languages like Haskell. I
haven't written more than trivial programs in Haskell or Clean, but I
find it a lot harder to get used to the semantic differences than the
syntactic ones. In fact, I've never found syntax the hard part of learning
any programming language.

-- Brian
-------------------
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] 10+ messages in thread

end of thread, other threads:[~2002-02-07  6:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-05 20:48 [Caml-list] syntax foo james woodyatt
2002-02-05 21:21 ` Jérôme Marant
2002-02-06 15:30   ` Brian Rogoff
2002-02-06 18:25     ` Markus Mottl
2002-02-06 19:58       ` Lauri Alanko
2002-02-06 20:41         ` Markus Mottl
2002-02-06 20:47           ` Alexander V. Voinov
2002-02-07  1:43       ` Brian Rogoff
2002-02-06 19:08     ` Alexander V. Voinov
2002-02-06 19:10     ` David Brown

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).