I've found over the past decade or so that when I write a "perl" program I'm really writing about five lines of glue code around multiple CPAN packages. Well maybe more than 5 lines for control flow, some business-logic error handling, etc. When I write in another language I spend a long time looking for a library like the ten I'd find in CPAN, sometimes I find one but often enough not, then a long time complaining a…
Perl is 25 years old today
111–120 of 131 posts
Re: Perl is 25 years old today
#112I've got an interesting relationship with perl. My first exposure was back in the 80's when I was at Sun and perl was, to my taste, a shell scripting language with the complexity of APL and the readability of Forth. I hated it. When I took the job at Blekko they said "We do most of our stuff in perl" and I was dubious about that. However, now that I've been exposed to V5 for a couple of years and have probably writte…
Re: Perl is 25 years old today
#113Perl is 25. Python is 21. Lua is 19. Ruby is 17. Interesting how I consider Perl an 'old' language, and the others new languages. I guess it says more about how revolutionary Perl was at the time and how quickly it became widespread. The only other language I know of that went from 0 to everywhere in under 5 years was Javascript.
Re: Perl is 25 years old today
#114Re: Perl is 25 years old today
#115Before i switched to Python as my general purpose language, i used to be a bit of a Perl fanatic. I've still to come across a language that lets you get your ideas down as quickly. It's full of fantastic time savers, e.g. the for( ) construct and the format output functionality cover a bunch of common use cases in minimal keystrokes (let me pipe in some data, analyse it, then spit it out in a clean report). It can hu…
My experience is almost exactly the opposite. Whenever I'm writing in Python I can't escape the feeling that the code is simply fragile due to missing language features. Obviously this starts with all the regex initializations (often quite distant in source from where they are applied) which make regular expressions in python just a huge mess. Perl's autovification allows me to build a data structure at parse time wi…
As for regexes - while they are somewhat clumsy in python, they don't have to be defined distantly:
m = re.match(r'(\d{4})', buf)
if m:
print "year: %s" % m.group(1)
The only thing that really bothers me about the above is the need to separate the assignment of m from the test.Re comprehensions: seems to me they are just Python's version of Perl's map and grep.
grep:
@good = grep { $_->{width} > 9 } @crates;
good = [c for c in crates if c['width'] > 9]
map: @squares = map { $_ * $_ } @nums;
squares = [i*i for i in nums]
Which is better? I think Ruby's way is the best, and Perl/Python are a wash here.Now, on the autovivification note, I wonder if we can make a Python class that has the desired behaviors. Like:
c = PerlishStruct()
c['foo'][17]['bar'] = 'baz'
You don't really think it's junk, do you? Perl, Python and Ruby are extremely similar; I'd say Perl's more ergonomic, but messier; Python's cleaner, but sometimes awkward, and Ruby pretty much has the best of both worlds.Re: Perl is 25 years old today
#116Earlier quoted context omitted.
I am a perl lover. For me, the TIMTOWTDI means mainly that I can write code the way I think. When I have an idea of a solution for a problem, I have no effort to make to translate this idea into perl because there exists always a concise syntax for it. Perl does not limit your thinking. Instead of loosing time fighting to adapt your mind to the language, you have freedom to improve your skills. The more you improves,…
Hmmm ... I have found the same feeling with every language I've mastered. I never did master Perl but even if I had, I would have set it aside like most of the other languages that I have mastered when a compelling new language/tool/system came out. I try not to form an emotional relationship with my tools as it might adversely limit my adaptability.
Re: Perl is 25 years old today
#117I've got an interesting relationship with perl. My first exposure was back in the 80's when I was at Sun and perl was, to my taste, a shell scripting language with the complexity of APL and the readability of Forth. I hated it. When I took the job at Blekko they said "We do most of our stuff in perl" and I was dubious about that. However, now that I've been exposed to V5 for a couple of years and have probably writte…
The V3/V4 days ended in 1994 , before Java 1.0 was released. http://perldoc.perl.org/perlhist.html
http://stuff.mit.edu/afs/sipb/user/marc/hotjava/doc/people.h... (top left corner)
Re: Perl is 25 years old today
#118Earlier quoted context omitted.
CPAN might be centralized, but Java libraries are far superior. This is not a pissing contest, but a fact. The java runtime makes everything else look amateurish and unprepared. Debugging, profiling, introspection and distribution, all built into the platform. Attach to any running process and analyze away. Perl is good when it works, but when it doesn't, it's cryptic stack traces and `exit -1`, nothing meaningful.
Not really true. Yesterday I was trying to debug resource-loading issues. In any normal programming language, you can just strace it and you'll see where the program is doing I/O and you can figure out where it's trying to load files from. But if everything is in a jar, you don't see any OS-level I/O happening when Java tries to load something, so you have to invent all-new tools just to figure things out. When you s…
Re: Perl is 25 years old today
#119Earlier quoted context omitted.
My experience is almost exactly the opposite. Whenever I'm writing in Python I can't escape the feeling that the code is simply fragile due to missing language features. Obviously this starts with all the regex initializations (often quite distant in source from where they are applied) which make regular expressions in python just a huge mess. Perl's autovification allows me to build a data structure at parse time wi…
I agree with you about the feeling of fragility, especially with defaultdicts. As for regexes - while they are somewhat clumsy in python, they don't have to be defined distantly: m = re.match(r'(\d{4})', buf) if m: print "year: %s" % m.group(1) The only thing that really bothers me about the above is the need to separate the assignment of m from the test. Re comprehensions: seems to me they are just Python's version…
m = re.match(r'(\d{4})', buf)
'map' is more general than just the single, convoluted statement of list comprehensions, which really seems as a kludge from unwillingness to accept multi-line lambdas. So something new was invented that had to be learned; then it was argued it is a boon. (Like references in Perl. :-) )(There is some defaultdict functionality for autovivification in Python iirc.)
Yeah, they are all similar. I don't know enough Ruby to have an opinion.
Re: Perl is 25 years old today
#120And Perl 6 is 24
Considering perl5 is only 18 years old then somethings gone very awry there :) Perl6 is looking quite fresh considering how old you think it is. I just submitted an article I'd seen to HN which shows how a formula like... 4.7kΩ ± 5% ... can be parsed inline with Perl6 code. http://news.ycombinator.com/item?id=4939204
It's interesting to me how often people cite "Unicode in code" as some sort of amazing thing. I once posted on S.O. about the idea that maybe we should have a programming language where the vast array of options in Unicode were exploited to make things like Regular Expressions more readable (avoiding the backslash plague alone would be worth it).
I got smacked down by people complaining that they didn't know how to type anything but ASCII.
Sigh.