Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I haven't used Erlang since 16 (maybe 17), but the two features that attracted me to Elixir were support for UTF-8 strings and macros. Erlang may have both now—I'm not sure—but doing localization in Elixir was a lot easier than it was in Erlang back in the day.

I would recommend learning both Erlang and Elixir. They're both amazing languages, I think, and your Erlang skills transfer nicely into Elixir, since you can call any Erlang function from within Elixir code.



Erlang has define style macros (since forever?).

R16 works with utf-8 binaries just fine. <<"Foo"/utf8>> you might need to put a preprocessor flag to set the default encoding for source files (the default changed in 17 or 18, I think); also settings may be needed for console output (but that probably applies to elixir too). Erlang strings are lists of Unicode code points, if you're putting a list of utf8 bytes in there, that's not ideal (but you probably want binaries instead of lists, most of the time anyway)


Starting with OTP-20, the string module handles unicode, both for binaries and lists (and iolists, which mixes all styles) without a problem.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: