8 ms·
1ML – unifying ML into one language
- mafribe 11y agoScala, whose modularisation was strongly influenced by ML, already offers most of what 1ML is trying to do.
- kvb 11y agoCould you justify this assertion? Here[1] is an analysis by Andreas Rossberg that indicates that this isn't the case. [1] http://stackoverflow.com/a/23019436 http://stackoverflow.com/a/23019436
- mafribe 11y agoI was thinking about the statement 1ML is a user-friendly surface syntax for System Fω in the paper's abstract. I think Fω lives inside Scala. But, as the stackexchange article you cite shows, I should have been more careful in my statement.
- abecedarius 11y agoScala is complex, and SML is pretty simple. (I haven't studied 1ML beyond the elevator pitch, which claims it's "minimal and uniform".) A very complex language with a large installed base can't offer simplicity.
- cmrdporcupine 11y agoEven more than being complex, it is also a JVM language. That has both benefits and drawbacks. Interaction with the Java language and runtime brings complexities to it. Granted, I haven't used Scala since, err, 1.7 days? I think. I liked it, and did a lot of work in it in fact, but more as an alternative to Java. If I didn't have to worry about compatibility with Java or the proven nature of the JVM, or satisfy sysadmins and management with the orthodox Java-ness of my runtime, I'm not sure I'd pick Scala.
- mafribe 11y agoI'd never have left the ML world had it not been for the lack of an ecosystem that's comparable to what the JVM has to offer. And my Scala programs mostly just use ML-like features, but I can't live without all those rich libraries that are lacking in ML.
- tokenrove 11y agoYeti is pretty nice if you have to work on the JVM: http://mth.github.io/yeti/ http://mth.github.io/yeti/
- cmrdporcupine 11y agoLast time I looked into OCaml it seemed to have most of everything I'd need for most projects. But I think it'd be hard to find an employer willing to pay me to work in it.
- nn3 11y agoClassic https://xkcd.com/927/ https://xkcd.com/927/
- wyago 11y agoThis actually doesn't have to do with that. They "propose a redesign of ML in which modules are truly first-class values, and core and module layer are unified into one language." They're not trying to, say, unify SML and OCaml, they're trying to solve a problem inherent to ML itself.
- tachyonbeam 11y agoCan you elaborate on why these are problems for ML?
- oggy 11y agoErasing that distinction enables some goodies such as first-class type constructors, which makes it possible to manipulate types of higher kind. This in turn, presumably enables things like Generalized Algebraic Data Types.
- platz 11y agothe monad example in 1ML is: type MONAD (m : type ⇒ type) = { return a : a → m a; bind a b : m a → (a → m b) → m b }; map a b (m : type ⇒ type) (M : MONAD m) (f : a → b) (mx : m a) = M.bind a b mx (fun (x : a) ⇒ M.return b (f x)) (* : m b *) not too bad.. though I wonder if things are defined structurally instead of nominally, which monad instance are you going to get for a given expression. Haskell's "one instance per class" rule means the compiler figure out which monad instance to apply. This looks more flexible, but also looks like it will require more annotations and explicit parameters.
- iskander 11y agoIf you combine this with [modular implicits](http://www.meetup.com/NYC-OCaml/events/222026251/ http://www.meetup.com/NYC-OCaml/events/222026251/), which are hopefully going to be added to OCaml soon, then you'll get something which is nearly as syntactically neat as type classes but more powerful.
- drudru11 11y agoI know this is not popular. I think ML has a clean syntax and simple but powerful semantics. I enjoyed coding in it. It just looks better than OCaml. Haskell is, I think, even cleaner, but there is a tendency for developers to explore the possibilities available in Haskell and then increase the complexity. It would be great to see the ML community unify and provide an offering that would give it the kind of support that we are seeing in OCaml and Haskell.
- agumonkey 11y agoI too prefer ml (I tried sml/nj) over ocaml, for it is very very tiny. It almost pushed my sexp/lisp fanatism away for a while.
- cmrdporcupine 11y agoI taught myself OCaml first (err... 15 years ago? when there was some initial buzz around it) and liked it. But then I discovered SML/NJ and I liked it more. OCaml has an active community, and the language is nice. I think I actually prefer ML as a language.
- cmrdporcupine 11y agoI should add I also gave Haskell a spin and did not like it. While I can see its elegance, I found ML more readable and practical and easier to write. My eyes glaze over in Haskell, it's like it's missing punctuation or something to let me know what it's doing.
- istvan__ 11y agoTotally agree with you own this one, just looked into Haskell code this week and it was too much black magic going on. I like ML (and more specifically OCaml) because it is more readable to me and easier to understand. Now this might change if I get more exposure to both worlds.
- jallmann 11y agoAre you referring to Standard ML, rather than the ML family of languages? 1ML is a new language in the ML family, rather than an extension of SML or OCaml. Consolidating the module and expression languages in 1ML will lead to even cleaner semantics. From the abstract of the Andreas Rossberg paper: > In this “1ML”, functions, functors, and even type constructors are one and the same construct; likewise, no distinction is made between structures, records, or tuples. Or viewed the other way round, everything is just (“a mode of use of”) modules. Haven't had a chance to look at the demo yet, but hopefully functions/records/tuples can be sugared over syntactically into something resembling traditional ML. Otherwise we might end up with something like Java where there isn't much abstraction from the underlying OO mechanism, which makes code tedious and prone to boilerplate -- eg all functions (methods) must live in a class, even just to run main.
- vitriol83 11y agoNot sure if this mirrors his approach exactly, but ocaml does now offer 'first-class modules' https://realworldocaml.org/v1/en/html/first-class-modules.html https://realworldocaml.org/v1/en/html/first-class-modules.ht...
- ezyang 11y agoFirst class modules let you package up a module in the module level language into a value, so you can pass it around in the expression language. But 1ML's goal is to eliminate the separation between the module language and expression language. So, 1ML can do first-class modules, but first-class modules do not mean a syntactically un-stratified language.
- doublec 11y agoAlice ML, an SML variant that Andreas Rossberg worked on mid-2000, also has first class modules.
- cwyers 11y agoAre the problems this is intended to solve problems that also affect F#?
- platz 11y agoF# doesn't even have modules; although it's derived from an ML, it has cut out rather important parts of it to make it fit into the .net ecosystem.
- brandonbloom 11y agoYou're not wrong, but I may phrase it differently... F# lacks modules, instead favoring objects. Although it's derived from OCaml, it has omitted complex features which don't fit in to the .net ecosystem.
- riffraff 11y agobut is there say, something that (S)ML's modules allow which is not possible to do with F#+.NET objects? I.e. ML's modules can be used to create interfaces and implementations of ADTs, but so can OO interfaces and classes.
- faragon 11y agoI tried to build it (Ubuntu 14.04), but fails (OCaml 4.01.0) after calling make: File "types.mli", line 11, characters 14-15: Error: Syntax error make: * [types.cmi] Error 2
- doublec 11y agoIt builds with 4.02.
- ernsheong 11y agoReminds me of 1Malaysia, Malaysia's political rallying call to unite multiracial Malaysia :)
- virtualwhys 11y agoSomewhat related: Bob Harper's, Future of Standard ML[1] [1] http://www.cs.cmu.edu/~rwh/talks/mlw13.pdf http://www.cs.cmu.edu/~rwh/talks/mlw13.pdf