Perl 7 Announced As Evolving Perl 5 With Modern Defaults (phoronix.com) 86
Taking place this week is the virtual Perl + Raku "Conference in the Cloud" as a result of the COVID-19 pandemic causing the event to go virtual. A big announcement out of it is Perl 7. From a report: Perl 7 basically amounts to Perl 5 with more modern defaults and foregoing some of the extensive backward compatibility support found with Perl 5. News of Perl 7 comes a few days after the release of Perl 5.32. Perl 7 succeeds Perl 5 due to the Perl 6 initiative previously for what is now known as the Raku programming language. So to avoid confusion, similar to the PHP 6 debacle, Perl 7 is the next version. For the most part though Perl 7 is close to Perl 5.32 with changed defaults and is more forward looking with less commitment to backward compatibility support.
but (Score:5, Funny)
Unicode support? Can we upgrade Perl so Slashdot can finally support foreign characters?
Re: (Score:3, Informative)
Why would we WANT foreign characters? That would encourage people to inappropriately post foreign language content and help support Apple's broken quotes.
Re: (Score:3, Informative)
Unicode support would also likely mean Slashdot being blocked in China.
Slashdot is currently available in China because it can't be used for one-to-many communication in Chinese.
So please, no Unicode. Slashdot is, and should be, an English language forum.
Re:but (Score:5, Informative)
Except Slashdot has supported Unicode for around two decades now. Yes, two decades. Basically it was added when Slashdot Japan was a thing.
The thing is, Unicode support is tricky. It's not just "more characters" but a whole can of worms. Even companies like Apple and Google get tripped up by it all the time.
Things like character decorations - accents and other things you can attach to a letter. Some languages support a ton of them, and Unicode makes no restriction on what happens when you go and combine a million decorations on a character, which basically end up with a vertical black line that runs from the top of the page to the bottom obscuring hundreds of comments. Add in a whole row and you now have made the page black and unreadable while serving up plain Unicode text.
Of course, it didn't get that bad because on Slashdot, trolls only abused the RTL/LTR override codes in the beginning causing the entire page to be rendered backwards.
In the end, blacklisting every "bad" Unicode codepoint is a monumental task so Slashdot simply whitelisted the allowed character set instead - basically the ASCII printable set. A few years ago Slashdot filtered the output through the filter as well - before it did it, there were some nice examples of the RTL/LTR abuse still searchable. (You can still find them, but it loses its meaning as it's rendered LTR - just Google for ":erocS" yes, that's a colon in front and a capital S at the rear. Just think what RTL override might do and it makes sense)
Any popular website that doesn't use a black or white list gets rapidly taken over by comments that make a page unreadable if they remain unmoderated. And at least on Slashdot, it's a meme.
Re: (Score:2)
But anyway even if Slashdot were to restrict to Latin-1 chars it should still be using UTF-8 as its internal representation since it can be a subset of valid Unicode should they ever decide to offer other languages. I suspect the real reason they don't go Unicode internally is because the code is antiquated and tainted, and there is an enormous database of comments which is tainted too.
As an aside it still amazes me how incompetently most projects deal with making their code loc
Re: (Score:2, Funny)
Why would we WANT foreign characters?
Besides, the President issued an executive order banning foreign characters until the pandemic subsides -- or he leaves office. I think I read that right anyway, not 100% sure ... :-)
Re: (Score:2)
Slashdot is literally the only site on the entire internet that has unicode problems. Go ahead and find me one single other example. I'll wait.
Re: (Score:2)
Slashdot doesn't have unicode problems.
Perl has unicode (Score:4, Informative)
Perl had better unicode support before most the others and handled messed up unicode better than some others too. but free zero labor transitions didn't exist.
Re: (Score:2)
That would be easy... I could translate between the two with a Perl one-liner.
Re: (Score:3)
Line? You need a line for this?
Re: No the only changes is in the sigils (Score:1)
What the hell are you talking about?
Uh... no (Score:3, Informative)
Unicode support? Can we upgrade Perl so Slashdot can finally support foreign characters?
That won't work because unicode is fundamentally different from ASCII.
Unicode is simply a coded list of characters seen in documents across the world, throughout history, and occasionally in fiction (ie: Klingon). The code number per character is arbitrary, and only reflects the order of when the glyph was added to unicode.
UTF8 is a common way to encode unicode in byte strings, and is done by bytes. If the high order bit is zero, then the next 7 bits are mapped to regular ASCII. If the high order bit is 1,
Re:Uh... no (Score:5, Informative)
Changing Slashdot to UTF8 is a full-fledged project.
Yet the red site [soylentnews.org] did implement it.
Re: (Score:2)
So no, converting strings to UTF8 in perl is simple, but would break a lot of things. Changing Slashdot to UTF8 is a full-fledged project.
A project that was handled by one programmer on SoylentNews in less than a couple months.
Abuse potential: all your bases are belong to Zalg (Score:3)
A project that was handled by one programmer on SoylentNews in less than a couple months.
Oh, you mean, the site where it's now possible to fill the comment section thereof with megabyte-worth walls of Zalgo [wikipedia.org] text [eeemo.net]?
Thing is forum like /. are extremely popular for trollposting/shitposting/memeposting.
People are only half-joking when they say that Unicode is only this short of being a Turing-complete language:
Seriously, it can already be abused to completely fuck up the fromatting of a webpage.
That is 100% to happen the moment Slashdot stops explicitely whitelisting a small list of Unicode code-poin
Re: (Score:1)
Cheers!
Re: (Score:2)
Re: (Score:2)
Slahdot does what it does because some of it is still Perl 4 code.
Re: (Score:2)
Perl stores characters not as a simple array of bytes (as C would) but an array of *codepoints*.
Does that describe all perl strings, or just those that have been decoded from bytes as utf-8? And is that not incredibly slow, or is the contents typically not copied often enough to matter? (I'm assuming you don't mean strings are stored as UTF-16 including surrogate pairs as in C# and Java, since I believe that's not an array of codepoints.)
Edit: I just found some info [perl.org] about Perl's internal data representation and it looks like strings are just stored as a byte array plus metadata that flags whether the
Re: (Score:2)
If you think strlen() should return anything other than the number of bytes then you don't understand Unicode or strings.
Re: (Score:3)
You can change a perl string to unicode directly, but then a lot of things will break. The strlen($String) function will take a LONG time to complete, because the result is characters, not bytes, and the framework has to count chars from the beginning to see how many there are, and of course this isn't the bytes of storage you need to allocate on disk.
I've looked at this quite a bit, and I think the only thing that works across languages is to get rid of the concept of a character entirely, and think of things as substrings. Thus toupper() would take a string, and return a string. ischar() might return true if the entire string is composed of printable characters.
I wouldn't try working with standard C strings, I would make a new C string class (or set of functions combined with a C struct, however you want to interpret it). Then you can implement help
Re:but (Score:4, Interesting)
There has been Unicode support for decades (Score:4, Informative)
Perl had quite good unicode support since at least 2002 (although 5.10 in 2007 was more complete). But somebody has to actually code to take advantage of it. Having helped convert old code for unicode, it is not hard, but, still, somebody has to do it!
Re: (Score:3)
Perl had had quite good XXXXX support/implementation since at least 20XX (although 5.XX in 20XX was more complete). But somebody has to actually code to take advantage of it and everybody thinks Perl 5.x is old and that the Perl guys are still working on the new one, Perl 6...
Re: (Score:2)
Surely youâ(TM)re joking.
Re: (Score:3)
Perl has had great support for unicode for many years. Not familiar with Slashdot code so can't comment on that
Re: (Score:2)
slashdot.jp (now srad.jp) had no problem supporting unicode
I think there are two problems. The first is that almost all of the unicode code space is explicitly blacklisted. (Even most of the HTML entity codes are blacklisted!) Some of that was to avoid artposting, but that doesn't explain things like smart quotes. The second is that apparently there's some fucky handling of the encoding in the HTML headers that causes browsers to send Latin-1 or some other screwy encoding instead of Unicode when they use t
Re: Data structures? (Score:2)
Perl4 was incredibly difficult to do some stuff for lack of even that much data structure. I had to write my own library to fake having some very basic structures. My library was 5x longer than my real code.
What data structures do you think are missing and impor
What data structure? (Score:3)
What data structure? Perl has the main types built in.
Others are available as CPAN modules.
Or are you thinking in terms of a C struct?
Perl uses an associative array (which Perl calls a hash) for that purpose.
Re: (Score:2)
Perl uses an associative array (which Perl calls a hash) for that purpose.
Proving that it doesnt support data structures.
Just thought I would point that out...
A similar claim to the one you are making is that the C language supports generics and templates because #define's can be abused to do it.
Re: (Score:2)
Proving that it doesnt support data structures.
If you need complex data structures, then why are you using Perl?
Perl is great for short scripts and as a glue language. For large complex programs, there are much better languages.
Re: (Score:2)
Perl supports ridiculously robust structures and is perfectly suitable for large and complex programs.
Re: (Score:2)
I've thought about creating Data::Dumper::Code which would dump a structure with the best practice way of getting to that sub element as a comment. It would be so handy when parsing XML or JSON data that doesn't match the specifications.
Re: (Score:2)
Confused communication (Score:4, Informative)
Perl uses an associative array (which Perl calls a hash) for that purpose.
Proving that it doesnt support data structures.
Just thought I would point that out...
I think you're confused. The associative array *is* a data structure and perl's had them for a long time.
A data structure is an object that contains an aggregate of other primary types or objects. For example, a "block" of data that contains a separate integer and string is a data structure. That's essentially what struct { } and class { } let you define in C.
Modern languages also let you define functions which are specific to the class, so struct{} and class{} in C allow subroutine definitions which are implicitly given the struct as a function argument.
Perl has all of that, including class functions, implemented by the associative array. You can trivially define an object that's a block of data containing distinct primary types or other blocks - and pass it around as a single object. A block containing a separate string and integer is a built-in feature is trivial to define and use.
So if you're referring to some strange definition of data structure that's not in common use, please let us know what it is that you actually mean.
Otherwise, perl has data structures and classes built-in.
Re: (Score:3)
What?
Some common data structures include ordered arrays, associative arrays, and associative arrays. Perl has those data structures built in.
Possibly the most primitive data structures are ordered arrays (Perl has those) and C structs. Guess which languages have C structs? It's not a hard question, btw, which languages have *C* structs. Hint - the answer is a letter.
"Data structures" is like saying "animals". There are a lot of different kinds of animals. Your city has some kinds of animals, and doesn'
Re:What data structure? (Score:4, Funny)
Some common data structures include ordered arrays, associative arrays, and associative arrays.
Don't forget associative arrays as well. (What was supposed to be the third one?)
Lol stacks. Or queues (Score:2)
As I recall I was thinking of stacks.
Queues would also apply.
Re: (Score:1)
Re: (Score:2)
That's true. I wouldn't *call* them lists outside of an academic context because when you say list most people assume a linked list, and it doesn't have to be linked. But they are lists.
Re: (Score:2)
You appear to be claiming that perl doesn't support (any? some?) data structures. Clearly that's not true.
Can you clarify your point? It's really not clear what you are trying to communicate.
Re: (Score:2)
Re: (Score:2)
Raymorris will also tell you that any farm that has cows has animals.
An associative array is a data structure, just like a cow is an animal.
A chicken is also an animal; a stack is a data structure.
A horse is an animal; a queue is a data structure.
Farms may have cows, chickens, and horses. ...
Perl has stacks, queues, associative arrays
It seems like maybe you're thinking of one specific type of data structure and thinking that kind of called "data structure". Same as a toddler might think that an "animal" me
Re: (Score:2)
In the world of raymorris, a language with a GUID type supports data structures.
Re:In other news (Score:5, Interesting)
Re: (Score:3, Interesting)
At least as of two or three years ago when I last checked Perl usage had never even declined, only Perl growth declined.
As a perl guy... (Score:5, Insightful)
I support this measure.
The Perl 6 fiasco has seriously inhibited Perl. While Perl itself HAS continued to progress in leaps in bounds in both capabilities and internal compilation and function, adopting all the legitimate shiny advances that have come along over the years, it is often seen as ancient, still stuck on Perl after all this time.
As long as they have the compat mode so you can still write code that supports that one crappy ancient system in your portfolio that is boxed in and regulated in such a way that you can't get anything better on it... this is all to the good.
Re:As a perl guy... (Score:4, Interesting)
Yeah, this seems to be an admission by the core perl maintainers that they're aware "raku" was pretty much DOA.
Re: (Score:2)
The idea is a terrible idea. Its one of the dumbest things Ive ever heard of. Perl 5 is supposed to be about backward compatibility and Raku is the new language. If you want new, use Raku, this is for you. So Perl 7 makes absolutely no sense and creates more confusion. Raku is the next generation Perl, so what is this Perl 7 thing. The whole thing should be scuttled and instead people who want new modern or whatever should be instructed to use Raku. Its such a ludicrous idea I dont have words for it. Larry
Re: (Score:2)
At what point do you change bad defaults? I have Perl 5 code that will run in Perl 3 if the now standard "use warnings ;use strict" are removed. The 5->7 change will result in updating some file handles and the ability to remove some standard boilerplate and maybe cleaning up some early OO stuff. If I have to run very old code, I assume I can tack on "use v5.00" to the top of the old Perl 3 code. If I was concerned, it should be trivial to replace /usr/bin/perl with something that looks at the times
FINALLY! (Score:2)
maybe it'll save it from a slow death?
Perl's new OO implementation (Score:4, Interesting)
https://github.com/Ovid/Cor/wiki [github.com]
Cor might be cool, I LOVE the current built-in (Score:5, Interesting)
The Cor proposal has some advantages. As pointed out in the Cor proposal, most of what Cor would add is already available by using Moose. Cor looks like a perfectly reasonable way to do objects.
What I friggin LOVE about the basic built-in OO system in Perl is that it's transparent - you easily see exactly how it works. $thing->do($args) is just syntactic sugar for do($thing, $args) !
It's pretty much how all/most OO languages work under the hood, Perl doesn't hide it - you can see and understand how it works. I love that and use it to teach about OO.
Plan according to Sawyer X (Score:2)
According to Sawyer X the plan is to include Cor as a feature you can enable in Perl 7 and make it enabled by default (along with signatures it requires) in Perl 8.
Re: (Score:2)
No, its not. Just use Moose, problem solved. Its just ridiculous this whole OO-thing keeps getting rehashed when the needs have been solved very well with Moose.
Re: (Score:2)
Just use Raku.
Too little and too late (Score:1)
Perl was my love and I still write code faster in it than in any other language. Yet, the language has always suffered from the fact that the code is hard to read and hard to maintain. Back in the 90's one could put up with that as it was a huge improvement over C, awk, and shell, but no longer.
Perl 7 will carry on the same problems, with the additional complication that there is no backward compatibility. The Python 2 to 3 switch showed just how painful that can be. Keeping compatibility is very importan
Re: (Score:3, Informative)
Yes, but if you're writing a script that needs to run on 200+ systems across your completely heterogeneous environment, it's much easier to count on Perl 5 being available-- whereas python might be version 2, or it might be version 3, and as you point out, that's a headache.
Sure, you can push out a script written for virtualenv, but now you're pushing out not just a script, but an entire environment to go with it.
Perl-- when bash isn't enough, and python is too much.
Re: (Score:2)
"Yet, the language has always suffered from the fact that the code is hard to read and hard to maintain."
Everyone who felt that way moved to Python. Buzz off python fan. :)
Perl regex are difficult to read but then nobody else has a better answer either, the best option in any language is an equally difficult to read Perl style regex implementation.
"Now we have Python, which is very mature and can do anything Perl can do and is much easier to maintain and with a lot more packages by now." ...and now I read f
Re: (Score:1)
True, Python also uses Perl's regex. But you see, _all_ of Perl reads as a regex! Python at least cleaned up everything else except pattern matching. Oh, the $, #, %, ~ and other such ASCII noise. I miss them sometimes.
I agree Python and Perl are equivalent, and yes, Perl still hangs on. But that's about it. Python in my usage superseded not just Perl, but also Matlab. The whitespace indentation is the only thing I still find awkward.
Re: (Score:2)
I've moved to Python for some things and for work, but I'm currently remaking a 15 year old project using Mojolicious, finding it excellent. Really glad about this, because like Erlang, for example, it's actually a substantially 'different' language.
Slow and Steady I guess (Score:2)
I remember using Perl 5 20 years ago. I remember getting interested in Perl 6 over 15 years ago as an idea. I moved on, a lot.
Perl 7 sounds sensible - up to date defaults, dump the ancient stuff, and presumably include some new modules by default that make sense for 2020 (or at least 2010).
Re: (Score:2)
Yeah but the only thing changing is the defaults. That is what is sad, Perl 5 has actually been getting updated and revamped all along with all kinds of hot support in modules. Perl 6 was never the new Perl, it they hadn't called it the new Perl and updated the Major number a few times the myth of Perl being dead wouldn't have been so easy for the python mongers to sell.
Re: (Score:1)
Re:Per...l, wut? (Score:5, Insightful)
You used Perl when you just posted that, as Slashcode is Perl.
Re:Per...l, wut? (Score:4, Insightful)
I see perl lots of places. Even some fellow sysadmins who "hate" perl seem to still find use for it, even if they prefer to write in other languages most of the time.
I was really surprised a few months ago when I came across a recently-written perl script which was put together by a colleague who has repeatedly expressed his partiality for php (yeah, there's no accounting for taste). Sometimes, hacking something together quickly in perl is still the easiest solution because it's so adaptable - especially with the metric f***-ton of modules in CPAN covering just about any conceivable use case.
Re:Per...l, wut? (Score:4, Insightful)
Re: (Score:2)
What part of git is perl? The only part I can find on my system is git-cvsserver, which I've never used.
Re: (Score:2)
Re: (Score:2)
Wikipedia says "C, Shell, Perl, Tcl, Python". Minimal research helps.
Re: (Score:2)
Perl is excellent for text-centric write-fast-use-once stuff. It is a valuable thing to have in ones toolbox.
Because it wasn't confusing enough (Score:2)
99 problems (Score:2)
https://xkcd.com/1171/ [xkcd.com]
A wish, unlikely to be fulfilled... (Score:3)
Please?
Re: (Score:2)
A mandatory GUI library in a system that runs on lots of things that do not have a GUI? Strikes me as a really bad idea. Maybe a "highly recommended GUI Library" instead.
Makes things even more confusing. Terrible idea (Score:2)
The most common thing people mention is the object system , but it does have several advanced object systems like Moose and Moops which are available. So that has been solved. So in the area of object oriented systems look at Moose,
Backwards compatability is important and there is a lot of existing code, I am not a big fan of wasting time redoing code because people decide to change some language every 10 years. Python 3 was a debacle and a big mistake. Always provide backward compatibility so you dont make
What?? Some editing, please (Score:1)
Perl 7 succeeds Perl 5 due to the Perl 6 initiative previously for what is now known as the Raku programming language.
I don't usually bother to post anymore, but what the holy hell is this supposed to mean? This isn't a sentence.
So Perl 6 is a failure? I thought so. (Score:2)
Basically "second system effect" with delay but on steroids. If you put in everything and the kitchen sink, the result is pretty much unusable. Glad to see they have realized that too.