24 ms·
Perl 5.38
- xeeeeeeeeeeenu 3y agoThe main highlight of this release is the new OOP system: https://perldoc.perl.org/5.38.0/perlclass https://perldoc.perl.org/5.38.0/perlclass
- seanhunter 3y agoThat certainly seems way better than the old way of having to include the inscrutable line noise to construct, fill and then bless a hash reference in every single class, which is what we had to do back when I programmed perl.
- mfontani 3y agoSince about 2008-01 or so, using Moose, we've been able to do something like: { package Point; use Moose; has 'x' => (is => 'ro', isa => 'Int', required => 1); has 'y' => (is => 'ro', isa => 'Int', required => 1); sub as_string { my $self = shift; return sprintf '(%d,%d)', $self->x, $self->y; } } my $origin = Point->new(0, 0); say $origin->as_string;
- xorcist 3y agoMoose is one of those things I always mention when people ask what Perl did right. It wouldn't hurt other languages to have a higher order object templating system. Other things it did right is the taint flag to keep user supplied data from hitting sensitive functions by way of the type system. (In Rust you can declare your own type to achieve this, and it's actually enforced.) The unicode system was actually decent in ways nothing else is, at least until the Go and Rust generation. Python 3 wasn't nearly as complete despite being more than a decade later. If people ask what Perl did wrong, the dereferencing syntax is at the top of my list. Not having multidimensional arrays as a first class type probably did more to scare people away than anything else.
- matthewpersico 3y agoAfter the first deref, deref is assumed. Given: my $aref = [1,2,[3,4,5,[6,7] ] ]; You can do print $aref->[2][3][1]; which yields: 7 Or my @array = (1,2,[3,4,5,[6,7] ] ); print $array[2][3][1]; 7
- Ovid 3y agoAnd in the new class syntax, when it's done, that's (roughly): class Point { field $x :param :reader; field $y :param :reader; method as_string() { return "($x,$y)"; } } my $origin = Point->new( x => 0, y => 0 ); say $origin->as_string; I know which of the two I'd rather write :) The main limitation is that we don't have the `isa => 'Int'` check. That's largely because adding types is something for the entire language, not just this new syntax, so it had to be delayed.
- sixstringtheory 3y agoOh no, perl code is going to be hard to understand now
- doctor_eval 3y agoIt’s always been a write-only language.
- gpvos 3y agoWas it really not possible to make that a shorthand for the existing structure with blessing variables? Having two object systems may make things too confusing.
- leejo 3y agoThe prior "object system" was just a way to stuff things into the symbol table. I'm hand waving here, but the point is it that the scope of that system ended at "calling a method on an instance of a class" and there was nothing beyond it unless you rolled that all yourself: abstract classes derived classes / polymorphism attribute type constraints delegation encapsulation composition (roles) immutable state and so on And many people did roll their own, which resulted in Moose (Moo, et al) on CPAN, which have evolved to be some of the best in class (ha) object system frameworks and features across any language. Now the plan is to get that into the core, and this is the first step. No serious Perl developer has been using bless for OO for a least a decade, unless they were constrained by micro optimisations and/or not being allowed to use non-core dependencies.
- gpvos 3y agoI wasn't saying anyone seriously used that for OO. (There are still uses for tying.) But it would have been nice to have one integrated mechanism, with class syntax for high-level use and bless for low-level access. And maybe with some magic in the high-level syntax that you couldn't access with bless, like actually making members unreachable, that'd be fine. I assume it has been looked into and found to be impossible, but I'd like to know why.
- mst 3y agoRoughly, because (a) performance (b) the intention to makie it still possible to poke into an object's guts but more obvious that's what you're doing (c) if you really want the class syntax atop a classic blessed reference, p3rl.org/Object::Pad will do that if you configure the :repr (that's basically the cpan testbed for a lot of the ideas that have gone into core and written by the same LeoNerd)
- sigzero 3y agoThis is just the start of adding it in. They are adding the foundational things and then will be incrementally fleshing it out.
- javaunsafe2019 3y agoThis is big :)
- ernst_klim 3y agoI'm learning perl right now and I'm bewildered at how could I overlook it for such a long time. With all its quirks and strange design decisions (especially compared to elegant languages like ML or Scheme), it has it's own killer features I missed from other scripting languages so much, such as the ability to embed a shell command in backquotes and get its output easily. Also the notion of context is pretty good, allowing to write a far shorter code, even sigils contribute to that naturally (in languages like bash they feel like a useless burden).
- mikelovenotwar 3y agoIf you end up doing web development, check out Mojolicious: https://mojolicious.org/ https://mojolicious.org/
- olgeni 3y agoPerl, like Tcl, comes from the Walter Bishop Era of IT, where things were apparently batshit crazy at times but they managed to do things we now fail to replicate :D Now, much effort is spent in making sure that a single team member cannot get weird ideas and do too much on their own.
- doctor_eval 3y agoWe must live in the Walternate universe where it takes a million lines of Java to do next to nothing at all.
- pjmlp 3y agoYou're outdated. Now the new fashion is having a bazillion of YAML files, describing Kubernetes containers full of WASM modules, replicating application servers on the edge. Apparently it is super cool.
- mst 3y agoingy is batshit insane (and great fun to collaborate and/or drink with) but even he didn't expect text templated turing complete YAML to happen. helm does still (last I checked) allow you to use your own transform script rather than the template engine so for private helm charts you can use https://yglu.io https://yglu.io with data in environment variables to get less fragile templating if you can get away with doing it that way.
- stabbles 3y agoNo official download of sources/binaries available yet
- mikelovenotwar 3y agoIncorrect, the source has been released: https://metacpan.org/release/RJBS/perl-5.38.0 https://metacpan.org/release/RJBS/perl-5.38.0
- dash2 3y agoPerl is such an interesting language. It's the first language I learnt seriously (pity me) and despite its quirks and failings, it was always a huge amount of fun.
- cutler 3y agoLarry Wall was a genius.
- justinator 3y agoHe's still alive.
- forgotpwd16 3y agoPerl 7 plan has been abandoned?
- bloak 3y agoI presume this statement from May 25 is still valid: https://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html https://blogs.perl.org/users/psc/2022/05/what-happened-to-pe...
- jwilk 3y agoDiscussed on HN back then: https://news.ycombinator.com/item?id=31515787 https://news.ycombinator.com/item?id=31515787 (237 comments)
- darrenf 3y agoSee "What happened to Perl 7?" from the Perl Steering Council in May last year: https://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html https://blogs.perl.org/users/psc/2022/05/what-happened-to-pe...
- mst 3y agoThe original perl7 plan never got past the RFC stage for multiple reasons. The current intent is to get things like the new class syntax (plus a number of other features, the exact list of which escapes me right now) shaken out and stabilised and then release a perl7 where 'use v7;' gives you the new baseline set of features while still being able to be /usr/bin/perl without breaking e.g. the PostgreSQL and OpenSSL and etc. build systems.
- drumhead 3y agoWhy did Perl never maintain its popularity?
- thesuperbigfrog 3y ago>> Why did Perl never maintain its popularity? It is usually installed by default on most Unix and Linux systems. It also rides along with most MinGW-based toolkits like Git for Windows. If you do software development, there is a good chance you might have Perl installed and not even know it. Some people like to make fun of it despite its wide-spread use and utility. Most of them probably know little to nothing about Perl and have not written or maintained any Perl code. There is a good chance that they are using Perl code without knowing it.
- cutler 3y agoAmazon.co.uk was built in Perl and Booking.com is still a Perl shop.
- thesuperbigfrog 3y ago>> Amazon.co.uk was built in Perl Yes. All of the Amazon retail web sites used Perl Mason running on Apache mod_perl: https://metacpan.org/pod/Mason https://metacpan.org/pod/Mason http://www.masonhq.com/htmlmason http://www.masonhq.com/htmlmason
- gpvos 3y agoBecause PHP (heavily inspired by Perl, but not as well thought out) came with all the glue to directly use it to generate web pages. Then came Ruby (also inspired by Perl, but with a more mainstream syntax, and nicer in some ways), and Ruby on Rails conquered that space even more. Also, Python came along which is indeed a bit more suitable for larger projects needing structure. Meanwhile, Perl was being badmouthed by people who couldn't handle its flexibility and thought it was unreadable and unmaintainable. But that wasn't the main issue, after all PHP was worse in those two respects, yet it flourished.
- HeckFeck 3y agoTime to get perlbrew'ing!
- mst 3y agoperlbrew install 5.38.0 -Dushrplib cd ~/wdir/my-new-project; git init; plx --init 5.38.0 <3
- viraptor 3y agoI couldn't find this info: is this work sponsored / requested by some company, or were the two authors adding this just because they care?
- mfontani 3y agoWhich "two" authors? Perl continues to flourish into its fourth decade thanks to a vibrant community of users and developers. The following people are known to have contributed the improvements that became Perl 5.38.0: Alex, Alexander Nikolov, Alex Davies, Andreas König, Andrew Fresh, Andrew Ruthven, Andy Lester, Aristotle Pagaltzis, Arne Johannessen, A. Sinan Unur, Bartosz Jarzyna, Bart Van Assche, Benjamin Smith, Bram, Branislav Zahradník, Brian Greenfield, Bruce Gray, Chad Granum, Chris 'BinGOs' Williams, chromatic, Clemens Wasser, Craig A. Berry, Dagfinn Ilmari Mannsåker, Dan Book, danielnachun, Dan Jacobson, Dan Kogai, David Cantrell, David Golden, David Mitchell, E. Choroba, Ed J, Ed Sabol, Elvin Aslanov, Eric Herman, Felipe Gasper, Ferenc Erki, Firas Khalil Khana, Florian Weimer, Graham Knop, Håkon Hægland, Harald Jörg, H.Merijn Brand, Hugo van der Sanden, James E Keenan, James Raspass, jkahrman, Joe McMahon, Johan Vromans, Jonathan Stowe, Jon Gentle, Karen Etheridge, Karl Williamson, Kenichi Ishigaki, Kenneth Ölwing, Kurt Fitzner, Leon Timmermans, Li Linjie, Loren Merritt, Lukas Mai, Marcel Telka, Mark Jason Dominus, Mark Shelor, Matthew Horsfall, Matthew O. Persico, Mattia Barbon, Max Maischein, Mohammad S Anwar, Nathan Mills, Neil Bowers, Nicholas Clark, Nicolas Mendoza, Nicolas R, Paul Evans, Paul Marquess, Peter John Acklam, Peter Levine, Philippe Bruhat (BooK), Reini Urban, Renee Baecker, Ricardo Signes, Richard Leach, Russ Allbery, Scott Baker, Sevan Janiyan, Sidney Markowitz, Sisyphus, Steve Hay, TAKAI Kousuke, Todd Rinaldo, Tomasz Konojacki, Tom Stellard, Tony Cook, Tsuyoshi Watanabe, Unicode Consortium, vsfos, Yves Orton, Zakariyya Mughal, Zefram, 小鸡.
- darrenf 3y agoI'm guessing they mean the two folk listed in the AUTHORS section of the `perlclass` page: https://perldoc.perl.org/5.38.0/perlclass#AUTHORS https://perldoc.perl.org/5.38.0/perlclass#AUTHORS
- deleted 3y ago[deleted]
- cagey 3y agoSadly, Strawberry Perl remains stuck on Perl 5.32.1.1 "Released: Jan 24 2021" https://strawberryperl.com/ https://strawberryperl.com/
- mikelovenotwar 3y agohttps://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases https://github.com/StrawberryPerl/Perl-Dist-Strawberry/relea...
- rwp00 3y agoWishing that the development of this whole Class feature would be done quickly, and that people use it for OO more often.