Elchemy – write type safe Elixir using Elm-like syntax
wende.github.io
wende.github.io
But please don't use fonts with ligatures in code snippets on the homepage. Especially when these code examples are actually screenshots which people can't copy.
Ligatures may be "obvious" to developers already familiar with the syntax of the language, but can make things very confusing for beginners, esp. in FP languages that lean heavily on operators etc.
I am really glad that the docs/roadmap etc. are on Github. Github is really the gold standard when it comes to programmer friendly aesthetics.
His preferences supersede your sensibilities since its his website, don't you think?
You can politely ask the wrong questions sometimes.
Putting a language on top of a language on top of a language does not seem that smart to me.
Transpiling is common in js only because there isn't/wasn't a standard like webasm.
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.
Even if you don't intend to ever use Purescript itself for application development, the book is worth a read, as an introduction to FP concepts, especially if you are coming from a Javascript/Web-dev background.
1. What’s the genesis of this project?
2. Do you use it internally, is it backed by any company?
3. Is it already handling some production code?
Thanks!
Regarding the questions: 1. It's quite a long story which I'd be willing to tell one day, maybe at some conference. Basically, the idea started from 'typed elixir' which was a small POC project of mine. The Idea was to introduce type inference and annotations using only Elixir's macro system. It had a type inference algorithm I wrote in Prolog (to this day I'm still amazed how easy this language made it) and a bunch of hacky macros. However, after about half a year into development, I realized it's not a project that can be done singlehandedly and that there is simply too many compromises and hackishness to it. Half a year later on a LambdaDays 2016 conference in Kraków, Poland during a rather boring talk I've wrote a simple transpiler of Elm to Elixir as a joke just to find an entertainment. But the longer I developed the joke to more apparent it started to be it's actually something completely doable and with a great potential value.
2. Unfortunately no, not yet. It is being developed by me and sporadically by two other members of my company, but it's in no way supported by any big player. We'd love to get an interest like that though. If by any means some company representative is reading that and considering, please don't hesitate to mail me!
3. Depends on what we mean by production - is it running as a node of a huge Erlang system? - no, and probably won't be for some time. It's still a relatively young project with a lot of space to develop, it is slowly approaching maturity though and I think after we introduce an official way of handling side effects it's going to get much more traction. If the question is of "Is there anything big written already in Elchemy?" then kind off. I'm pretty sure that the biggest project written in Elchemy today is... Elchemy itself. Being self-hosted was very important to me and it is even a part of the CI pipeline right now. The moment of it being able to compile itself and execute in Elixir was a huge milestone in the development and a definite point in time when the project stopped to be just a Proof of Concept. We are currently working on a demo game written in Elm on the frontend and Elchemy on the backend. Its purpose is to demonstrate the maturity of the project, but also pinpoint some possible shortcomings that we might have missed. That's the main reason for starting the Elchemt DevBlog on Medium (https://medium.com/elchemy) to share on the progress and possibly discuss different choices we still have to make
As it's already becoming quite long-ish feel free to join our Gitter chat (https://gitter.im/elchemy-lang/Lobby) or to mail me!
Cheers
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.
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
fwiw the latest release moved the compiler back to the server. the ghcjs stuff proved too difficult to deliver a good experience to everyone. a naughty cdn was just one of many woes.
There's no real advantage in having a global command when the command doesn't make sense outside of a project folder
beautiful ... ? readable ... ?
neither ... yes
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
The comparison of Rust with Elm and F# in this article really clicked for me:
https://www.chriskrycho.com/2018/exploring-4-languages-start...
I always thought of Rust as similar to Go, but now I think more of it like an ML descendant with C'ish syntax. There's more to it though, Rust is more low-level than languages in the ML family and can often provide the same abstractions without hight costs in performance.
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...