4 ms·
I appreciate how even the new feature table is as unreadable at a glance as their code.
by ikiris 3y ago
I appreciate how even the new feature table is as unreadable at a glance as their code.
- casenmgreen 3y agoFWIW, I had no problems reading it. OTOH, a long time ago I used Perl seriously, so I'm familiar with the language.
- petre 3y agoAt least it has no surprises like typeof "" == string false
- WesolyKubeczek 3y agoIt has other surprises, like unexpected list contexts eating your undefs, serializing modules determining whether a scalar is considered numeric or string depending on which reading operation accessed it last, also perpetual uncertainty footgun whether a given string is bytes or unicode by some popular modules.
- kstrauser 3y ago> serializing modules determining whether a scalar is considered numeric or string depending on which reading operation accessed it last I need to hear more about that.
- WesolyKubeczek 3y agoThe darling JSON::XS is doing it. perl -MJSON::XS=encode_json -MData::Dumper -E 'my $d = { foo => 42 }; say encode_json($d); say "foo is $d->{foo}"; say encode_json($d);' Output: {"foo":42} foo is 42 {"foo":"42"} JSON::PP and Cpanel::JSON::XS don't have this bug, but JSON::XS is quite entrenched in some codebases.
- kstrauser 3y agoWhat the hell.
- chromatic 3y agoIt's a language implementation gotcha, not really a library problem. The internal data structure used to represent values is polymorphic and uses flags to represent the types of operations performed on the represented data (numeric, string, etc). The only reliable way to serialize a value with a desired type is to request that type explicitly--as one might do to represent a large integer or very precise decimal in JavaScript or JSON, for example.
- WesolyKubeczek 3y agoWell, JSON::PP and Cpanel::JSON::XS don't have this problem somehow. The fact that they need to literally fortune-tell from Perl guts if something is a number or a string is telling as literally every other mainstream language including current dialects of Pascal has this problem solved. But I'm most unimpressed by the fact that merely looking at a variable will mutate its internal representation enough for there to be externally-visible effects. It doesn't matter if JSON::XS is looking at the internals wrong, or if it's Perl's behavior at fault: from whichever angle you look at it, the whole thing is a tangled mess of wrongness.
- chromatic 3y agoJSON::PP and Cpanel::JSON::XS don't have this problem somehow. From my reading of the documentation of the former (especially the MAPPING section), it has the same problem for the same reasons. the whole thing is a tangled mess of wrongness Perl has monomorphic operators and polymorphic values. Every time someone tries to flip that, whether encoding arbitrary data structures to monomorphic values via a polymorphic visitor pattern, the smart-match experiment, or (as I already mentioned in this story's comments) polymorphic operators for data structure dereferencing, these problems occur. Regardless of whether anyone believes that Perl's operator/value design is good or useful, that's how the language works. Working at cross purposes is an exercise in frustration. (I'll leave analogies about duck typing, contravariance, casting, and type erasure to people who like debating programming language design.)
- librasteve 3y agoraku -MJSON::Fast -e 'my $d = {foo => 42}; say to-json($d); say "foo is $d<foo>"; say to-json($d);' {"foo": 42} foo is 42 {"foo": 42} fwiw: raku has cleaned this up
- eviks 3y agoWow, indeed, what a bad way to structure a table
- Enk1du 3y agoIt's just a reference list for the people who know half the features already. If you want a readable list, try the Table of Contents in "Perl new features". https://leanpub.com/perl_new_features https://leanpub.com/perl_new_features
- eviks 3y agothat's not an excuse for poor formatting, especially when not breaking just a couple of formatting rules would make it a better reference, and doing a couple of more tweaks would make it an even better reference (e.g., you could easily see all experimental features with a simple tag in a column instead of having to reach the end of each description)
- kstrauser 3y agoNB: that’s not a perl.org website. It’s someone’s blog. Now, I have touched Perl in decades (oof, that’s rough to type) and that someone might be the official Perl leader for all I know. I don’t think it is, though.
- rabbits77 3y agoThere really is no Perl Leader these days. The language is run by a “steering committee”. The community has a couple of shining stars such as Mohammad Anwar who runs The Weekly Challenge https://theweeklychallenge.org/ https://theweeklychallenge.org/ and Gabor Szabo https://perlmaven.com/about https://perlmaven.com/about They are also both co-editors of the Perl Weekly https://perlweekly.com/ https://perlweekly.com/ The Perl Foundation co-ordinates activities such as grants funding development, fundraising, and conference organizing. https://www.perlfoundation.org/ https://www.perlfoundation.org/ There are also a few senior Perl personalities still around such as brian d. foy who continue to write and update books and blogs. The post-Larry Wall community seems to be doing ok so far. What is notably missing is more active participation from companies making the most use of Perl such as Craigslist or Duck Duck Go.
- fuzztester 3y agoWonder if chromatic is still involved with Perl.
- chromatic 3y agoI am. I released a new version of the Modern-Perl library a couple of weeks ago (apropos of this story).
- fuzztester 3y agoOh cool. May your tribe increase.