[erlang-questions] Erlang basic doubts about String, message passing and context switching overhead

Loïc Hoguin essen@REDACTED
Sat Jan 14 23:21:19 CET 2017


What attitude? He's not wrong. It will need to be implemented in Erlang 
eventually.

I'm not saying there won't be any cooperation when that happens, I'm 
sure there will be, José has been doing great work contributing. My 
problem is with how you put it. You make it sound like this is a problem 
only for Erlang people only. You realize Elixir is implemented on top of 
Erlang, right? And that it'd most likely end up using the Erlang 
implementation if it makes it inside OTP, instead of duplicating the work?

I'm also not saying that it was the wrong call to implement it *for* 
Elixir first. It clearly was the right call. But it probably could have 
benefited a lot more people with minimum extra efforts.

And just so we're clear, you should feel offended that I called your 
comment naive. Because it really was. There's plenty of reasons why one 
can't use Elixir code. I gave you one. There's more. It's okay though, 
we're all naive about many, many things.

Anyway. Elixir has some Unicode support. Great for the people that can 
use it! Everyone else still has a problem. Let's put down the pitchforks 
and torches and discuss that.

Cheers,

On 01/14/2017 10:46 PM, Oliver Korpilla wrote:
> Hello, Loic.
>
> Great cooperation? More like a reaction to the attitude I get from you and Ilya.
>
> I actually do believe the Erlang can and has to solve its own problems. As you see, behind Erlang there is a certain set of ideas, principles, and design decisions, and behind elixir is another. To demand of somebody else to solve your problems in your preferred language... is offensive to me. So I reacted.
>
> Some people prefer Erlang, some prefer elixir. Telling people that they should have implemented a solution in Erlang to make it available to "the community" describes precisely a mindset where you say "my community is fine, what silly thing are you doing over there?" And that is exactly how cooperation breaks down.
>
> Calling me naive is similarly offensive. Just because you do not want to do something, don't resort to name-calling. Nobody said that some group _should_ use elixir, but the possibility exists. Nothing more was ever said. To infer from your own projections I am naive is rich.
>
> To make it clear, I do not speak in any capacity for the elixir community. I am just a user trying to understand the work of others, which I admire, in BOTH communities.
>
> I'm pretty sure you don't speak for Erlang community either.
>
> Oliver
>
>
>
> Gesendet: Samstag, 14. Januar 2017 um 22:32 Uhr
> Von: "Loïc Hoguin" <essen@REDACTED>
> An: "Oliver Korpilla" <Oliver.Korpilla@REDACTED>, "Ilya Khaprov" <ilya.khaprov@REDACTED>
> Cc: "Erlang Questions" <erlang-questions@REDACTED>
> Betreff: Re: [erlang-questions] Erlang basic doubts about String, message passing and context switching overhead
> On 01/14/2017 09:25 PM, Oliver Korpilla wrote:
>> Erlang community can address all its own problems if it wants. You can do so if you have the means and if you want.
>
> Sounds like great cooperation.
>
>> elixir developers made their own choices and I use elixir every day as my preferred BEAM language, not Erlang. I come here for BEAM and OTP knowledge.
>
> Completely unrelated to making the Unicode code available for all BEAM
> languages without the obnoxious dependency.
>
>> Besides, if you really want, you can write part of your application in elixir, benefit from its feature set, and code the rest in Erlang. BEAM and rebar support that.
>>
>> Which means: Everybody in BEAM community can _already_ use.
>
> No, everybody can't use it.
>
> For example, if the httpbis working group were to add Unicode HTTP
> headers[1], I would need to find a way to make it work that does not
> involve Elixir, because I can't force that big a dependency on everyone.
>
> Saying "it's there therefore you can use it" is incredibly naive.
>
> [1] It's being discussed.
>
>> Oliver
>>
>>
>> Gesendet: Samstag, 14. Januar 2017 um 21:19 Uhr
>> Von: "Ilya Khaprov" <ilya.khaprov@REDACTED>
>> An: "Michał Muskała" <michal@REDACTED>, "Oliver Korpilla" <Oliver.Korpilla@REDACTED>
>> Cc: "Erlang Questions" <erlang-questions@REDACTED>
>> Betreff: Re: [erlang-questions] Erlang basic doubts about String, message passing and context switching overhead
>>
>>
>>
>>>> Elixir takes the files directly from unicode distribution, and uses macros to compile them down into regular functions.
>>
>> Code generation. Can be done without macros, just generating Erlang files. So everyone in BEAM community can use. That is my point.
>>
>> ------------------------------------------------------------
>>
>> From: Michał Muskała <michal@REDACTED>
>> Sent: Saturday, January 14, 2017 22:56
>> To: Oliver Korpilla; Ilya Khaprov
>> Cc: Erlang Questions
>> Subject: RE: [erlang-questions] Erlang basic doubts about String, message passing and context switching overhead
>>
>>
>> On 14 Jan 2017, 17:00 +0100, Ilya Khaprov <ilya.khaprov@REDACTED>, wrote:
>>
>>
>>>> Given that both Erlang and elixir are implemented on top of BEAM, the wheel might not need reinventing?
>>
>> Why Elixir implements Unicode in Elixir? You have to rewrite it anyway.
>>
>>
>> Elixir takes the files directly from unicode distribution, and uses macros to compile them down into regular functions. BEAM is wonderful at optimising bitstring pattern matching, so the resulting code is quite efficient and does not need NIFs. The whole implementation is also about 500 LoC https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex, so it's not a monstrosity and the code is quite readable.
>>
>> [https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex[https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex]]
>>
>> elixir/unicode.ex at master · elixir-lang/elixir · GitHub[https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex[https://github.com/elixir-lang/elixir/blob/master/lib/elixir/unicode/unicode.ex]]
>> github.com
>> elixir - Elixir is a dynamic, functional language designed for building scalable and maintainable applications
>>
>> On 14 Jan 2017, 16:53 +0100, Oliver Korpilla <Oliver.Korpilla@REDACTED>, wrote:Could the Unicode support in elixir serve as a starting point?
>>
>> https://hexdocs.pm/elixir/1.3.3/String.html#content[https://hexdocs.pm/elixir/1.3.3/String.html#content]
>>
>> String.upcase/1 and String.downcase/1 seem to be Unicode-aware. And a lot of effort seems have gone in scenarios like this:
>>
>> "For example, the codepoint “é” is two bytes:
>>
>> iex> byte_size("é")
>> 2"
>>
>> Given that both Erlang and elixir are implemented on top of BEAM, the wheel might not need reinventing? I know engineers and programmers love inventing stuff, and this discussion seems to point in that direction, but...
>>
>> All the functions in the Elixir's String module are unicode aware. There are functions for unicode normalisation (both nfd and nfc) and checking equivalency (e.g. "é" can be a single code point, or two code points - the letter "e" and the combining diacritic acute). String.length/1 works in terms of unicode graphemes (multiple codepoints can compose into a single grapheme):
>>
>> iex> String.length("é")
>> 1
>>
>> On 14 Jan 2017, 16:30 +0100, Benoit Chesneau <bchesneau@REDACTED>, wrote:
>> someone has to write a good binding (non blocking) of icu :) I think it would be easier than reinventing the wheel. i18n [1] was a good start but looks abandoned these days. Also I disliked the load of resources at startup in ETS: https://github.com/erlang-unicode/i18n[https://github.com/erlang-unicode/i18n][https://github.com/erlang-unicode/i18n[https://github.com/erlang-unicode/i18n]]
>>
>> [https://github.com/erlang-unicode/i18n[https://github.com/erlang-unicode/i18n]]
>>
>> GitHub - erlang-unicode/i18n: icu nif: international ...[https://github.com/erlang-unicode/i18n[https://github.com/erlang-unicode/i18n]]
>> github.com
>> i18n - icu nif: international components for unicode from Erlang (unicode, date, string, number, format, locale, localization, transliteration, icu4e)
>>
>> icu is problematic in the fact that it works mostly with UTF-16.
>>
>> Michał
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions[http://erlang.org/mailman/listinfo/erlang-questions]
>>
>
> --
> Loïc Hoguin
> https://ninenines.eu[https://ninenines.eu]
>

-- 
Loïc Hoguin
https://ninenines.eu



More information about the erlang-questions mailing list