But unfortunately, its almost like going backwards. Perl was invented because C + Unix text processing utilities together were not proving to be good for many tasks like Text processing, fast prototyping etc. Now using another C based language which doesn't do that, takes us back to the old problem again.
IMO, Python doesn't solve those problems. Regex support is really bad in Python and file operations are not trivial. There is too much of Java feel to it and it just doesn't have the feel of bash/perl/awk's scripting powers. Scoping is just not right. There doesn't seem to be a sane ways of evolution without breaking backwards compatibility. No equivalent of CPAN. And in many ways white space based parsing is not good for large and nested code blocks. It still doesn't have multiline lambda's. And its too much do-it-one-true-way kind of language, that sort of is a blocker for quick hacking. Because I like to write what I think, and not the other way around. The language is too verbose, and unlike Perl and Emacs there are no exponential productivity gains over time.
But I agree though, that Python does have some other good things. The OO syntax is neat, there are some great frameworks like Twisted and Django. And there is low barrier to entry which makes new bie feel just at home. The tutorials are just too good. And good standard libraries ship with it.
Coming to asking people forcefully shorten their code blocks. It's none of language's business to dictate its style on me and steal my freedom. A language is supposed to behave the way I want. That's its very purpose.
No multiline lambdas, No CPAN equivalent, Seamless interaction with shell like $output = `command` is absent. No first class regular expressions. Lack of ability to provide the command line power Perl gives. No switch statement, No equivalent of Perl's smart match operators, Nothing like Moose, Nothing like Devel::Declare, Parsing power nowhere even near to Python. And I can go on and on..
I guess these are solid enough things(at least for me)
if True:
x = 1
[copy the above line, paste it 999,998 times]
x = 1
print x
Python runs that and doesn't say anything about by block length; it just behaves the way I want and prints x (after a short pause). What are you talking about?Not exactly the same, but the standard library is extensive:
http://docs.python.org/library/index.html
There is pypi:
whose packages can either be installed directly or with pip.
More verbose than Perl? Yes.
Bad?
for x in re.findall(r'\d+', '12 drummers, 11 pipers'):
print x
How is this bad?> file operations are not trivial.
File operations are trivial and well designed. You know, there is much more to file operations than in-place substitute.
> There is too much of Java feel to it
Bullshit.
> and it just doesn't have the feel of bash/perl/awk's scripting powers.
Want it to feel like Perl? Don't bother - use perl.
> Scoping is just not right.
Scoping doesn't require your testimony.
# foo doesn't exist
if blah:
foo = 'bar'
# foo exists if blah
This is perfectly fine.> There doesn't seem to be a sane ways of evolution without breaking backwards compatibility.
When you change the semantics of the language, bozo syntax tricks don't help. Python 3 has semantic changes - syntax tricks aren't going to handle them.
> No equivalent of CPAN.
A large stdlib and PyPi.
> And in many ways white space based parsing is not good for large and nested code blocks.
Spaghetti will look like spaghetti, irrespective of whether block separators are braces or indentation.
> It still doesn't have multiline lambda's.
"still doesn't" sounds like it is something which is planned but not achieved yet. It is not something that Python designers are planning to incorporate in the language. Perl has multiline lambdas but I only used single line lambdas for sort, grep et al - anything larger than that becomes a named function. Unless you have blocks, multiline lambdas aren't used that much.
> And its too much do-it-one-true-way kind of language, that sort of is a blocker for quick hacking.
There can't be an objective explanation to a subjective statement.
> Because I like to write what I think, and not the other way around.
What's the other way round? I like to think what I write? So in Python you think what you write? That makes zero sense.
> The language is too verbose, and unlike Perl and Emacs there are no exponential productivity gains over time.
Complete, utter bullshit. There isn't a single language in the world where the productivity gains are exponential over a long time - there might be some when you are a beginner which gets capped pretty fast.
>>There isn't a single language in the world where the productivity gains are exponential over a long time - there might be some when you are a beginner which gets capped pretty fast.
Sorry to ruin your party. But there are languages where there are exponential gains in productivity with time. Languages like Lisp, Perk, Haskell etc. But I can't convince that to people who can't look beyond 'readability matters' and consider that as the Pinnacle of programming language design.
Coming to regular expressions they are first class citizens in Perl. That is basically what takes them to the next level. Now scripting on Unix has always been so much about Text processing. That is how it has always been. tr, sed, awk and dozen other text processing utilities. And then there is Perl. If you are not getting 'Text processing' thing correct, then you already loose the scripting race with a very huge margin.
Perl added a lot of new semantics to the language too given/when statements, smart matching operators etc. Python broke it for as simple a thing as a print statement. That is the whole point(The language is too brittle to evolve). And I'm sure any new thing in Python is going to go the same way.
And stdlib is no where near CPAN. Although I agree PyPi is doing a good job.
You are right that I must use Perl,And you are also right that Python is an awesome language. There are great frameworks Twisted, Django, NumPy. I've used Twisted extensively. In many Python ways is a great language for web development, for studying algorithms(because its better psuedocode), and due to its frameworks like Twisted - its good for network programming.
But I am sorry to say Python doesn't do well in scripting areas. And it so happens once you start there and go a little deeper you can just go on and on with Perl.
Saying 'python feels like java' or 'exponential gains from switching language' is bullshit, and augmenting it with "calling it bullshit means you don't have an answer" is more bullshit.
> But I can't convince that to people who can't look beyond 'readability matters' and consider that as the Pinnacle of programming language design.
I don't remember mentioning 'readability matters' as being pinnacle of programming. You are responding to arguments you are imagining I am making.
> Sorry to ruin your party. But there are languages where there are exponential gains in productivity with time. Languages like Lisp, Perk, Haskell etc.
Get off your high horse. Lisp, Perl, Haskell aren't some exclusive club only you are allowed into. I have used Racket, Clojure, Python, Ruby etc. and if your gains are exponential accumulated over a period of 1 month between say Python and Racket, be assured you are a very lousy Python programmer. Let alone exponential, a gain of even 2x is quite a stretch. Why don't you put your money where your mouth is and show me your 'exponential gains'?
In place of spewing this nonsensical shit, you could have quoted me an example of "exponential gains".
Out of curiosity, have you actually programmed in Lisp or Haskell? I am not saying you have, I am not saying you haven't; it's just that people who claim "fuck yeah macros - now I am 100x more productive" are mostly people who haven't actually used them and are regurgitating blogosphere bullshit.
This is one lesson I'm not going to forget.
Sheesh. In this thread, there is nothing but platitude in your posts, and you are constantly trying to put down people(everyone else who doesn't agree with you about perl is a troll, saying that what you know about python is not correct is me defending my religion etc etc), and then you whine about people being impolite. Pot, meet kettle.
> This is one lesson I'm not going to forget.
Another lesson would be to actually learn and use Lisp before claiming exponential gains.
It's not impolite to say you are regurgitating blogosphere bullshit when you claim with utmost confidence "I am sorry to ruin your party but there are languages like lisp and haskell which results in exponential gains" when actually you haven't used either one of them.
The gain you mention (though the exponential part is debatable) is not limited to Perl alone[1]. Scripting languages provide a substantial gain in developer productivity freeing them from things like typing, faster debug cycle etc. and that gain is not limited to using Perl alone.
Check Table 1. in the reference I have mentioned, which compares the time it took to develop the same application in Tcl with time it took for development using in C/C++/Java. I think similar gain can be seen when one uses other scripting languages (say Python or Perl).
1. www.stanford.edu/~ouster/cgi-bin/papers/scripting.pdf