11 ms·
I was part of a team that wrote significant parts of Amazon's payment processing systems in Perl in the late 90s. I really loved the language. It's object syste
by sumanthvepa 6y ago
I was part of a team that wrote significant parts of Amazon's payment processing systems in Perl in the late 90s. I really loved the language. It's object system was so flexible and powerful. Once you understood how write idiomatic perl. It was a joy to use. I'm looking forward to trying out Perl 7.
- jqcoffey 6y agoOk, so I wrote tons of Perl and am to this day a fan, but I don’t think one can call a blessed hash (or scalar for the fancy folks) an object _system_. It is flexible and fun and I do miss it. True story: years of passing functions to other functions and map/greps made the switch to FP Scala (another language I fear will die) a lot easier!
- cutler 6y agoI've heard Python's object system isn't that different under the hood.
- phone8675309 6y agoYou even have the same boilerplate of the first argument to a class member function being the object itself.
- cutler 6y agoYes. I was thinking mainly of Perl's symbol table which I believe is also how OO is implemented in Python.
- daotoad 6y agoMy understanding was that Perl's OO system was directly inspired by Python's. I can't find a source on that though.
- jlokier 6y ago> I don’t think one can call a blessed hash (or scalar for the fancy folks) an object _system_. Perl first, then JavaScript. Did you know JavaScript classes are blessed hashes? They even take about the same amount of syntax. ("__proto__" vs "blessed", "prototype" vs "bless"). Old JavaScript made the blessing crude and obvious. Modern JavaScript lets you hide it in a "class" decleration. Which you can also do in Perl if you want (though you'll need to choose a module for this, and people generally prefer a different approach to dressing up objects in Perl.) There's still a blessed hash under the hood which you can see and kind of have to be aware of... in both languages.
- daotoad 6y agoPerl and JavaScript both give you a minimally specified set of tools you can use to build your own more advanced object system. IMO, that's why both languages have been able to be extended and adapt so much. If you look at tools like Moo and Moose in Perl and the different coding paradigms that evolved in JS before the "class" keyword was standardized, this is pretty clearly evident. JS has had the advantage of a standards committee pushing new language features aggressively. Perl has moved more slowly, keeping a majority of functionality in libraries.
- jqcoffey 6y ago> Did you know JavaScript classes are blessed hashes? > They even take about the same amount of syntax. ("__proto__" vs "blessed", "prototype" vs "bless"). omg, I totally forgot that (I left day-to-day JS use a good decade ago, sorry!).
- lmm 6y agoTraditional JavaScript has a notoriously poor object system yes. If those are the only two languages you know then I guess Perl's object system doesn't seem so bad, but that shouldn't be a defense of either language.
- Discombulator 6y agoVery similar story here; I barely write any Perl nowadays but am still very fond of it. I especially like the sigils - they serve in a way as a primitive type system and actually convey useful information when reading code. I suspect people who complain about them are the same who dislike strong typing. Interestingly, like you, nowadays I am very fond of Scala.
- jes5199 6y agohuh. I spent a couple years writing perl professionally, I guess that was around 2006, and I couldn't agree less. Its object system is so bizarre compared to any other language - it's like it doesn't really have an object system, it has parts of a system that you can try to assemble, but no matter what you do you end up with something weird. And on top of that, the sigils, refs, and `wantarray` systems means that figuring out what syntax you need to invoke something correctly is confusing mental overhead that you have to keep in mind for every function call Basically the things I learned in perl were the least transferrable concepts of any programming language I've ever worked with. You learn Haskell, or Forth, or Lisp and you learn insights and patterns that you can use in any language. You learn perl, and you've learned nothing but Larry Wall.
- earthboundkid 6y agoPerl definitely has a lot of non-patterned arcana. For instance, $| This variable, if nonzero, will flush the output buffer after every write() or print() function. Normally, it is set to 0. In other languages, you do something like os.stdout.buffered(true) or sys.stdout = io::buffer(sys.stdout) or something like that where you're combining composable pieces: the standard std variable, a standard way of opening files with or without a buffer, etc. Perl instead has an obscure global variable that you have to look up/memorize, and it doesn't even have a sensible name like $STDOUT_BUFFERING, so readers who come across $| in a file have to look it up/recall from rote memorization, or hope it has a good comment above it.
- rlpb 6y agoI'm no fan of Perl, but you can use $OUTPUT_AUTOFLUSH instead if you "use English;". So this isn't really a Perl language thing; it's a style thing. Other languages can be made to look really bad with poor style. The question then becomes what is culturally accepted, and what is not.
- ljm 6y ago`use English;` as a directive feels like the programming equivalent of someone on TV saying "ye ye ye can you say that in English!?" Only, it's the programmer saying it this time, not the layman. Perl is a 10x engineer.
- ricardobeat 6y agoThis seems to be a common experience - people say it felt powerful and modern in the 90s, because it was. For those who started programming in the 00s and 10s it looks clunky and weird compared to the other options.
- cutler 6y agoThat doesn't add up because today's most popular languages - JS, Java, Python, PHP and Ruby - were also released in the 90s.
- earthboundkid 6y agoPerl was released in 1987. The languages released in the 90s all stole Perl/Awk's good idea (have an associative array/hash map/dict type as a builtin data type) but had much nicer syntax.
- cutler 6y agoPerl5 was released in October 1994. That's the version which competes with Python, Ruby and PHP because it introduced OOP.
- dhosek 6y agoI stuck with Perl even when Ruby came along and offered to be the next best thing because Ruby didn't have a use strict equivalent. Having to declare variables before use is a good thing.
- dhosek 6y agoPHP was a reimplementation of Perl by someone who didn't understand why Perl did things the way they did and so ended up creating a vastly inferior language. Other than maintaining some legacy projects, I've not touched PHP in over a decade and I'm glad to avoid it. Perl is a tool I still return to for some tasks (one was a bizarre management request for a spreadsheet of all the Java classes in a large project which took fifteen minutes to create a Perl script to generate and ten of that fifteen minutes was looking at documentation for Perl modules I hadn't used in a long time).
- papito 6y agoPerl was a great fun scripting language back in the day of CGI and "webmaster@". It died a noble, honorable death. RIP.
- _sbrk 6y agoIt's not even close to dead.
- cutler 6y agoTrue. If you search Indeed.co.uk there are more jobs which mention Perl than Golang.
- papito 6y agoWhile you can FIND Perl jobs, it is effectively dead for most of the hiring market. It will never truly disappear. COBOL is not dead either. Is it really something that we think of when we talk about modern software engineering? Not really. How much production software is started from scratch every day using the language? I started my career in Perl and I still have fond memories of working with it up to late 2000's, but by that time the writing was solidly on the wall. Dead in this context means "niche".
- deleted 6y ago[deleted]
- staycoolboy 6y agoI was on one of several CAD teams at Intel in the 90's and huge parts of pre and post-silicon Itanium simulation flows for timing, layout and verification were written in Perl. (Not even Perl 5.6 so we hit the 2GB file limit often!) ... Not the tools themselves, but the control flows and asset managers. The other processors still used Tcl on HPUX/Solaris/AIX so Perl on Linux was like nice warm sheets by comparison.
- zeveb 6y ago> The other processors still used Tcl on HPUX/Solaris/AIX so Perl on Linux was like nice warm sheets by comparison. I would agree, but I don't think you meant it the same way I would: I prefer nice cold sheets when I sleep, and I much prefer Tcl to Perl!
- tunesmith 6y agoI also quite enjoyed perl. There are a lot of us that cut their teeth on perl and know it well, even if we are currently working in other languages. We also tend to de-emphasize it on our resumes for obvious reasons. But if I had a contract opportunity to spend months or years on a large perl codebase, refactoring it or porting it to something else, I'd probably snap it up in a heartbeat.
- tdhz77 6y agoUnited States District Court filing system for court cases is written in perl. Horrible language filled with one liners that only makes sense in the mind of the now retired and gone programmers. Sadly, I do not know why we cannot pursue other technologies. Perl is a trap... buyers will be stuck for 30 years. Like a mortgage, but without equity or returns.
- snapdangle 6y agoYou might want to go ahead and inform those investors who bought Amazon or Booking.com stock in the early 2000s that their orders of magnitudes of returns were really no such thing.
- crazypython 6y agoI hear Perl has weak typing with implicit type conversion. The only other language I know that has a powerful implicit type conversion system is C++. How does implicit type conversion work in Perl?
- kbenson 6y agoConversion is done based on operator, and Perl has different operators for string and numeric operations. For example, == and eq are different operators, with the former doing numeric equivalence comparison, and the latter doing string equivalence comparison. The implicit conversion done to operands in each case is well defined and obvious. Edit: Whoops, had operators reversed because I explained them after the fact. Fixed!
- daotoad 6y agoThere is also a concept of "context" in Perl. An operation may be evaluated in list or scalar context. For example, if you evaluate an array in list context, you get the members of the array, however, in scalar context, you get the number of elements in the array. This idea is generalized to discuss different evaluation contexts for scalars. You might hear people discussing how a value behaves in boolean or string context. It's also common to talk about casting as "-ification", for example casting something to boolean context is "boolification". By default, undefined values convert to empty string and 0. However, this can be made to generate a warning or even a fatal exception by setting the appropriate pragmas.
- redis_mlc 6y agoGenerally in Modern Perl-style programming, strict and warnings are enabled, so implicit type conversion is not used as much these days. Warnings or errors are emitted. I've found this greatly increases reliability. An example is that I enabled those on the W3C checkers and a serious latent bug was discovered and fixed, even on code I wasn't familiar with.
- mrtweetyhack 6y agoDon't know anybody at Amazon but are they still using Perl or have they replaced it?