4 ms·
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
by innocentoldguy 9y ago
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.
- toast0 9y agoErlang 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)
- mononcqc 9y agoStarting with OTP-20, the string module handles unicode, both for binaries and lists (and iolists, which mixes all styles) without a problem.