-
Website
http://www.matasano.com/log -
Original page
http://www.matasano.com/log/421/python-is-the-lingua-franca-of-over-the-hill-hackers/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Press Controls
3 comments · 2 points
-
ChrisMtso
12 comments · 1 points
-
Eric Monti
11 comments · 1 points
-
StatlerAndWaldorf
12 comments · 3 points
-
Dave G.
7 comments · 1 points
-
-
Popular Threads
That being said, PDB is pretty much extension language agnostic -- we spent time on the Racket/Ramble stuff because we needed it for a specific purpose. Writing a Python module for PDB would be fairly straight forward -- and it could use dpkt or whatever from within that module. Writing PDB in C was deliberate. I want to be able to write scripts in any language or framework, including Ruby/Racket, but also, say, in C/libnet should I choose to.
It took a while for Dino to work his evil wiles on me, but I'm a convert. Python feels like a collection of symbol table hacks to me. Ruby gives me back the language [incr tcl] tried to give me 8 years ago.
The only thing Python does better than Ruby is threading, which is to say that the Python interp doesn't have a broken IO threading implementation woven through its core. Not being able to pull libevent into Ruby is a continuing, horrible frustration.
The only major blemishes I've come across so far are (1) the inability to reference local variables in the parent function from inside a nested function (in a similar way that globals could be accessed from within a function) and (2) the fact that coroutines are limited to exist in a single function (and, while expanded in python 2.5 to allow data flow in both directions, still uses an asymmetric API to do so).
I'm not anti-ruby; honestly, I dont know it that well. I just keep hearing the same hollow language war arguments and wish someone would demonstrate constructs in one language that another language can't do easily or elegantly. From my point of view it looks like ruby and python are mostly equivalent and python has a larger user base and more native support.
"> I still haven't found the right problem to learn perl over...
Your essential mistake here is that you seek such a program. This is self-defeating Zen. When the time is right, the right program will quietly make _itself_ known to you.
-Tanuki"
One of these days, I'm sure a program will make known to me that it should be written in Ruby.
1. Blocks. Japanese Tcl supports anonymous functions at the core of the language. Python has essentially deprecated them. Anonymous functions and closures come in very handy with callback-driven code. It also supports RAII-style access to resources, like File.open with a block (with the file closed at the end).
2. A sane object model and standard library. My biggest initial complaint with Python is that the standard library is simply every Unix C library ever conceived, mapped verbatim into Python, with a thin, uneven layer of Python abstractions layered on afterwards. Time, datetime, and time objects.
Things Python has going for it (again, IMO):
1. A much more mature runtime environment. The interpreter is better. It's faster, it's less buggy, and it doesn't have any overtly broken conventions (again referring to the event loop debacle in Japanese Tcl).
2. Much better documentation. Much, much better documentation. Superior --- vastly superior --- documentation.
Little thing I would miss if I gave up Python: list comprehensions.
Little thing I would miss if I gave up Japanese Tcl: Rails.
Think about it.
It makes no sense to use Java to script Java (BeanShell) just like it makes no sense to use some other weird scripting language that sort of resembles a scripting language you might know but not really (Groovy) so your left with 2 options (well actually more but who would want to use a scripting language built into a router or web browser)
Jython is too old (Python 2.2-ish) and incompatible with all your 2.4 stuff, so JRuby is the only decent option. Simple.
YOU KIDS GET OFF MY LAWN!
(also, Josh and Tim are old)
And btw, how is it that Python is now ohh-so-old-school when only 5 years ago very few in the security community actually used it? Maybe I should buy me a gn0 b00kz and join the Ruby-p0ss3 then 1 B l337 d4wG!
http://andrewlsmith.blogspot.com/2006/07/indust...
The biggest visible difference between Python and Ruby, which changes the style of programs you write in Ruby, compared to Python, is "blocks", which are syntactic sugar around anonymous functions (which any language OTHER than Python would call a "lambda").
Python's support for anonymous functions is broken in a variety of small and annoying ways.
2) Named functions are only slightly less convenient than anonymous ones. Naming is a huge problem for new programmers, but we're all past that now (at least the 30-somethings appear to be ;-)
3) You can often use iteration and generators to simulate the effects of anonymous blocks. These are 2nd class, and cannot be referenced or passed around, but that covers 95% of the cases. For the other 5% you can cover 25% with lambdas (no side effects!) and the other 75% with named functions.
4) Are we really having a language war on your blog? I think freebsd is much better than linux, and vi rules all over emacs, pico or jot. Abortion should be legal. There should be no laws against keeping track of who owns guns. Gay marriage should be legal, and you, sir, are worse than hitler.
sorry, I couldnt resist, sometimes I miss lame.c
im-over-the-GIL (ha!)
http://www.ishiboo.com/~nirva/Projects/phasemac...
Most of my real work I still do in C, and all my network code I do evented, and if you want to tell me there's no real-world cost to naming functions, try following an SSL client through on_rx_phase_1, on_rx_phase_2, on_rx_phase_3, on_rx_phase_3_failure, etc.
But I'll admit Python's broken closures are enough to avoid this pain.
I just thought that was worth saving.
that said, there is some truth to the notion that Python is for over-the-hill hackers. CORE and Immunity, for instance (excepting gera's Smalltalk fetish). these Metasploit newjacks can have their goofy Japanese Perl, whatever!
i had this argument with spoonm at Bluehat before they settled on Ruby, and lost then. maybe Python 3000 will one day serve all you whippersnappers a big cup of STFU, but until then, i'm happy with my caffeine-free, hi-fiber, watered-down pablum language.
if Metasploit and PDB were written in elisp, i'd be more impressed. and might actually run them.
emacs uber alles!
After working in Ruby for more than 6 months, I literally cringe at the way some things are done in Python and am glad that I have almost completely forgotten how to program in Python at all.
Is it troll friday ?
Cuz it sure looks like YHBT by ddz.
Dino: Apparently almost 14 and still eating Pablum.
The main difference (besides age) is that one of us still thinks that Pablum is new and special or that a particular style of Pablum is so much tastier than the others.
Python and Ruby both suck in various ways. Some of the suckage in each is more tolerable to some than others. Personally I have several years invested in learning to deal with Python's suckage and no need or desire to learn the ins and outs of Ruby's suckage when there's very little payoff to be had for doing so.
One benefit to using Ruby or Rails is that apparently the Pickaxe book comes with a coupon for a free Tin-Tin haircut. I sincerely believe this to be true.