Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!sfk From: sfk@otter.hpl.hp.com (Steve Knight) Newsgroups: comp.lang.lisp Subject: Re: Virtues of ML syntax Message-ID: <1350031@otter.hpl.hp.com> Date: 24 Sep 90 18:02:15 GMT References: <1990Sep18.174851.4175@rice.edu> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 39 Cliff wonders: > I find ML syntax to be incredibly > unreadable, while Scheme & C syntax isn't that bad. [...] > 1) Not enough experience with ML, Nope -- the more you use it, the more you hate it. > 2) the difficultly of having a type system in a function language, Nope -- the type system is a pain, but that's got nothing to do with the syntax. It's easy to write a ML-style type-checker for S-expression syntax languages. > 3) lousy design of ML syntax or Alas, it is true. ML's syntax is riddled with problems - the lack of a closing keyword for IF means that you are left guessing how it binds with respect to (for example) a HANDLE statement. The overloading of END means that you are frequently left guessing, or measuring indentation with a ruler, to work out what closes with what. The fact that datatype constructors are tupled rather than curried (as in Miranda) means that pattern matching involves many superfluous brackets. The incorrect precedence for FN almost always forces the insertion of disambiguating brackets. The failure to properly distinguish variable namespaces from constructor namespaces (as is done correctly in Prolog) means that it is trivial to write incorrect programs ..... and so on. As an example of this last point, I will leave you with a rather uncomfortable observation about ML. Taking this definition in isolation out of a program, you cannot determine what it means because the context is too important. fun f x = x; (Get it? "x" might be a constructor or a variable. You don't know.) > Gratefully awaiting your enlightened responses, Sorryfully, I have to say that ML is one of the few languages that makes me wish I was using S-expression syntax. Now stop that sniggering at the back... Steve