55 points · by 0x1997 · 13y ago · 26 comments
[1] http://www.pllab.riec.tohoku.ac.jp/smlsharp/docs/1.0/en/Ch4....
# type foo = { bar: int ; baz: string };;
type foo = { bar : int; baz : string; }
# let a = { bar = 42; baz = "hello" };;
val a : foo = {bar = 42; baz = "hello"}
# let b = {a with baz = "bye"};;
val b : foo = {bar = 42; baz = "bye"}
# a;;
- : foo = {bar = 42; baz = "hello"}Nevertheless, the thing I like most at SML# is the excellent FFI. You can just pass SML-records or SML-functions to C. SML# is very powerful if you code your applications in SML and C.
It's not quite as smooth, as far as I know, but it will soon include C header consumption and C stub generation to both improve binding accuracy/safety and remove dynamic paths for performance.
http://www.pllab.riec.tohoku.ac.jp/smlsharp/docs/1.0/en/Ch1....
It predates it, actually.
Which begs the question: you've written "Microsoft's CLI", which does make sense because they were the ones who've come up with it, but can't that be interpreted as a synonym for CLR? Maybe that's what 616c meant.
Usage of SML results in very short, readable and efficient programs, so I wonder why there is only so little industry adoption.
edit: or OCaml, or F#.
Harper has strong opinions, but he has a few points. Haskell may be great, but one should be aware that it is not an improvement on SML in each and every respect. For example, SML has a much better module system than Haskell.
at least when it comes to syntax mythryl might someday provide an option. its basically SML/NJ with a c-like syntax and multithreading support. still very much in development but looks promising: mythryl.org
that said Haskell certainly seems to be the winner of the current functional language trend.
...the only times I heard people bitching about syntax to the point of staying away from a language for it was either about Lisps ("undistinquishable paren soup") or about Python's significant indentation and lack of multiline lambada. MLs have a pretty familiar math-like syntax and apart from some operators seems "normal looking" even for Java and C programmers.