caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] "Let"-less syntax for coreML
@ 2012-01-03 18:43 Diego Olivier Fernandez Pons
  2012-01-03 19:09 ` Alan Schmitt
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Diego Olivier Fernandez Pons @ 2012-01-03 18:43 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

    List,

I was wondering if there was any obstruction to the removal of the "let"
keyword in a syntax for coreML.

My reasoning is that because everytime there is a "let" there is also an
"=" sign, we could completely remove the "let" and use the "=" sign instead
to identify new symbol introductions.

x = 1
s = function x -> x + 1
d = s 1
o = function f g -> function x -> f (g x)

The only cases to handle would be
- comparison "=" sign : replaced by "=="
- let rec : could be ignored or replaced by something else like "=|"
- equational style 'let f x y = x + y' : forbid

Does anyone see anything that could prevent this from being done ?

         Diego Olivier

[-- Attachment #2: Type: text/html, Size: 966 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-03 18:43 [Caml-list] "Let"-less syntax for coreML Diego Olivier Fernandez Pons
@ 2012-01-03 19:09 ` Alan Schmitt
  2012-01-03 19:12 ` Wojciech Meyer
  2012-01-03 22:34 ` Gabriel Scherer
  2 siblings, 0 replies; 14+ messages in thread
From: Alan Schmitt @ 2012-01-03 19:09 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

On 3 janv. 2012, at 19:43, Diego Olivier Fernandez Pons wrote:

> - equational style 'let f x y = x + y' : forbid

This seems a bit extreme.

Alan


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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-03 18:43 [Caml-list] "Let"-less syntax for coreML Diego Olivier Fernandez Pons
  2012-01-03 19:09 ` Alan Schmitt
@ 2012-01-03 19:12 ` Wojciech Meyer
  2012-01-03 22:18   ` Diego Olivier Fernandez Pons
  2012-01-03 22:34 ` Gabriel Scherer
  2 siblings, 1 reply; 14+ messages in thread
From: Wojciech Meyer @ 2012-01-03 19:12 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list


Hi,

Diego Olivier Fernandez Pons <dofp.ocaml@gmail.com> writes:

>     List,
>
>
> I was wondering if there was any obstruction to the removal of the
> "let" keyword in a syntax for coreML.
>
> My reasoning is that because everytime there is a "let" there is also
> an "=" sign, we could completely remove the "let" and use the "=" sign
> instead to identify new symbol introductions.

>
> x = 1
> s = function x -> x + 1
> d = s 1
> o = function f g -> function x -> f (g x)
>
> The only cases to handle would be
> - comparison "=" sign : replaced by "=="
> - let rec : could be ignored or replaced by something else like "=|"
> - equational style 'let f x y = x + y' : forbid
>
> Does anyone see anything that could prevent this from being done ?

The problem here is that it would cause:

- ambiguity with structure equivalence operator
- ambiguity in the parser, e.g. the toplevel let bindings are separated
  by "let", the local lets by pair "let" and "in"
- replacement of == would not be good as it is reserved for physical
  equality
- ignoring "rec" - no good too - please see the other thread, it
  contradicts how the aliasing of values is now used e.g. for extending 
  modules via. include

--
Wojciech


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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-03 19:12 ` Wojciech Meyer
@ 2012-01-03 22:18   ` Diego Olivier Fernandez Pons
  0 siblings, 0 replies; 14+ messages in thread
From: Diego Olivier Fernandez Pons @ 2012-01-03 22:18 UTC (permalink / raw)
  To: Wojciech Meyer; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

    Wojciech,


> - ambiguity with structure equivalence operator

- replacement of == would not be good as it is reserved for
> physical equality


Pointer equality is not coreML (not in SML, nor F#). Easy to fix anyway.

- ambiguity in the parser, e.g. the toplevel let bindings are separated
>  by "let", the local lets by pair "let" and "in"
>

I thought about this one... that's the interesting point of forcing a
single name on the left of the '=' sign

     f = fun x y -> x + y

you can deduce this meant LET f = fun x y -> x + y and therefore know where
the previous instruction ends because the two constructions are isomorphic.

Say

    let g = fun x -> x + 1 in let f = fun x -> let v = g 0 in x + v

becomes

   g = fun x -> x + 1 f = fun x -> v = g 0 in x + v

with a unique semantic

  g = fun x -> x + 1
  f = fun x ->
        v = g 0
     in x + v

You only need "in" for the return value of the function, all other elements
being separated by an implicit ";"

Notice that "fun" is also useless, the arrow alone shows it is a
function  g = x -> x + 1 but that feels a bit extreme.

- ignoring "rec" - no good too - please see the other thread, it
>  contradicts how the aliasing of values is now used e.g. for extending
>  modules via. include
>

Easy to fix as well.

        Diego Olivier

[-- Attachment #2: Type: text/html, Size: 2791 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-03 18:43 [Caml-list] "Let"-less syntax for coreML Diego Olivier Fernandez Pons
  2012-01-03 19:09 ` Alan Schmitt
  2012-01-03 19:12 ` Wojciech Meyer
@ 2012-01-03 22:34 ` Gabriel Scherer
  2012-01-04 10:05   ` Diego Olivier Fernandez Pons
  2 siblings, 1 reply; 14+ messages in thread
From: Gabriel Scherer @ 2012-01-03 22:34 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

I feel I am missing some background. What is this "coreML" and what is
the point of making subtle syntactic changes to it?

On Tue, Jan 3, 2012 at 7:43 PM, Diego Olivier Fernandez Pons
<dofp.ocaml@gmail.com> wrote:
>     List,
>
> I was wondering if there was any obstruction to the removal of the "let"
> keyword in a syntax for coreML.
>
> My reasoning is that because everytime there is a "let" there is also an "="
> sign, we could completely remove the "let" and use the "=" sign instead to
> identify new symbol introductions.
>
> x = 1
> s = function x -> x + 1
> d = s 1
> o = function f g -> function x -> f (g x)
>
> The only cases to handle would be
> - comparison "=" sign : replaced by "=="
> - let rec : could be ignored or replaced by something else like "=|"
> - equational style 'let f x y = x + y' : forbid
>
> Does anyone see anything that could prevent this from being done ?
>
>          Diego Olivier


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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-03 22:34 ` Gabriel Scherer
@ 2012-01-04 10:05   ` Diego Olivier Fernandez Pons
  2012-01-04 10:57     ` Pierre-Alexandre Voye
  2012-01-04 11:06     ` Daniel Bünzli
  0 siblings, 2 replies; 14+ messages in thread
From: Diego Olivier Fernandez Pons @ 2012-01-04 10:05 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]

    Gabriel,


> I feel I am missing some background. What is this "coreML"


Typed lambda calculus with typical sugar
http://caml.inria.fr/pub/docs/u3-ocaml/ocaml-ml.html and common basis
(intersection) of all ML languages (SML, OCaml, F#, Haskell)


> and what is the point of making subtle syntactic changes to it?
>

I agree with Don Syme that the syntax of MLs could be simplified to make
them easier for the masses but I don't like the indentation for block
delimitation rule (Landin's off-side rule) he uses in F# to remove the
"begin / end" and the "let ... in" constructions. Not saying it is ever
going to happen but it is worth thinking about it and maybe giving a try on
my side.

The underlying question is "how to make ML mainstream" which is what the
(broad) ML community has been trying to do for decades with limited
success. Among other things we have tried
- standards (SML, Haskell 98) with multiple implementations
- optimizing compilers (OCaml, MLTon)
- education (first language, data structures, books)
- (killer) applications
- popular virtual machines (Java, CLR) to reuse their code base
- web (Caml as browser extension language in MMM, Caml to JavaScript
compilation)
and many more

Agreed that many of these were successful research projects, not
specifically meant to take over the world (of programming languages).

The result is two folds
- a technical success : check the code written by the INRIA teams, almost
everyone uses Caml but those with very specific needs (Java rewriting
systems, Prolog, high performance Grobner basis, etc).
- a mainstream failure : limited industrial usage besides a couple of
companies

        Diego Olivier

[-- Attachment #2: Type: text/html, Size: 2326 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 10:05   ` Diego Olivier Fernandez Pons
@ 2012-01-04 10:57     ` Pierre-Alexandre Voye
  2012-01-04 11:08       ` Andrej Bauer
  2012-01-04 11:06     ` Daniel Bünzli
  1 sibling, 1 reply; 14+ messages in thread
From: Pierre-Alexandre Voye @ 2012-01-04 10:57 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 2187 bytes --]

I wrote a memoire about "why language succeed", and my conclusion was
people prefers simple concept at first, even if complex problem become
intricately  more complex with simpler langage than more powerful like
ML/Haskell/Smalltalk/whatever.
People are lazy, they don't want to think, they want to write lines of code.
Plus, IMHO, imperative permit people to construct algorithms step by step,
rather FP which oblige to have a precise idea of your algorithm.
IT Industry wants programmers as factory worker (especially in France),
they don't want educated people with mathematical background (95% of my
former business associate don't know what "Turing complete" is).
IT industry is not interested by productivity improvment at all, it would
reduce their margin... Jacquard-loom syndrome..
So unhappily, ML/Haskell/Smalltalk/Prolog/Whatever will remain an elite
language.

You can turn around about many topics (syntax, education, etc...), theses
languages will gain what ? 1 or 3% ?

2012/1/4 Diego Olivier Fernandez Pons <dofp.ocaml@gmail.com>

>    [cut]
>
> The underlying question is "how to make ML mainstream" which is what the
> (broad) ML community has been trying to do for decades with limited
> success. Among other things we have tried
>  - standards (SML, Haskell 98) with multiple implementations
> - optimizing compilers (OCaml, MLTon)
> - education (first language, data structures, books)
> - (killer) applications
> - popular virtual machines (Java, CLR) to reuse their code base
> - web (Caml as browser extension language in MMM, Caml to JavaScript
> compilation)
> and many more
>
> Agreed that many of these were successful research projects, not
> specifically meant to take over the world (of programming languages).
>
> The result is two folds
> - a technical success : check the code written by the INRIA teams, almost
> everyone uses Caml but those with very specific needs (Java rewriting
> systems, Prolog, high performance Grobner basis, etc).
> - a mainstream failure : limited industrial usage besides a couple of
> companies
>
>         Diego Olivier
>



-- 
---------------------
https://twitter.com/#!/ontologiae/
http://linuxfr.org/users/montaigne

[-- Attachment #2: Type: text/html, Size: 2948 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 10:05   ` Diego Olivier Fernandez Pons
  2012-01-04 10:57     ` Pierre-Alexandre Voye
@ 2012-01-04 11:06     ` Daniel Bünzli
  2012-01-04 12:18       ` Yaron Minsky
  1 sibling, 1 reply; 14+ messages in thread
From: Daniel Bünzli @ 2012-01-04 11:06 UTC (permalink / raw)
  To: caml-list

> The underlying question is "how to make ML mainstream" which is what the

Am I the only one to be very, very, very, tired of this question ?

There's an obvious thing missing in the list of what has been tried.
Well-done and maintained libraries you can use for about any
programming task you have at hand -- but I highly doubt this will make
"ML mainstream" either, I'm just defending my own interest.

IIRC you used to be a library designer, please stop fiddle with the
syntax of the language. Library design is also language design. Pick a
missing OCaml library you'd have interest in implementing (e.g. a good
interface to imap protocol but you may not be interested in that) and
fill in the void with a great, modular and tasteful implementation.

Best,

Daniel

P.S. If you think syntax is the main answer to the question above
maybe you should have a chat with users of "mainstream" programming
languages. In my experience, you'll soon see that their tastes and
philosophical view points on programming are rather different than
yours (which may be due to ignorance, lack of education and marketing
influence but that's rather presumptuous for me to say).

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 10:57     ` Pierre-Alexandre Voye
@ 2012-01-04 11:08       ` Andrej Bauer
  0 siblings, 0 replies; 14+ messages in thread
From: Andrej Bauer @ 2012-01-04 11:08 UTC (permalink / raw)
  To: caml-list

I was once at a talk in which we discussed new programming concepts in
a programming language. One person said "a new programming language
whose concepts are not understood by ordinary programers is
worthless", to which another replied "a new programming language whose
concepts are understood by ordinary programmers is worthless".

Cheers,

Andrej

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 11:06     ` Daniel Bünzli
@ 2012-01-04 12:18       ` Yaron Minsky
  2012-01-04 13:30         ` Diego Olivier Fernandez Pons
  2012-01-04 16:59         ` Markus Mottl
  0 siblings, 2 replies; 14+ messages in thread
From: Yaron Minsky @ 2012-01-04 12:18 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

On Wed, Jan 4, 2012 at 6:06 AM, Daniel Bünzli
<daniel.buenzli@erratique.ch>wrote:

> > The underlying question is "how to make ML mainstream" which is what the
>
> Am I the only one to be very, very, very, tired of this question ?
>

You're not the only one.

I think the biggest thing the community can do to improve OCaml is not to
tweak around with language design.  It's to improve the library packaging
situation.  Oasis seems to be the effort in this direction that has the
most momentum, so I think pushing Oasis to become every bit as good as
Hackage and Cabal is really the place to get maximum leverage.

y

[-- Attachment #2: Type: text/html, Size: 971 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 12:18       ` Yaron Minsky
@ 2012-01-04 13:30         ` Diego Olivier Fernandez Pons
  2012-01-04 15:50           ` Edgar Friendly
  2012-01-04 17:12           ` Damien Doligez
  2012-01-04 16:59         ` Markus Mottl
  1 sibling, 2 replies; 14+ messages in thread
From: Diego Olivier Fernandez Pons @ 2012-01-04 13:30 UTC (permalink / raw)
  To: Yaron Minsky; +Cc: Daniel Bünzli, caml-list

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

     Yaron,


> > The underlying question is "how to make ML mainstream" which is what the
>>
>> Am I the only one to be very, very, very, tired of this question ?
>>
>
> You're not the only one.
>

Mmm... I didn't request or even suggest a syntax change. I only asked what
potential issues it could create.


> I think the biggest thing the community can do to improve OCaml is not to
> tweak around with language design.  It's to improve the library packaging
> situation.  Oasis seems to be the effort in this direction that has the
> most momentum, so I think pushing Oasis to become every bit as good as
> Hackage and Cabal is really the place to get maximum leverage.
>

Then just do it.

         Diego Olivier

[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 13:30         ` Diego Olivier Fernandez Pons
@ 2012-01-04 15:50           ` Edgar Friendly
  2012-01-04 17:12           ` Damien Doligez
  1 sibling, 0 replies; 14+ messages in thread
From: Edgar Friendly @ 2012-01-04 15:50 UTC (permalink / raw)
  To: caml-list

On 01/04/2012 08:30 AM, Diego Olivier Fernandez Pons wrote:
>     I think the biggest thing the community can do to improve OCaml is
>     not to tweak around with language design.  It's to improve the
>     library packaging situation.
>
> Then just do it.


I have, and the result is odb[1].  It backends with oasis-db[2], meaning 
if you upload your oasis package, it will be installable via odb, 
including deps.  After finding out about barbra[3], a similar project 
with a different starting point, I stole many of their good ideas, and 
now have support for a local `packages` file that provides metadata for 
packages not available through oasis-db.  This packages file allows 
installation of packages available from arbitrary URLs (anything 
curl-able), git, svn, cvs, hg, darcs, as well as local directories.

For a large number of package examples (plus non-examples of packages 
that fail to auto-install through make/omake/oasis), look here: 
https://github.com/thelema/odb/blob/master/packages

Contributions of additional packages welcome, fixes to the programs that 
don't auto-install (See the bottom half of the packages file) are doubly 
welcome.

E.


[1] https://github.com/thelema/odb
[2] http://oasis.forge.ocamlcore.org/oasis-db.html and 
http://oasis.ocamlcore.org/dev/odb/
[3] still in stealth mode, maybe I shouldn't have stolen their thunder 
by mentioning them

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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 12:18       ` Yaron Minsky
  2012-01-04 13:30         ` Diego Olivier Fernandez Pons
@ 2012-01-04 16:59         ` Markus Mottl
  1 sibling, 0 replies; 14+ messages in thread
From: Markus Mottl @ 2012-01-04 16:59 UTC (permalink / raw)
  To: Yaron Minsky; +Cc: Daniel Bünzli, caml-list

On Wed, Jan 4, 2012 at 07:18, Yaron Minsky <yminsky@janestreet.com> wrote:
> I think the biggest thing the community can do to improve OCaml is not to
> tweak around with language design.  It's to improve the library packaging
> situation.  Oasis seems to be the effort in this direction that has the most
> momentum, so I think pushing Oasis to become every bit as good as Hackage
> and Cabal is really the place to get maximum leverage.

I would say that Jane Street is in a unique position to make a
difference here.  Having by far the largest OCaml team in the world,
nobody else is as likely to benefit from and to achieve the goal of
improving the library packaging situation.  Just being able to attract
more people to OCaml and hence potential employees would seem well
worth the cost of specifically dedicating resources and pushing this
project through.  It is not very likely that individuals or small
companies will be able or willing to support this project in the long
term, and the OCaml team/INRIA understandably has other priorities (=
research).

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


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

* Re: [Caml-list] "Let"-less syntax for coreML
  2012-01-04 13:30         ` Diego Olivier Fernandez Pons
  2012-01-04 15:50           ` Edgar Friendly
@ 2012-01-04 17:12           ` Damien Doligez
  1 sibling, 0 replies; 14+ messages in thread
From: Damien Doligez @ 2012-01-04 17:12 UTC (permalink / raw)
  To: caml-list

On 2012-01-04, at 14:30, Diego Olivier Fernandez Pons wrote:

> Mmm... I didn't request or even suggest a syntax change. I only asked what potential issues it could create.

Here is one: as far as I can tell, it cannot be parsed by an LALR(1) parser.

-- Damien



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

end of thread, other threads:[~2012-01-04 17:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 18:43 [Caml-list] "Let"-less syntax for coreML Diego Olivier Fernandez Pons
2012-01-03 19:09 ` Alan Schmitt
2012-01-03 19:12 ` Wojciech Meyer
2012-01-03 22:18   ` Diego Olivier Fernandez Pons
2012-01-03 22:34 ` Gabriel Scherer
2012-01-04 10:05   ` Diego Olivier Fernandez Pons
2012-01-04 10:57     ` Pierre-Alexandre Voye
2012-01-04 11:08       ` Andrej Bauer
2012-01-04 11:06     ` Daniel Bünzli
2012-01-04 12:18       ` Yaron Minsky
2012-01-04 13:30         ` Diego Olivier Fernandez Pons
2012-01-04 15:50           ` Edgar Friendly
2012-01-04 17:12           ` Damien Doligez
2012-01-04 16:59         ` Markus Mottl

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