3 ms·
Also, Standard ML. I learned Standard ML and created a couple toy systems in it before becoming utterly frustrated with the insane state of the "standard" libra
by kwantam 16y ago
Also, Standard ML. I learned Standard ML and created a couple toy systems in it before becoming utterly frustrated with the insane state of the "standard" library[1] and fleeing to Haskell. I briefly considered OCaml, but of the MLish languages it seemed to me that OCaml had the ugliest syntax, so I chose Haskell instead. Dumb reason to choose a language, probably, but I absolutely adore Haskell.
...and I have spent an entire weekend trying to figure out how to describe within Haskell's type system something that is trivial in scheme[2] !
[1] In particular, there's a lot that's not in the SML spec that most people want in a stdlib, and every compiler's implementation is quite different. This means once you decide to use SML/NJ, if someone else has written a library you need, but for MLton, you're just up the creek. Perhaps this also happens with resp. GHC and Hugs, but I haven't found it to be nearly as much of a problem.
[2] If you care: can I create a function that takes as its arguments another function and a list, and applies the elements of the list as arguments to the function? E.g., listApply (+) [1,2] should return 3. In scheme, assuming that you already have curried functions, this is trivial. In Haskell, it's exceedingly difficult. Consider: the approach in scheme, iterative partial applications, absolutely won't work in Haskell, since the types won't match: (+) has type (Num t) => t -> t -> t, but (+1) is (Num t) => t -> t.
It turns out it's possible either with explicit isorecursive types (and some lifting functions) or using Template Haskell. For posterity, I posted both solutions on this old StackOverflow question I found when looking at how others had handled the same problem (viz., they hadn't, generally):
http://stackoverflow.com/questions/3775446/passing-list-elements-as-parameters-to-curried-function/4241972#4241972 http://stackoverflow.com/questions/3775446/passing-list-elem...
- eru 16y agoI also love Haskell's syntax. It's very tasteful in most choices. Although my opinion of Python has gone down over the last few years, I still like its syntax, too. Especially the significant indentation, but I believe that Haskell has the slightly better mechanism, by defining indentation as a syntax sugar that you can avoid, if you want to. OCaml's standard library is also quite dismal. At the recent meeting of the OCaml consortium in Paris we suggested creating a new extended standard library. (We will reuse Core and Batteries et al, of course.) A co-worker and I are in the procss of writing a regular expression module that doesn't suck. It will be threadsafe and use poor OCaml---the module from the standard library calls C-code to run a backtracking bytecode interpreter with lots of mutable state.