For the last few weeks I've been forced into using Lua, because it is the embedded language in the simulation software I'm using.

I've had brief causes to use it a few times in the past for simple things; but this time I'm having to make far more extensive forays into it. And it has highlighted just how spoilt I've been using Perl for most of my scripting needs for the last 13 years. Even just the trivial things, like the fact that Perl detects and reports syntax and even some semantic errors, up front when the script is first loaded.

Having just had a Lua script run for almost 5 days before trapping out at the eleventh hour with an utterly trivial and inconsequential typo, I've once again had my respect for Perl (5) renewed by the experience.

Which makes the current state of the community all the more depressing.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re: It's so easy to become complacent.
by FreeBeerReekingMonk (Deacon) on Feb 22, 2016 at 18:24 UTC
    Well, ever sinds CGI-BIN was deprecated in favor of other methods, like node.js (mojolicious is too hard to write) the winds in the perl-sails have dwindled officially. As the starting-to-learn-programming language is anything but perl (python, java, etc) there is little influx of new people.

    Perl is not the only taking a hit. There are internet stories out there about critical stuff is maintained by lone wolves (I tip my hat to them) and a single death would kill maintenance.

    I feel that the ratio of users (consumers) is too high compared to the amount of admins (tinkerers).

    Perl5? It will not sink. It is designed to float, barely above the waves. And like the relation between C and C++ (two different, incompatible, languages)... so shall it have its own twin... consider matching a dot . and any character \.

    Depressing? Nah... it's like an aged wine. Enjoy the tranquility.

    disclosure: I still use perl4 (as it is embedded in a monitoring software I use). At work we still use 5.6, 5.8 at most. And most new syntax stuff is incomplete anyway.

      I have to ask, why do you perceive mojolicious hard to write? We deploy mojolicious web apps here at $work for loads of things, from a customer monitoring system to custom api's for things like GIS systems. I always smile when i get a new project that i get to use mojolicious.

      Just curious about your opinions/experiences is all

      -Pizentios
        Hmm... I will have to be frank here: I am biased.

        There might be a little truth to the fact that Dancer is marked Beginner and five star documentation, while Mojolicious is marked as Intermediate and has four stars of documentation. Dancer v/s Mojolicious

        At this point, there are enough docs and plugins for all that you would want and you just bring them together like ingredients for a cake... urr... starting to talk like a Mojolician...

        Maybe I was put off by exactly that video that is still around: https://vimeo.com/40579180 While frameworks like Starman is much more serious, and once hearing their strong points... appealed more to me.

        But it is more the fact that I got it immediately with node.js and Dancer, vs having to really trial-and-error my way around mojolicious. (but like I said, the point is moot now, as the docs of all webplatforms I talked about are topnotch)

        And maybe... a preference for the . instead of the fat comma:

        # extract title from template (in a beginner's tutorial!) my $title = $c->ua->get($msg)->res->dom->at('title')->text;

        Finally, there was some PM talk about the same here:

        Mojolicious vs Dancer (security-wise)?

        I hope to find some time to jump into Dancer2... maybe the summervacation...

Re: It's so easy to become complacent.
by perlfan (Parson) on Feb 22, 2016 at 21:45 UTC
    I know that it is not always possible to $WORK with Perl, and you highlight why.

    The only thing I don't use Perl for is when I want to do real threading, in this case I use a scripting language called Qore. On the surface it is very much like Perl, but like what you say about Lua - the sharp corners and really nice things Perl has are missing.
      when I want to do real threading, in this case I use a scripting language called Qore.

      Thanks for mentioning it. A quick scan of the documentation -- particularly with regard to threading -- and it looks to be a very sensible design.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re: It's so easy to become complacent.
by Anonymous Monk on Feb 25, 2016 at 03:10 UTC
    Are you talking about this:
    $ python -c 'print("START"); print(x + y)' START Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'x' is not defined $ perl -E 'use strict; say "START"; say $x + $y' Global symbol "$x" requires explicit package name (did you forget to d +eclare "my $x"?) at -e line 1. Global symbol "$y" requires explicit package name (did you forget to d +eclare "my $y"?) at -e line 1. Execution of -e aborted due to compilation errors.
    Now, this is Python and not Lua and maybe Python does have some 'strict' mode hidden somewhere... but I think it doesn't and it's pretty gross that it actually executes some code (print("START")) before crashing. I take it Lua also doesn't the equivalent of 'strict "vars"'.
    Which makes the current state of the community all the more depressing.
    Well, OTOH, I heard Lua has sane and simple C API, while Perl has XS... nothing is perfect.
      bah, variables are just one of so many things!!!
      $ perl -E 'use strict; sub foo { say "hello" }; say "runtime!"; f00()' runtime! Undefined subroutine &main::f00 called at -e line 1.

      Though I have to admit that not being able to declare variables explicitly (and as result, their scope) is for me one of the mayor Python issues.

        That's why I like to omit the parentheses whenever possible:
        $ perl -E 'use strict; sub foo { say "hello" }; say "runtime!"; foo' runtime! hello $ perl -E 'use strict; sub foo { say "hello" }; say "runtime!"; f00' Bareword "f00" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.

      perl -E 'BEGIN { say "uh-uh" } use strict; say "START"; say $x + $y'

        Is that supposed to be a counterexample or what?..