Live data from Hacker News

Elchemy – write type safe Elixir using Elm-like syntax

wende.github.io

11–20 of 57 posts

Re: Elchemy – write type safe Elixir using Elm-like syntax

#11

Earlier quoted context omitted.

Yeah I would expect to see it compile to bytecode. It seems pretty wild to transpile to a language to compile to bytecode to run in a vm when there is already bytecode and a vm to execute against. Transpiling is common in js only because there isn't/wasn't a standard like webasm.

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 s…

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

Re: Elchemy – write type safe Elixir using Elm-like syntax

#12
post #9

Earlier quoted context omitted.

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 s…

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 t…

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

Re: Elchemy – write type safe Elixir using Elm-like syntax

#13
As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

Re: Elchemy – write type safe Elixir using Elm-like syntax

#14
Looks like your playground is based off Ellie, which is a great choice. However, it seems that there is an issue with downloading the Elm compiler. I'm getting a network failure from ellie's CDN(NAME_NOT_RESOLVED).

Other than that, thank you for this, it is super interesting to me as I am a huge fan of both languages, and lack of type safety has always been my only misgiving with Elixir/Erlang. I'll have to take a spin this weekend.

Re: Elchemy – write type safe Elixir using Elm-like syntax

#15

Looks like your playground is based off Ellie, which is a great choice. However, it seems that there is an issue with downloading the Elm compiler. I'm getting a network failure from ellie's CDN(NAME_NOT_RESOLVED). Other than that, thank you for this, it is super interesting to me as I am a huge fan of both languages, and lack of type safety has always been my only misgiving with Elixir/Erlang. I'll have to take a sp…

Sometimes the CDN is acting naughty

That's true. The idea of how Ellie was brought to life is outstanding. Huge shoutout to Luke Wetsby for letting us use his codebase for Elchemy

Feel free to share your thoughts and concerns on GitHub or by email! We'd love to hear your opinion and concerns

Re: Elchemy – write type safe Elixir using Elm-like syntax

#16

As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

Could you elaborate on why you find Rust to be an alternative to Erlang? For me at least, most of the draw of Erlang has nothing to do with the language, and everything to do with BEAM/OTP and the surrounding architecture, which (as far as I'm aware) Rust does not provide an alternative to in any shape or form.

Re: Elchemy – write type safe Elixir using Elm-like syntax

#17

As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

Same feeling here. I used to work in Erlang on daily basis - now Elixir. And although I'm not a big fan of its syntax (Erlang looks more readable to me) the tooling and the amount of love from Elixir's community is immense

I've never had a chance to play with Rust yet. I'll definitely give it a shot someday

In my opinion, the best example of how typed languages make it more manageable is Elchemy's codebase itself - which is written in Elm and compile itself. The type system saves us from a huge amount of runtime errors and allows us to sleep at night after a recent release. Most of the time when something goes wrong it's about the parts written in bash or Elixir

Re: Elchemy – write type safe Elixir using Elm-like syntax

#18

As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

Can you recommend a good web framework/micro-framework?

I was using actix-web, but last I heard it has to many unnecessary `unsafe`s.[0]

[0] https://www.reddit.com/r/rust/comments/8s7gei/unsafe_rust_in...

Re: Elchemy – write type safe Elixir using Elm-like syntax

#19

As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

What about OTP?

Re: Elchemy – write type safe Elixir using Elm-like syntax

#20

As someone who writes Erlang for a living, I highly recommend rust as a well typed alternative to Erlang, that still keeps all of the things that make Erlang great. I do love Erlang, but working on a large codebase can be frustrating when nothing is speced or commented, and even when it is speced it’s usually part of a gradually typed codebase with very non descriptive types.

What about OTP?

It's the first big library that we'll be porting after coming up with a final version of the effects system
Post reply on HN