Hacker News new | past | comments | ask | show | jobs | submit login

Will 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.



I 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.


Actually, 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.


I'd be very happy with Elm compiled to WebAssembly as a stepping stone on the way to fully native :)


You 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!


Probably 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.


I'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.


As a user of Elm I would love that but for now we have OCaml, which is just as awesome!




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: