Live data from Hacker News

Elchemy – write type safe Elixir using Elm-like syntax

wende.github.io

21–30 of 57 posts

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

#21
post #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...

For a Rust web framework I would recommend rouille.[0] Mature, stable and zero unsafe.

[0] https://github.com/tomaka/rouille

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

#22

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.

So Rust does not include built in abstractions/frameworks for building distributed systems, but I count that as a good thing. OTP can scale well under certain conditions. But it can also require rewriting supervision, servers, and other core pieces of OTP, which is a huge pain. BIFs can be slow or have wonky behavior, NIFs are dangerous but necessary when Erlang is too slow. When a language gives you prebuilt abstractions it can be a really good thing if they're the abstractions you need, and really bad if your requirements don't line up well, or you're coloring outside the lines in terms of scale or design. It can also be painful to introspect the BEAM to collect metrics and understand message queue pressure on a node. I'm so glad I get to work on Erlang rather than many of the other toolkits that are out there for building big distributed backend systems, but if I was going to start over again it were my choice I would choose Rust and build the right abstractions, the right protocols, and have total control over my system to make tailored performance trade-offs, and do it in a type safe environment, or I would use a third party distributed systems library like bifrost if my project was small. When I said all the things that make Erlang great, I mean pattern matching, FP, a focus on safety and reliability, and a really knowledgeable community. I'm kind of over BEAM/OTP at this point, but that's just my opinion, for the projects I'm working on.

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

#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. are on Github. Github is really the gold standard when it comes to programmer friendly aesthetics.

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

#25
post #5

Or if you’d rather have typeclasses: https://github.com/purerl/purescript

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

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

#26

Earlier quoted context omitted.

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.

So Rust does not include built in abstractions/frameworks for building distributed systems, but I count that as a good thing. OTP can scale well under certain conditions. But it can also require rewriting supervision, servers, and other core pieces of OTP, which is a huge pain. BIFs can be slow or have wonky behavior, NIFs are dangerous but necessary when Erlang is too slow. When a language gives you prebuilt abstrac…

Couldn't you use Erlang/OTP for the main parts of the system and for the performance critical parts that Erlang isn't great for (like crunching numbers) you can use something like Rustler to be build a safer NIF? https://github.com/hansihe/rustler

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

#29
post #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...

The author is responding and taking care of many of them. I’m confident this is a temporary issue, or at least it seems like it’s going correctly to me.

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

#30

Earlier quoted context omitted.

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.

So Rust does not include built in abstractions/frameworks for building distributed systems, but I count that as a good thing. OTP can scale well under certain conditions. But it can also require rewriting supervision, servers, and other core pieces of OTP, which is a huge pain. BIFs can be slow or have wonky behavior, NIFs are dangerous but necessary when Erlang is too slow. When a language gives you prebuilt abstrac…

It sounds like you just don't like BEAM/OTP, then. :) I don't know if I would make a sweeping recommendation for Rust as an alternative to Erlang based on that, though, as I would imagine it would take a TON of work to replicate OTP in Rust.
Post reply on HN