[erlang-questions] Strings - deprecated functions
Loïc Hoguin
essen@REDACTED
Fri Nov 24 14:59:52 CET 2017
On 11/24/2017 02:37 PM, zxq9 wrote:
> On 2017年11月24日 金曜日 08:13:49 Eric des Courtis wrote:
>> While I feel the pain of Joe having suffered countless hours fixing
>> deprecation in various old libraries. I have to say there is something to
>> be said for throwing things away.
>>
>> I can't help but think I can have my cake and eat it too. Maybe something
>> like a transpiler to compile old Erlang to new Erland and keep the Erlang
>> VM lean?
>
> If the new functions did what the old functions do, then sure.
>
> But that's not how thing have turned out.
>
> On reflection, I actually think the new string functions should have
> been rolled into a "utf8" module. Or something. And the "strings" module
> could either have had implementation adjustments that use the utf8
> utilities underneath or been left alone to deal with latin1 (but either
> way be amply documented).
>
> I'm the heaviest unicode string dealing guy I know. I'm SUPER happy that
> the idea of "string" has been advanced (finally!) to mean "unicode strings".
> But breakage is a thing, and Lloyd and Joe have a point.
Nothing has been broken as far as I understand. I'm not sure what's the
big deal. New set of functions has been added, old set of functions
still works the same, still documented but will very slowly be rolled out.
Joe's ideals are very much unrealistic, it's very unlikely that
computers work the same in 1000 years, it's very unlikely that Erlang is
still around then, that anyone remembers the programs we wrote today or
heck even that our civilizations still exist. The odds are not much
greater for 100 years in the future as far as the code goes. The problem
is much more practical, and one practical aspect to think about is
maintenance. Old code has to be removed eventually to lower the
maintenance costs (for OTP team). Still, I doubt this particular code
will be removed in the next 10 years. I'd bet something like gen_fsm
would be removed far quicker than the old string functions.
Lloyd's issues seem to be more about documentation, specifically it
lacking examples for converting to the new functions. This kind of issue
will be resolved long before the old functions are removed.
OTP has slowly phased out a lot of code. It's nothing new. This time
it's both a combination of this and the world phasing out latin1, so
that's more reasons to move forward.
--
Loïc Hoguin
https://ninenines.eu
More information about the erlang-questions
mailing list