Slashdot Mirror


Larry Wall Unveils Perl 6.0.0

An anonymous reader writes: Last night Larry Wall unveiled the first development release of Perl 6, joking that now a top priority was fixing bugs that could be mistaken for features. The new language features meta-programming — the ability to define new bits of syntax on your own to extend the language, and even new infix operators. Larry also previewed what one reviewer called "exotic and new" features, including the sequence operator and new control structures like "react" and "gather and take" lists. "We don't want their language to run out of steam," Larry told the audience. "It might be a 30- or 40-year language. I think it's good enough."

8 of 163 comments (clear)

  1. Re:Perl? LOL. by jellomizer · · Score: 2, Insightful

    Perl still has a place, however it isn't the golden child language it once was.
    Perl heyday was during the mid-late 1990's when having a Relational Database was considered an expensive (in software price and/or in system requirements) so for Web Applications, that needed to do a server side data processing there was a lot of reading flat text data. Perl is still king at flat text processing. However with MySQL, PostGreSQL and Microsoft SQL Server 2000 being created and designed to be good enough to handle the large data sets, and with system resources that can fit on your mid range server. So PHP, Java servlets, ASP took Perl golden child status, as they are better designed to interact with the database, as well the ability to embed your code with your HTML simplifying the process.
    So its place as the de facto language for all things web is rather dated... However it is still good for text processing and can do what it needs to do.

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  2. No Coroutines by Anonymous Coward · · Score: 5, Insightful

    No coroutines. So sad. That still leaves Lua and Stackless Python as the only languages with symmetric, transparent coroutines without playing games with the C stack.

    Neither Lua nor Stackless Python implement recursion on the C stack. Python and apparently Perl6/More implement recursion on the C stack, which means that they can't easily create multiple stacks for juggling multiple flows of control. That's why in Python and Perl6 you have the async/await take/gather syntax, whereas in Lua coroutine.resume and coroutine.yield can be called from any function, regardless of where it is in the stack call frame, without having to adorn the function definition. Javascript is similarly crippled. All the promise/future/lambda stuff could be made infinitely more elegant with coroutines, but all modern Javascript implementations assume a single call stack, so the big vendors rejected coroutines.

    In Lua a new coroutine has the same allocation cost as a new lambda/empty closure. And switching doesn't involving dumping or restoring CPU registers. So in Lua you can use coroutines to implement great algorithms without thinking twice. Not as just a fancy green threading replacement, but for all sorts of algorithms where the coroutine will be quickly discarded (just as coroutines' little brothers, generators, are typically short lived). Kernel threads and "fibers" are comparatively heavy weight, both in terms of performance and memory, compared to VM-level coroutines.

    The only other language with something approximating cheap coroutines is Go.

    I was looking forward to Perl 6. But I think I'll skip it. The top two language abstractions I would have loved to see were coroutines and lazy evaluation. Perl6 delivered poor approximations of those things. Those approximations are okay for the most-used design patterns, but aren't remotely composable to the same degree. And of course the "most used" patterns are that way because of existing language limitations.

    These days I'm mostly a Lua and C guy who implements highly concurrent network services. I was really looking forward to Perl6 (I always liked Perl 5), but it remains the case that the only interesting language alternative in my space are Go and Rust. But Rust can't handle out-of-memory (OOM). (Impossible to, e.g., catch OOM when creating a Box). Apparently Rust developers think that it's okay to crash a service because a request failed, unless you want to create 10,000 kernel threads, which is possible but stupid. Too many Rust developers are desktop GUI and game developers with a very narrow, skewed experience about dealing with allocation and other resource failures. Even Lua can handle OOM trivially and cleanly without trashing the whole VM or unwinding the entire call stack. (Using protected calls, which is what Rust _should_ add.) So that basically just leaves Go, which is looking better and better. Not surprising given how similar Go and Lua are.

    But the problem with Go is that you basically have to leave the C worldbehind for large applications (you can't call out to a C library from a random goroutine because it has to switch to a special C stack; which means you don't want to have 10,000 concurrent goroutines each calling into a third-party C library), whereas Lua is designed to treat C code as a first-class environment. (And you have to meet it half way. To make Lua coroutines integrate with C code which yields, you have to implement your own continuation logic because the C stack isn't preserved when yielding. It's not unlike chaining generators in Python, which requires a little effort. A tolerable issue but doable in the few cases it's necessary in C, whereas in Python and now Perl6 it's _always_ an issue and hinderance.

  3. Re:LOL, Perl? Seriously? by phantomfive · · Score: 4, Insightful

    I got tired of writing programs that looked like line noise.

    Maybe you should have written better code.

    --
    "First they came for the slanderers and i said nothing."
  4. Re:Oh no by Greyfox · · Score: 3, Insightful

    Well you CAN write maintainable code in perl, you just have to use some discipline. Turn "use strict;" on everywhere, break your project up into packages across functional lines and have unit tests on everything. You know, all that stuff that no companies ever do. Given the choice between having to maintain a perl project and a ruby one, I'd take the perl project every time. At least you'll have some chance that the developers wrote some decent code, if only in self defense since they usually end up maintaining it themselves for a few years.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  5. Perl by randalware · · Score: 5, Insightful

    I used perl a lot over the years.

    comparing it to a compiled language (C, Ada, Fortran, etc) or a web centric (java, java script, php, etc) language is not a good comparison.

    when I need something done (and needed more than the shell) and I had to maintain it.
    I wrote it in perl.

    all sorts of sysadmin widgets.
    many are still being used today (15+ years later)
    I wrote clean decent code with comments & modules.
    finding the cpu & disk hogs, by the day, week & month.
    who was running what when the system crashed.
    cgi code for low volume web server tasks
    updating DNS
    queueing outgoing faxes & saving history
    rotating log files and saving a limited number of copies.

    how much code have you written ? and had it stay running for decades ?
    the people that took over my positions when I changed jobs never had a problem updating the code or using it.

    --
    This is my opinion based on what little I know and understand of the rumors and lies Thanks, Randal
  6. Why stay away from Perl by Shompol · · Score: 1, Insightful

    I wrote a couple of large projects in Perl last year, before switching to Python3 and never looking back. There is a plethora of reasons why Perl is ripe for abandonment:
    - Hard to read code with multiple '$'s and '@'s on every line
    - In-place string modification is asking for bugs
    - Clumsy OOP
    - Poor selection of publicly available libraries; some have critical bugs that have not been fixed for years
    And all this before having to maintain code written by someone else, in a language better suited for one-liner programs.

    1. Re:Why stay away from Perl by truckaxle · · Score: 5, Insightful

      - Hard to read code with multiple '$'s and '@'s on every line

      I prefer to have variables differentiated (scalars, arrays and hashes) and clearly identified from other syntax or text. It makes code more readable IMHO.

      - In-place string modification is asking for bugs

      You mean string interpolation? This in fact is one of Perl strengths

      $str = "There are $num apples".

      is clearer and less busy, easier to remember than

      str = "I have {a} apples".format(a=num)

      - Clumsy OOP

      Specifics? There are some valid criticism of Perl's 5 OOP but the success of CPAN and a long list of highly successful reusable OO modules highlights its practical side.

      - Poor selection of publicly available libraries; some have critical bugs that have not been fixed for years

      Now you are well into troll territory or you really haven't used Perl much. DBI, CGI, LWP, IO::Socket, HTML::Parser, GetOpt::Long, Devel::NYTProf (not really a module but a totally awesome profiler) the list goes on.

  7. Re:Perl? LOL. by bytesex · · Score: 5, Insightful

    The cool kids jumped on the python bandwagon saying perl was old, but in all this time they have yet failed to:
    - created a language that has libraries like perl has,
    - created a scripting language that can execute sql safely like perl can,
    - created a language that has regular expression support as part of the syntax (so you don't have to enter in yet another level of indirection and escape all the whatevers ' " \ / when you're trying to simply match some string easily),
    - created a scripting language that is also fast.

    Which are all the reasons I love and use perl.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.