5 ms·
With Lisp I get the data thing but with ML you learn almost everything is a language. I can't really explain it but the whole variant/ADT pattern matching real
by agentgt 10y ago
With Lisp I get the data thing but with ML you learn almost everything is a language.
I can't really explain it but the whole variant/ADT pattern matching really forces to make you think of your problem domain as a specification or language (e.g. DSL). It is one of the reason why I think so many compilers are written in ML (that and the toolset is awesome for it).
- catnaroek 10y agoAnother important feature of ML is abstract data types (opaque signature ascription), which forces abstraction clients not to rely on implementation details. It's Dijkstra's “separation of concerns”, integrated into the type checking process! See: https://existentialtype.wordpress.com/2011/04/16/modules-matter-most/ https://existentialtype.wordpress.com/2011/04/16/modules-mat...
- einhverfr 10y agoThat description of ML reminds me what I really like about REBOL and RED as well.
- catnaroek 10y agoWith the “slight” difference that ML actually enforces that your program is consistent with your description of the problem domain.
- spdionis 10y agoPattern matching is the feature i enjoy most in functional languages. It's simple to use and comes with great value.
- ohyes 10y agoHaving looked up variants just now, I can definitely see how it would be useful. It seems (to me) to fall into the same category of macro-like things that enhance the expressiveness of the language. I think the most important point is the idea of lifting the programming language into the problem domain. When you can do this in a clean way, the result is a very readable solution that you can reason about.
- AnimalMuppet 10y agoI think there's a difference, though. With ML (IIUC), you build a language on top of ML that is a set of functions (and the data structures they operate on) that make it easy to express the program. With Lisp macros, though, you change the syntax of Lisp. You take things that were not valid Lisp syntax, and you make them valid for your program. So ML "language building" is in terms of semantics, but in Lisp, it's both semantics and syntax. (Again, IIUC).