Live data from Hacker News

Elchemy – write type safe Elixir using Elm-like syntax

wende.github.io

51–57 of 57 posts

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

#51
post #7
post #2

Looks like it's targeted more towards the Elm crowd with npm install instructions than the Elixir crowd with no hex/mix install method.

Elchemy creator here. Quite the opposite to be honest. I come from Elixir background. It's just that npm is much more reliable when it comes to global system-wide installations

Hex has global commands as well

There's no real advantage in having a global command when the command doesn't make sense outside of a project folder

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

#52
post #25

Earlier quoted context omitted.

Purescript by example[1] is the most approachable introduction to Functional programming that I have seen (yet). 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] https://leanpub.com/purescript/read

I largely agree, but it's not without its warts :) https://github.com/paf31/purescript-book/issues/99

It’s also a bit out of date, but nobody’s perfect. :)

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

#53
post #24

Love the concept. 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…

That's a good idea. I've never thought about it this way Thank you for a valuable input

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

#54
post #45

Elchemy looks fantastic, especially if you have some frontend in Elm already or you use it in Node microservices. The only thing concerns me that it won’t get enough traction and support and will eventally get abandoned, so here’s some Q’s. 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!

Hi there, First of all, thank you for the post! It really made my day to see us land on HN I'm glad you like the idea. About the traction, I think I've got a mentality that makes it a little bit more bearable - even if it turns out nobody wants to use the project, I know I will so I'll always try to develop it and spend at least a weekend on it from time to time.

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

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

#55
post #43

So I'm confused, is Elchemy its own language that compiles to Elixir? Or a way to add static types to existing Elixir code?

The former. It is a language almost identical to Elm that compiles to a readable Elixir output. It has all of Elm's advantages - the type system, readable error outputs. On top of that, you can use all of Elm's tools like editor plugins or elm-format so there is no 'reinvent the wheel' syndrome

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

#56
post #28

This is awesome and important work! I hope that this project can move independently of Elm's development once it gets enough interest though.

We are hoping for that as well. Elm although making an amazing foundation might cause problems in future when introducing backwards incompatible changes for instance. We are trying to keep the safe distance from Elm development not to be too tightly coupled, but still making use of the awesome stuff Elm's team is doing

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

#57
post #11

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…

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

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.
Post reply on HN