News for hackers. Stuff that matters.
Re:Adopting Erlang by mkl95 on Saturday October 23, 2021 @08:04AM (#28967624)
The Erlang world is obviously full of bright people with cool ideas, but difficult string handling is a deal breaker for me if I intend to use a language in production grade projects. Is Elixir better at it?
Re:Adopting Erlang by j03b on Saturday October 23, 2021 @08:42AM (#28967867)
Significantly better, yes, I've never felt like String methods were missing while using Elixir, they've also got some goodies like Jaro distance right in the stdlib. Docs on Elixir strings are here, plenty of methods: https://hexdocs.pm/elixir/1.12/String.html

This getting started guide also covers some more examples of working with strings (vs. charlists, the erlang string type, which are described at the end): https://elixir-lang.org/getting-started/binaries-strings-and...

Re:Adopting Erlang by gamache on Saturday October 23, 2021 @09:02AM (#28967989)
> The Erlang world is obviously full of bright people with cool ideas, but difficult string handling is a deal breaker for me if I intend to use a language in production grade projects. Is Elixir better at it?

Yes, the Elixir stdlib uses only binary strings, never charlists. But to be fair Erlang largely got its shit together with binary strings a decade ago.

Re:Adopting Erlang by dnautics on Saturday October 23, 2021 @12:35PM (#28970011)
It's still uncomfortable to deal with binary strings in erlang, starting with the very awkward syntax, but also there are also quite a few non-core stdlib functions that refuse anything but charlists, like options for tls (ssl) module, x509 settings, ssh module, etc.
Re:Adopting Erlang by sergiomattei on Saturday October 23, 2021 @07:15PM (#28973315)
I felt that way (using Elixir) until I truly took some time to dive in and understand Erlang types, especially `binary`.

After the confusing terminology was out of the way and I understood the underlying systems, it all felt fine. Has a learning curve though!