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

Similarly, despite the existence of LLVM and the simplicity of the various assemblies, tons of languages target C, mostly to facilitate easier interop with native libraries and because pretty much everything has a C compiler. Perhaps there were similar reasons to compile to Elixir, but I honestly can't think of any. It might just be for faster compiler development, at least until the featureset of Elchemy begins to significantly diverge from that of Elixir.



First of all thanks for all the interest and a good question! While obviously it would be possible to compile directly to Erlang, or even to Core Erlang it would just add a lot of additional work to do. Elixir adds a phenomenal amount of functionality that made making Elchemy easier. And thanks to building it on such a high level we can leverage most of the Elm tooling goodness as well as Elixir's. Another very important factor is familiarity. People much rather like an environment they already know and it would be silly to try to recreate things like Mix or ExUnit yet again. Another important aspect is the familiarity of the output. Elchemy's priority is producing fully readable Elixir code, which not only adds another layer for learning the language's characteristics as well as a 'belt and braces' for experimenting with it in existing projects - the time cost of removing Elchemy from a project written in it is way smaller than rewriting the logic from scratch


awesome - thanks for the reply. Makes sense. I work with elixir full time and the type-safety bugs me. I'll check this out when I can find some time.


From the FAQ:

Do I need to have Elm installed to compile my .elm files with Elchemy?

Elchemy uses Elm to typecheck your program. It is possible to use it without Elm on your machine, while it's not advised.

So it seems that it literally transpiles Elm syntax to Elixir, the type safety relies on Elm apparently.

Targetting BEAM directly should be possible in the future, to me it looks like an attempt to save a lot of time to make Elm suitable on the server side.


This. There's no need to rebuild everything from scratch and fail due to too much to do. If the project grows more we can think about going low level. However, right now we can use everything that Erlang has, everything that Elixir has and most of what Elm has. It's a huge time and effort saver


I mean if their goal is to get Elixir developers interested then I think that it satisfies.




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

Search: