3 ms·
Elm has literally changed the way I think about programming. Can't wait to see what the future will bring.
by sanatgersappa 11y ago
Elm has literally changed the way I think about programming. Can't wait to see what the future will bring.
- chubot 11y agoCan you give an example of a nice Elm program (maybe 50 lines or less) that illustrates this? I haven't tried Elm, but I'm guessing it has to do with state management, which IMO is indeed the hardest part of programming.
- sanatgersappa 11y agoSure. Check out the elm version of todomvc https://github.com/evancz/elm-todomvc/blob/master/README.md https://github.com/evancz/elm-todomvc/blob/master/README.md. Other examples here http://elm-lang.org/examples http://elm-lang.org/examples. Also see https://github.com/evancz/elm-architecture-tutorial/ https://github.com/evancz/elm-architecture-tutorial/ for the recommended architecture.
- david-given 11y agoWill there ever be an Elm which compiles to real machine code? I'm currently learning Haskell, and find it a combination of mindblowingly amazing (pattern matching, monads, STM) and mindnumbingly crazy-making (namespaces, debugging, strictness). Elm looks like a different more modern take on the same principle. But I don't want to have to run everything inside a Javascript VM.
- bgar 11y agoI'd say Haskell is modern. As well as having many years of research and development behind it, compared to Elm. Would having Elm server side really be useful? We have Haskell already, with all the benefits of Control.Concurrent, Control.Parallel, STM, FFI, Cloud Haskell, etc. Not to mention proper monads.
- wheatBread 11y agoI think so! I'd like to get Elm running way faster than JS in browsers (which is possible thanks to some design choices) and that'd involve getting all this together. That opens things up on lots of different platforms, including servers. I also expect the next release to make things nicer on node.js as a first step in this direction. Point is, I think we'll start seeing folks doing server stuff, and it's a goal of mine to generate machine code for lots of reasons! It's a big project so I'm not setting a timeline at this point though. Also, thanks for taking a look at Elm! I think of it as a member of "the ML-family" of languages and I draw from a lot of lessons from working with these tools and seeing what issues have come up for other folks, both within the typed functional world and not.
- corysama 11y agoI'd be very happy with Elm compiled to WebAssembly as a stepping stone on the way to fully native :)
- wheatBread 11y agoYou need a garbage collector either way, so doing one implies you have pretty much succeeded at the other. So it's like two stepping stones that are right next to each other and quite a long jump away :P I think we'll get there though!
- david-given 11y agoActually, while it's still not direct machine code, if you can target Javascript as a backend I bet you can target Lua, which has very similar but less weird semantics; that means you get to run it on LuaJIT. That gives you a tiny, very very fast VM and garbage collector.
- mgold 11y agoProbably not in the next few years. However, this sort of thing is in the back of people's minds. There was a question of dropping the Int type a while back, and the objections (besides semantics, e.g. indices are always ints) included wanting to be able to compile to machine code, where (unlike JS) ints and floats were different.
- rubiquity 11y agoAs a user of Elm I would love that but for now we have OCaml, which is just as awesome!