News for hackers. Stuff that matters.
Re:93% of Paint Splatters Are Valid Perl Programs by telesilla on Thursday April 04, 2019 @04:35PM (#19576832)
I miss Perl. Why did PHP win again, in the late 90s? (though I'm mostly Python these days and shan't complain, there was a good 10 year stretch of PHP there I'm not proud of).
Re:93% of Paint Splatters Are Valid Perl Programs by onion2k on Thursday April 04, 2019 @04:43PM (#19576904)
PHP won because it was easy to install and restrict (by memory usage) on shared servers, as well as the fact that writing a PHP script was as simple as renaming an .html file to .php so web designers who wanted some dynamic functionality could use it really easily.

As bad as some aspects of PHP were, making it so trivial to install and make available on a server was a brilliant move that lots of languages could still learn from today.

If you have a project you want to become popular putting real work in to the initial onboarding is vital.

Re:93% of Paint Splatters Are Valid Perl Programs by saidajigumi on Thursday April 04, 2019 @04:52PM (#19576980)
The parent nailed it. It's easy to complain about PHP from various standpoints both pragmatic and PL-centric, but it has an amazing superpower which might be summed as "serverless for the web, v0".
Re:93% of Paint Splatters Are Valid Perl Programs by paulgb on Thursday April 04, 2019 @05:16PM (#19577207)
No deployment setup will ever match the pure joy of dragging a .php file into WinFTP, watching the little blue progress bar, and refreshing your browser.
Re:93% of Paint Splatters Are Valid Perl Programs by snazz on Thursday April 04, 2019 @07:50PM (#19578301)
I practically have that level of “luxury” in my Awful[0] (CHICKEN Scheme) web app that I’m working on right now. With a couple lines of code[1] added to my project (that I have only running in development mode), I can simply save my source code file in Emacs, have it automatically saved on the server through Emacs’s TRAMP feature, reload the page in Firefox, and instantly see my changes. If I like it, I make a commit through magit and I’m off to the next task.

Of course, I don’t run it like this in production (to refresh the production app I have to go to "/reload" from a certain IP address and be logged into the admin account).

Don’t worry: the “old ways” are still here, even if no longer mainstream.

[0]: http://wiki.call-cc.org/eggref/5/awful#a-hello-world-example

[1]: http://wiki.call-cc.org/eggref/5/awful#reload-applications-c...

Re:93% of Paint Splatters Are Valid Perl Programs by owl57 on Thursday April 04, 2019 @06:18PM (#19577667)
Yes! But not exactly relevant: this deployment technology is supported by Perl/CGI just as well.
Re:93% of Paint Splatters Are Valid Perl Programs by paulgb on Thursday April 04, 2019 @06:41PM (#19577824)
Definitely. I wasn't trying to be relevant so much as I got nostalgic at the mention :)
Re:93% of Paint Splatters Are Valid Perl Programs by ambulancechaser on Thursday April 04, 2019 @06:10PM (#19577606)
Interesting. Similar to how typescript can be added with a rename from foo.js to foo.ts.
Re:93% of Paint Splatters Are Valid Perl Programs by folex on Thursday April 04, 2019 @06:36PM (#19577778)
even on something with dependencies? i.e., with a few requires or ES2016 imports?
Re:93% of Paint Splatters Are Valid Perl Programs by wolfgang42 on Thursday April 04, 2019 @07:20PM (#19578105)
Yes, if your tsconfig is sufficiently permissive it will simply give any imports for which it can't find a type definition the 'any' type and assume that you can do anything you like with them. Obviously this doesn't give you any help from the type checker but it will work fine and you can go back and add typings later when you decide you need them.
Re:93% of Paint Splatters Are Valid Perl Programs by orev on Thursday April 04, 2019 @06:24PM (#19577705)
PHP won because you just wrote the code and it worked. With Perl you had to deal with the cgi interface which was a pain. Mod_perl came later. PHP was just extremely easy to get started with — you did t need to really understand Perl modules, the cgi spec, or anything to get started with it.
Re:93% of Paint Splatters Are Valid Perl Programs by lizmat on Friday April 05, 2019 @06:11AM (#19581154)
I gave up on PHP around 1.8b6 or something like that. However, before mod_perl arrived, I have used Perl to generate PHP code: a minutely cronjob would read the database and generate the PHP code with the right pulldown values from the database. It was the best of 2 worlds: a sane programming language and fast (non-CGI) execution.
Re:93% of Paint Splatters Are Valid Perl Programs by cure on Thursday April 04, 2019 @04:36PM (#19576847)
Yeah... Ruby's very nice and feels Perl-ish sometimes.
Re:93% of Paint Splatters Are Valid Perl Programs by bdcravens on Thursday April 04, 2019 @04:49PM (#19576957)
That's intentional.

https://www.ruby-lang.org/en/about/

"Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) ..."

Re:93% of Paint Splatters Are Valid Perl Programs by roberto on Thursday April 04, 2019 @05:38PM (#19577368)
The name "Ruby" is also a play on "Perl" ("pearl").
Re:93% of Paint Splatters Are Valid Perl Programs by freedomben on Thursday April 04, 2019 @04:40PM (#19576883)
Yep, if you like Perl you've got to spend some time with Ruby. It shares a heritage. Many of the people I used to Perl with moved over and were (and are) very happy. That said many of the "perl-isms" in Ruby are looked down upon by the community, but you can still use them ;-)
Re:93% of Paint Splatters Are Valid Perl Programs by tluyben2 on Saturday April 06, 2019 @10:18AM (#19590841)
I programmed Perl for many years and Ruby as well; I see the similarities but I very much prefer Perl and find idiomatic Ruby not very pleasant to read or write. Matter of taste ofcourse.
Re:93% of Paint Splatters Are Valid Perl Programs by pnw_hazor on Thursday April 04, 2019 @07:27PM (#19578154)
mod_perl couldn't live safely on shared servers. You had to rent the whole box if you wanted to use mod_perl.
Re:93% of Paint Splatters Are Valid Perl Programs by nineteen999 on Thursday April 04, 2019 @07:51PM (#19578307)
Not even mentioning the memory leakiness of it, it even had a module for tracking leaks:

https://perl.apache.org/docs/1.0/guide/performance.html#Memo...

https://perl.apache.org/docs/1.0/api/Apache/Leak.html

Re:93% of Paint Splatters Are Valid Perl Programs by feedbeef on Friday April 05, 2019 @12:32AM (#19579710)
I have a lot of legacy code built on mod_perl that survived over five hardware generations without missing a beat. But mod_perl has become system-cripplingly leaky over the last couple years. I nearly entered a debug rabbit hole before considering a simple workaround. After a quick apache conf edit, mod_perl was swapped out for plain old CGI. Heresy perhaps, but everything is running smoothly again.
Re:93% of Paint Splatters Are Valid Perl Programs by ars on Thursday April 04, 2019 @04:42PM (#19576898)
Because for anything you wanted to do there were 6 different ways to do it in Perl, making it rather hard to learn Perl.

Perl also looks like line noise, which makes it hard to read.

PHP also won because you can take a .html file add <?=$x+1?> and it's a valid PHP program. Perl was harder.

Re:93% of Paint Splatters Are Valid Perl Programs by orev on Thursday April 04, 2019 @05:44PM (#19577399)
It only looks like line noise if you make it look like line noise.
Re:93% of Paint Splatters Are Valid Perl Programs by folex on Thursday April 04, 2019 @06:37PM (#19577791)
And people did. And other people celebrated. Context is a lot.
Re:93% of Paint Splatters Are Valid Perl Programs by toast0 on Thursday April 04, 2019 @06:10PM (#19577615)
mod_php was much simpler to use than mod_perl; and much more amenable to shared hosting