4 ms·
perl has closures, block based scoping, custom keywords (not exactly a macro system but you can achieve similarly awesome crimes against syntax), heavy introspe
by mst 2y ago
perl has closures, block based scoping, custom keywords (not exactly a macro system but you can achieve similarly awesome crimes against syntax), heavy introspection, an optional condition system, compile time computing, an integrated interactive debugger core with multiple clients, more functional constructs than python, OO modeled on AMOP, and no GIL.
Slow, bizarre in places, no live image though I can at least trivially replace function implementations and add methods to running code, binary building sucks, and there is of course a whole ass list of things that are uniquely awful (assume that the longest list you've seen from somebody who hates the language has 50% overlap with my personal list and that my list is probably longer) but ... it works. For me, at least.
I loved scheme; I keep picking at common lisp getting slowly better at thinking in terms of the capabilities of a system that's image based and deeply condition-system-ed, and I hope to get there eventually :D
- ramenbytes 2y agoDo you have this list typed up somewhere?
- mst 2y agoNot really, but I'll give you an example and then if you can give me an idea of why you're curious I can try and provide a few more if you think that'd help. A good one that I think is fairly typical of my annoyances - 'each' - the each keyword uses an iterator attached to the data structure it's iterating, so if you return or throw part way through doing so the iterator is left half way through and the next attempt at iteration will ... not do what you thought it would. The reason for this is that 'each' was originally introduced back in the mists of time to allow iteration over a dictionary (hash) backed by a DBM file of some sort, and those files only -permitted- a single iterator at the same time. Of course, people then started to use it for other things, but by that point making it behave a less surprising way for that would've broken existing code that used it for its original purpose (Larry and I chatted about this once and our conclusions mostly came down to 'alas'). Backwards compatibility is a hard master, and perl (and most cpan modules) work very hard not to break it, which leaves assorted things like that lying around. My 'solution' is to accept this as fact and simply not use 'each', instead iterating over the keys and pulling the values out in the loop body, and honestly that's fine for me but it's moderately annoying having to keep telling newbies they need to pretend the keyword doesn't exist. Things that freenode/libera #perl have found to be footguns often enough that we regularly teach people not to do that are collected in https://metacpan.org/pod/Perl::Critic::Community https://metacpan.org/pod/Perl::Critic::Community so you can find them with static analysis (and yes, of -course- each is on that list :) and might also be enlightening. (I personally quite like using the behaviour covered by ConditionalImplicitReturn, but that one probably still belongs on the list because I suspect the vast majority of the time it gets used by accident and becomes a footgun with a delay fuse ... i.e. "if you know enough to use this safely, you should also know enough to turn that rule off" applies) Part of the trouble I'd have producing a comprehensive such list is that so much of this knowledge has been baked into my brain/fingers long enough that there's not really any thought involved in avoiding triggering them anymore - my primary reason for mentioning it was "I am absolutely not blind to its faults, though every language has some somewhere" because I wanted to explain why I like perl overall without sounding like an Evangelism Task Force member. But yeah, if you want to point me in a direction I'm still happy to dig through my brain and see if I can find you a representative example :)