4 ms·
After being Clojure-only for a long time, I decided to write the front end to my last project in Elm, just to see what the fuzz was about. While I miss code-is
by yjgyhj 9y ago
After being Clojure-only for a long time, I decided to write the front end to my last project in Elm, just to see what the fuzz was about.
While I miss code-is-data very much, there is no turning back from the type system and how there are no unpure functions. It is just so mind-blowingly easy to catch almost every bug I would usually write.
I'm afraid this is the point where I should try Haskell, and be unsatisfied for the rest of my professional life.
- KurtMueller 9y agoI'm a ruby developer by day and, to me, OCaml-like languages like Elm and F# are better rubies. The language remains as concise and crisp as ruby, the algebraic data types help me more precisely formulate the logic for the app, and the static types remove a whole class of errors and makes refactoring much easier. As an aside, I have a theory that Elm is a gateway drug to Haskell. Next stop, purescript?
- ealhad 9y agoYou should definitely try, even if you end up being somewhat unsatisfied every time you have to use something else. When I write code in Haskell, it feels right, just like when I discovered Lisp. Only better. And oh, the purity! Not only in the mathematical sense, even the code is completely deprived of clutter.
- penpapersw 9y agoBut at what cost!? Every time I write Haskell code it reads like a mathematical proof that's beyond my ability to comprehend! Whereas my Ruby, Python, and Clojure programs read like a poem I might have written in third grade.
- ealhad 9y agoI don't think Haskell code looks like this. You don't have to use all the guru syntactic sugar; the library functions usually have pretty explicit names, and yours should have to.
- pmarreck 9y ago> While I miss code-is-data very much FWIW, Elixir has this (and is possibly the only non-homoiconic language to implement "true" macros) Opt-in typing, though. Regarding Elm, I love that runtime errors are considered compiler bugs.
- pathsjs 9y agoNim and Scala are not homoiconic, yet they both have true macros
- e12e 9y agoDylan?
- pmarreck 9y agoAfter reviewing Dylan's, it doesn't seem as powerful. And it's unclear how it handles runtime variables passed within code snippets to macros (Elixir has "unquote" for this)
- pmarreck 9y agoNim's macros look harder to use, with a fairly custom DSL in the AST (instead of, say, a simple datastructure like a nested map). I don't think you can pattern-match on AST fragments, either, like you can in Elixir. Scala macros cannot change its syntax, Elixir macros can I believe (to some extent).
- pathsjs 9y agoThe AST of Nim is a simple tree, the only thing is that the nodes of this tree are tagged with a kind that represents the kind of syntactic element, since the language is not homoiconic