Mark Lutz on Python 108
Betsy Waliszewski sent in this interview with Mark Lutz, author of Programming Python. He discusses the evolution of Python during its brief history, XML support and .NET, and takes a brief look at the future of Python.
Re:Why hasn't Python taken off? (Score:1)
Python is like toilet paper! (Score:1)
After all, where would we be without toilet paper? Such a world scarcely bears thinking about. Yet for a great many years (up into the industrial age) it simply hadn't been invented.
The march of technology is gradual, and the uses of a product are not always immediately evident. Paper itself had been invented centuries earlier by the Chinese, yet it wasn't until the time of the great Thomas Crapper that it could reach its full utilisation. Use of paper in an old-fashioned privy would have been disgusting and ridiculous. But in a water-based toilet, it is heaven on earth.
Python is in much the same position. It is truly a splendid language, with features (e.g., whitespace formatting and garbage collection) that have been maligned in the past, and with good reason I might add. But hardware capabilities have moved on, and these are no longer liabilities, but features. Python is elegant, simple, safe, and above all it gets the job done. Previous tools could do the same work, but not nearly so comfortably.
(And where does perl fit in to this analogy, perhaps you ask? Well, you see, the Japanese used to have use a thing called "the toilet stick"...)
Python Queue ? Easy (Score:1)
>>> import Queue
>>> q = Queue.Queue()
>>> item1 = ["this","is","a","list"]
>>> item2 = "now a string"
>>> item3 = 3
>>> q.put(item2)
>>> q.put(item3)
>>> q.put(item1)
>>> q.get()
'now a string'
>>> q.get()
3
>>> q.get()
['this', 'is', 'a', 'list']
>>> q.qsize()
0
Re:My Guess (Score:1)
Python is fun because you can write very useful, complex, and READABLE programs very quickly. The startup curve with Python is extremely small compared to other languages, which is great.
A professional programmer cares about the quality of his/her code and the people who come later who have to maintain it. Code which isn't maintainable might as well not have been written.
Re:Why hasn't Ruby taken off? (Score:1)
Now that there is a good english Ruby book and apparently another on the way from O'Reilly that's changing.
BTW: In Japan, Ruby has taken off.
Re:so there, mikey, you been deleting posts agian? (Score:2)
Re:I agree totally. (Score:2)
mystack = ['blaad', 'test', 'new']
# pop
poppedvalue = mystack.pop()
# push
mystack.append('new element')
The Mark Lutz Impediment Factor... (Score:4)
Re:The Mark Lutz Impediment Factor... (Score:2)
I think that most people's impression that Perl's OOP features are a bit convoluted comes from their slightly tacked-on explanation (in terms of previous Perl features) in the Camel books. Given that most approaches to large-scale projects revolve around OOP these days, that leads
to people using the wrong techniques with Perl, and getting unmanageable stacks of steaming subs.
Damian Conway's Object-Oriented Perl [manning.com], on the other hand, is so good that it won me back to Perl from Python. Conway's explanations show you the subset of "ways to do it" that include "ways that scale".
It was a bit of a relief, to be honest, because while programming Python felt very worthy and clean, it was not fun. I wonder how much that had to do with how I learnt it too?
Re:OK, I'm lazy (Score:2)
Webware [sourceforge.net] gives you servlets in Python. I would recommend it -- Zope isn't by any means the only way to use Python on the web (thankfully).
I've never used Java servlets, but I've read a few bits of sample servlets. They seem to me to be painfully verbose. I'm all for long variable names and all that jazz, but Java just seems to make you jump through hoops for no good reason. It's not just that it isn't fun, or requires lots of typing, but verbosity makes for a bad language. You should be able to say things as you mean them, verbosity obscures that.
However, Java may not be so bad on a larger scale. Perhaps the example code doesn't want to build even a small library (since its just an example) and in a real project you'd do that and simplify things.
Another thing I like about Python is the extremely dynamic nature. You can have a dynamic inheritance tree, for instance -- consider an entire framework where you could subclass major components and those subclasses can easily insinuate themselves into the depths of the framework. This allows you to make radical changes to the framework without compromising the distinction between your local code and the upstream code. To do this requires that classes be first-class objects, so you just can't do it in Java.
Re:Python and Smalltalk (Score:3)
This hasn't and isn't going to happen for Smalltalk. There's no clean, well-partitioned way to install a Smalltalk runtime. It's overintegrated and overly insular. So it can't come in slowly, with small programs and utilities being written in Smalltalk.
Re:Python and Smalltalk (Score:1)
Previous posters have already mentioned the "wall" between the environment and the host system, and while I can understand the reasoning behind it, it is dated reasoning.
The bigger issue I have with Smalltalk (or perhaps just with Squeak) is that there is no syntax. Everything is an object, including such tradition keyglyphs as '='. That's swell, except that it means syntax is defined wholly by the object in question. Various classes had their own ideas of how they wanted their parameters arranged when they were instantiated or their methods called. It was horribly inconsistent. I spent more time reading "library" code in that language than I have in any other, and I remember almost none of it because it was so often conflicting.
It was a cute idea... pure OOP from the ground up. But it sure did turn into a nightmare.
review of Programming Python (Score:2)
Danny.
Python - Objective-C Bridge (Score:1)
Check out the Python - Objective-C bridge [sourceforge.net] project at Sourceforge. It appears to be coming along slowly. In the mailing list archives you'll also find discussion of using Jython with Apple's Java bridge as well.
A few quick changes (Score:2)
seriously, use what works best.
Chris Cothrun
Curator of Chaos
Re:Why hasn't Python taken off? (Score:3)
Re:needs a Perl Journal equivalent (Score:1)
You know that Python lets you put parens around an expression, and then have the expression span multiple lines, right? eg:
someProperlyAndDescriptivelyNamedVariable = (
somObjectWithAnotherLongAndDescriptiveName.aMetho
someObviouslyNamedParameters,
someOtherObject.someOtherMethod()
)
)
By the way, the trailing semicolon is unnecessary.
Re:Why hasn't Python taken off? (Score:1)
Re:Why hasn't Python taken off? (Score:1)
Re:Why hasn't Python taken off? (Score:2)
There are a few utilities to check your source for proper indentation, or to convert tabsspaces.
And the major macro-programmable editors all have hacks that let them deal very intelligently with whitespace, including automatically indenting at appropriate times.
Plus there are a few Python-specific editors, that also do code-colouring and such.
All in all, FeErOfWhItEsPacE is silly.
What's the problem with lists? How would you want to write them??
--
Re:Why hasn't Python taken off? (Score:4)
Thing of it is, Python does what it does so well that no one notices it.
It's like when you walk into a retail store. You don't notice that the carpets are clean. The carpets don't call attention to themselves. They're just *there*, doing their job.
Only time you notice a carpet is when it's filthy. When its syntax is filled with !@$% symbols. When it has memory leaks. Etc.
Anyway, the shortlist of companies using Python in commercial apps:
Advanced Management Solutions Inc.
* AMS provides the AMS REALTIME suite of enterprise software for project management, resource management, cost management and timesheets. The Python language engine is embedded in AMS REALTIME as a means of extending the products, and also as a way of enabling custom behavior and company-specific business rules to be supported.
CWI
* CWI, Python's home, has used Python in, among other things, GrINS, a 20,000 line authoring environment for transportable hypermedia presentations, and a 5,000 line multimedia teleconferencing tool, as well as many many smaller programs. See the collection of multi-media project papers.
Digital Creations
* A long-time sponsor of the PSA, Digital creations develops with Python - and also makes some of their Python software available for free!
ILU
* ILU (it's spelled Inter-Language Unification but it's pronounced eye-loo) is a (very) CORBA-ish multi-language object interface system. It has bindings for Common Lisp, C++, ANSI C, Modula-3 and Python.
Automatrix
* Musi-Cal(tm) is the first online calendar that provides easy access to the most up-to-date worldwide live music information: concerts, festivals, gigs and other musical events. It is maintained by Python scripts. So is their Internet
Conference Calendar.
Nightmare Software, Inc.
* Nightmare Software builds 32-bit Windows software with Python - and gives some away!
Infoseek
* Ultraseek Server, Infoseek's commercial search engine product, is implemented as an elaborate multi-threaded Python program with the primitive indexing and search operations performed by a built-in module. Most of the program is written in Python, and both a built-in spider and HTTP server can be customized with additional Python code. The program contains over 11,000 lines of Python code, and the user interface is implemented with over 17,000 lines of Python-scripted HTML templates. Try it out on the Python.Org web search page or download an evaluation copy from Infoseek Software.
eGroups.com (previously Findmail)
* A comprehensive public archive of Internet mailing lists, implemented in pure Python. Latest statistics from Scott Hassan: 180,000 lines of Python doing everything from a 100% dynamic website to all email delivery, pumping out 200 messages/second on a single 400 MHz Pentium!
DataViews Corporation
* DataViews Corporation in Northampton, Mass., have been using Python internally quite a bit.
LLNL
* A group at the Lawrence Livermore National Laboratories is basing a new numerical engineering environment on Python, replacing a home-grown scripting language of ten-year standing. Paul Dubois is a central figure in that effort.
NASA
* Johnson Space Center uses Python in its Integrated Planning System as the standard scripting language. Efforts are underway to develop a modular collection of tools for assisting shuttle pre-mission planning and to replace older tools written in PERL and shell dialects. Python will also be installed in the new Mission Control Center to perform auxiliary processing integrated with a user interface shell. Ongoing developments include an automated grammar based system whereby C++ libraries may be interfaced directly to Python via compiler techniques. This technology can be extended to other languages in the future.
IV Image Systems AB
* IV Image Systems uses Python for many projects, including a satellite image production system for the Swedish Meteorological and Hydrological Institute (SMHI) (see next entry).
This system receives raw data from several weather satellites, and produces images for many purposes, including the satellite images used for the presentation of the daily weather on Swedish TV 4.
For more information, contact Goran Bondeson.
Swedish Meteorological and Hydrological Institute
* SMHI is the home of the Swedish civilian weather, hydrological and oceanographic services. It's Python-based remote sensing software for automatic product generation, using NOAA and Meteosat data, provides information to bench forecasters, objective analysis schemes, and commercial interests such as the media. At SMHI's Research & Development Unit, a Python-based "Radar Analysis and Visualization Environment"
--
Re:Why hasn't Python taken off? (Score:5)
I think you're underestimating the popularity of python. Python still has to ramp up a decent 'community module' system like perl has. Check out 'the Vaults of Parnassus' (google is your friend). It has not existed for too long, but there's a good set of useful modules there.
The fact is, when you see python, there is'nt "one magic application" that suddenly jumps out as "the perfect thing" to use python for. I think that's because sucn an application does not exist. Python is a bit like C - it's an extremely good general purpose programming language that does a lot of things well.
C is a simple, efficient, fast and portable low-level language for doing generic system programming.
Python is a simple, object oriented, modular, clean language for doing generic application programming.
Have you ever tried to do a large-scale project in perl? Something with a few ccomplicated nested data structures, a multiple threads modifying the same data model, some serious io handling? All of that rolled into one farm fresh breakfast unit. It's hard to do in perl - because perl was not designed with such uses in mind. It'd be LONG and annoying in C, because BSD sockets are a pain to work with, and C generally makes many things long and tedious (if you want to do them "right" anyway). C++ would be quite a bit better than C, but you'd still have to deal with the C system APIs, which will still be annoying. Java would probably give you quick development cycles, but nowhere near as quick as python.
I consider python as lying somewhere in between scripting languages and compiled languages. It lets you do structured programming and gives you a powerful OO structure and modules galore, but keeps the syntax simple and clean. To me, it's a lot closer to Java than Python (this stand is supported a bit by Jython).
It fulfills the 'glue' properties more than perl does for me. I see perl as sed with better syntax and modules (and I like perl, and use it quite a bit, dont get me wrong). Python is something you can use to quickly and painlessly write good, maintainable, modular, portable code.
-Laxitive
Re:Why hasn't Python taken off? (Score:1)
Wow, you don't know much about rugs, do you? You also notice rugs when they're especially pretty, or contain interesting patterns, or tell great stories succinctly, such as s|\W|sprintf("%%%x", ord($1))|ge.
Btw, are you really implying that noone who programs with python actually notices the language? That they just subconsciously add in the name of the interpreter in the #! line at the top of the program, without it ever occuring to them that when they type "#!
Re:from future import ruby (Score:2)
Caution: Now approaching the (technological) singularity.
Re:Python vs. Ruby anyone? (Score:2)
It all depends on what you want to do. Certainly if it's something that someone has already written the code for, then Python is more likely to have it pre-done. Also, many more systems come with Python already installed. And Python has a freeze system for packaging up a program into an executable for distribution. I've not yet used it (I tend to drop into Ada or Eiffel if I want a compiled module), but it's there.
OTOH, Ruby currently seems to be changing faster than Python. I suspect that this is largely importation of stuff from Japan, where Ruby originated, but the effect is the same. Still, there is currently only one book on it (though another [by Matz] is on the way).
Caution: Now approaching the (technological) singularity.
Re:Why hasn't Python taken off? (Score:1)
Python is good for almost anything, but it's particularly good for studying programming, prototyping and as a 'glue' language. Let's rephrase the question, however to 'why hasn't it taken off more spectacularly?', because it is really quite popular and widely used, just not as much as perl or java. Now, when people are picking their first language they will often pick the one that's the most 'marketable' like C or java or perl. They don't understand why a good glue or prototyping language is important, and naturally they don't want to study language that's good for studying, they want to study a language that's good for doing something they need done. In my opinion, perl gives you an opportunity to do some really powerful and exciting things real quick, sacrificing some readability, maintainability and consistency in the process. On the other hand, newbies will find out that winamp, napster, etc are written in c++ and/or c and will prefer to study that, because of familiarity. And lastly, a language that
really shines at prototyping and 'gluing' will have inherently lower visibility than other languages (undeservedly, imho). All these things considered, it also surprises me that python isn't more widely used. Is this the dreaded 'worse is better' law at work? Are many people bugged by indentation syntax? I don't know, perhaps someone who tried it and decided against using it can share his reasons?
Re:Why hasn't Python taken off? (Score:1)
Re:Why hasn't Ruby taken off? (Score:1)
Re:My Guess (Score:1)
Re:Why is code readability such a big deal? (Score:1)
Re:Why hasn't Python taken off? (Score:3)
Re:Why hasn't Python taken off? (Score:3)
I know a lot who use python because it gets the job done cleanly and efficiently however they rarely make a big deal out of which tool they used and most don't care what the solutions was coded in since it works pretty much without fail. Kind of how some people don't know their servers run unix because they have never had a need to know but everyone who has a windows server pretty much knows it because the server calls attention to itself.
Do to the structure of python code tends to be designed rather then hacked together which in the end gives better running programs that have fewer bugs and are more modular, thus easier to fix and extend.
Re:Python is silly ... (Score:2)
heh. That's one of the funniest descriptions I've heard of perl yet.
I love perl too (and I'm anxiously looking forward to Perl 6, which will hopefully have some of those shiny OO enhancements I've been craving. Alot of my scripts end up in that paradigm, and I'd love a few of the things mentioned in Apocalypse 2).I've started picking up python finally, mostly because of jython. I'm planning on moving to JSP and servlets for web development, and the thought of being able to prototype quickly in python, and have two languages to choose from depending on need is awful appealing. More, I have a lot more confidence in training people in a bit of python than a bit of java, if need be.
That said, I don't think I'll be giving up perl anytime soon. It's a powerful language, and I like how obvious it is that it was developed by a linguist. It maps well to my brain. You can do amazing things with perl, in a very short development cycle, and with a bit of discipline, produce code every bit as maintainable as any other language. (sloppy perl coders have just been giving the rest of us a bad name).
To be honest, the biggest reason I haven't picked up python sooner is the rabid python evangelists. God, they're annoying. It's a language, not the holy grail. Get some perspective.
Conclusion? Different tools. I'm glad there's python. I'm glad there's perl. One's not going to be suddenly displaced by the other. I sort of think of python as the brazen adolescent, trying to figure out where it fits in, and pushing at it's elders. It will settle down, and be useful for a long time to come, I'm sure.
That was a bit of a rant, but I feel much better getting it off my chest.
- eddy
an interesting take on python (Score:2)
it's quite favorable and puts things in a nice perspective. not all languages make it past a comparison with one of the coolest language on the planet.
check it out at http://www.norvig.com/python-lisp.html [norvig.com]
Re:Why hasn't Python taken off? (Score:1)
> codeguru.
It should be noted that Python comes with a whole heck of a lot of useful modules, so out of the box, there isn't as great a need for an external module archive such as CPAN. However, Python folks are working on a CPAN-like collection for Python too. See Python's Catalog-SIG [python.org].
For what you get in Python, see its Global Module Index [python.org]. You'll see why they say 'Batteries Included'.
Man, you hit the nail on the head. (Score:4)
*Sigh*
--------------------
Would you like a Python based alternative to PHP/ASP/JSP?
Re:My Guess (Score:1)
Yes -- it's clean and explicit, which means your eyes won't glaze over when you revisit it a week/month/year hence.
Re:I agree totally. (Score:2)
Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> z = [1, 2, 3]
>>> z.append(5)
>>> print z
[1, 2, 3, 5]
>>> print z.pop()
5
>>> print z
[1, 2, 3]
>>>
In all truthfullness though, the book does suck... I like "The Quick Python Book" much better. And the html manual kicks ass... and there's always doc strings!:
>>> dir(z)
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'so
rt']
>>> print z.append.__doc__
L.append(object) -- append object to end
>>>
Re:OK, I'm lazy (Score:2)
But say you wanted to be able to extend your servlet code, poke at live servlets, or get a lot of 'dirty' information out quickly (quickly as in development time). You can go to jython.org and grab a fully compliant Python interpreter implemented in Java. Presto, you got yourself a 4GL over your Java code. You can go google for JPE, a Java-Python bridge and go load Python extensions in C/C++ (much easier, IMHO than JNI) and talk to Python from Java and vice versa. Both Jython and JPE allow you to extend Python from Java and vice versa. That kicks ass...
Java has its place (that layer of apps just above C/C++) and so does Python (the layer on top of Java). The really great thing is that you won't have to switch mindsets. Python is clean, consistent, and really, really easy to write (much more so than Java, again IMHO).
Again, IMHO, I'd much rather prototype code in Python, work on the design, see what my design is missing, where I have to plug holes, and I can do so really quickly and easily (Python allows you to be more dirty than Java; multiple inheritance, writeable namespaces, exec(), etc...) and then I can profile the code (profiler comes with the std library) and extend the performance-bound parts in C/C++, again very easily. NumPy for example includes all of LINPACK: you get really great C/Fortran speed in numerical functions, but you get to use a RAD language.
Try it, you'll like it. Damn, that should be the Python slogan
Re:My Guess (Score:2)
Always, always, good code comes from good coders. A good language though, a) doesn't throw away the key of what the code does *cough*Perl*cough*, and b) allows you still enough flexibility to fix code, hack things together fast, etc *cough*Java*cough*.
Don't expect all of Perl's bells and whistles in Python: Guido doesn't want to pollute the language with equivalent ways of doing things, which makes perfect sense to me: helps readability, and forces everybody to strive towards increasing performance and features in the same 'niche' of code. But there's also *plenty* of power in the language and there is a very big toolset to work from...
Re:Why hasn't Python taken off? (Score:3)
If anybody's interested I can put the source up for everybody to see/use (no docs though
Re:Python is silly ... (Score:1)
My personal experience is that Python is also CPU hog, although fast, for all that.
The point being, you might find really different results depending on how hard you stress certain things. And once you find resulting bottlenecks, you [should] start optimizing. So even pretty good comparisons can be made very questionable in the hands of good programmers and administrators.
<flamebait>
On the other hand, Python makes the "whitespace overloading" hoax seem plausible.
</flamebait>
Seriously, Perl is a two dollar whore when it comes to syntax, but that's a good reason to keep coming back. Perl works better for me for many things. Its poor performance on object creation, method invocation, and some other areas was interesting. If Perl had good OO, it would be a lot better for certain kinds of use... and under sustained use (where startup costs are more negligible) I have found it to be extremely fast (e.g. under mod_perl).
This post is illegal.
Boss of nothin. Big deal.
Son, go get daddy's hard plastic eyes.
Re:OK, I'm lazy (Score:1)
Pro 2: It's easier to write than Java (well, for me, anyway)
Con: If you don't know Python yet, a "huge" project isn't exactly where I'd start...
In my modest experience... (Score:2)
I don't think that his book was bad (I've read it). I think Python rocks. I don't know very much Perl, but we use both extensively at work and I can see that they each have their strengths.
On a positive note, I wrote my entire website (and I suck at site design, I know...) in Python, and it was (and still is) quite a fun project.
Just my $.02. Flame away, please.
Re:Why hasn't Python taken off? (Score:2)
I can code well in several languages/environments, including C/C++, perl, Emacs Lisp, Java, x86 asm etc.. up until very recently I've ignored Python completely.
Once you know one language its easier to pick up another, however when you get to point when you can program in four, or five, you wonder what the point of learning another one is.
Anyway, I've just been trying to find a web-based jukebox for a large MP3 collection - and the best one I could find, (that didn't need a database or anything fancy), was Edna [sourceforge.net] - and lo, and behold, it was written in Python.
After looking over the 300 lines of code that implements a webserver, a jukebox, and playlist generator I'm now increasingly tempting to learn more ... if only I could get my head round the way lists are written, and the whitespace thing...
Steve
---
Re:Python and Smalltalk (Score:1)
Smalltalk's biggest problem, though, was "the wall" that the language put up between itself and the operating environment. Whenever you had to interact with something outside of Smalltalk, it was extremely painful. I think it eventually killed the language as a serious contender.
The "wall" wasn't there because the language designers were silly, by the way. It was a response to the fact that in the 70s when a lot of the Smalltalk thinking was being done, different OSes were really, really different. Smalltalk was portable because of "the wall", which was a big win. Today, the various OSes are much more similar, and the choice doesn't look as great.
By the way, Squeak, the successor to Smalltalk, looks very good. It still has "the wall" though, which is why I don't spend more time with it.
Kurt
Python hasn't taken off? (Score:5)
For a language that hasn't taken off, there's a lot of stuff to be enjoyed (over 900 goodies at VoP last time I checked). Nifty net stuff, interesting numerics, GUI systems, sound and graphics libraries, and so on. Not to shabby.
I used to hack a lot more in Perl, but it got to the point where I do anything more than a few hundred lines in Python instead. It's just a lot easier to get it working and keep it working in Python.
Re:Why hasn't Python taken off? (Score:2)
Python is too general purpose to get attached to any particular niche like that. It is just a little bit better for most taks than most of the competition. If you don't believe me you'll have to try it out yourself.
Re: The Wall (Score:1)
I loved the language, too. Because of the extensive class library, you could code major functionality in a method of, say, ten lines of source (often less).
As our project matured, we were forced by upper/middle mgmt to develop in c++ on HP-UX. It was a pain until the company licensed a toolset called tool++.h, which was in a way very funny - what it did was provide a Smalltalk-style class library to our UNIX c++. We were able to do useful things, again! But, still, we always wished we were still doing it in Smalltalk.
OK, I'm lazy (Score:2)
So, my understanding is that Python is probably more useful for projects that involve lots of glue code (COM talking to CORBA talking to Java, etc). I also seem to get the impression that Python doesn't suffer from the "too chaotic for big project" problem that Perl has.
So help me out here. I'm writing a huge, scalable middle-tier in Java using servlets and JDBC. Why should I bother with Python?
Pros Cons etc. Whats the story here people?
Re:Why hasn't Python taken off? (Score:1)
Why hasn't Python taken off? (Score:5)
I heard about Python several years ago, from a guy who was at Xerox PARC at the time. Yet today, the Python movement doesn't seem to be much farther along.
Java's lost some oomph in the marketing steamroller but gained some badly needed credibility with servlets.
Perl has gone from an obscure report munger to a community powerhouse. You want a feature? Perl has it.
Python's been ported to just about everything including PalmOS, but the shared source code I've found has been extremely limited or arcane. Yes, there are modules out there, but nothing like CPAN or gamelan or even MFC/C++ codeguru.
From the little I've investigated of Python, at three different occasions, it's clean, fast, easy to embed, easy to extend, easy to code for. Some people balk at the indentation style but that took me 30 seconds to get over. Some people balk at the shell interpreter aspect, but that felt like a prolog or lisp pmachine interface to me.
I'm not flaming, just wondering, what has Python been doing with itself, to have grabbed so little attention in the world stage?
Re:The Mark Lutz Impediment Factor... (Score:1)
the time it came out I couldn't learn much from
it, so I don't know how it would look to a
beginner.
Alex.
Re:My Guess (Score:2)
http://www.technetcast.com/tnc_stream.html?stre
-beme
Re:Why hasn't Python taken off? (Score:1)
Re:Why hasn't Python taken off? (Score:3)
I would say Zope (and persistent object databases in general) might be Python's "killer app." I've been doing a bit of work on a similar database system, and certain aspects of Python make it very well suited for this kind of stuff... e.g. a very clean object model, override-able __getattr__() and __setattr()__ methods, consistent reference semantics throughout, etc. Python is the perfect toolbox for building persistent and distributed OO systems.
About the only extra things I've been wishing for are optional static type-checking and C-like syntax (I like my curly braces, so shoot me =). Static type-checking is really necessary because I'm finding that I make just as many type errors in Python as memory management errors in C =).
Dan
Yes, this is a very nice book. (Score:1)
It is the only Python book I own, and the few times it has not had the information I need (mostly specifics about modules) I've been able to find what I need in the online documentation.
Re:Why hasn't Python taken off? (Score:2)
I think Python will take off eventually, based on my first hand experience.
The simple syntax and powerful features of this scripting language make it an excellent choice as a first language. Last summer I got my 11 year old nephew playing with some simple programming concepts using Python.
The generality and power of the language made it my first choice a year ago when I had to come up with a "mortgage recalculator" to figure out what payments would pay off the balance for certain interest rates in various time frames. Years ago I would have done that in C, Fortran, or HP-25.
I'd love to use this language as the high level wrapper for some projects at work, but we're heavily into C++ frameworks and I don't feel up to the level where I could SWIG my way into Python.
At any rate, I think Perl has the advantage of being first and an initially better regex capability. In that way, some of the thunder for scripting language audience share for Python was lost to Perl. This may be a reason that Tcl hasn't really caught on too much, either.
In scientific circles. that handle numerical data for simulations and visualization more than text, you'll find a lot more fans of Python. The growth limiter there has been that any algorithm requiring extreme efficiency taxes a scripting language, forcing one into a multi-language environment, such as Python on top and C down below. Fortunately, with all the modules for Numerical Python, etc. becoming available this bottleneck is becoming less of an impediment and I think you'll start to see increasing usage.
Re:Why hasn't Python taken off? (Score:3)
Re:Why hasn't Python taken off? (Score:1)
Good, sounds like there's a nice well-defined niche for Perl, then :)
my plan [gospelcom.net]
Well, while we're evangelizing... ;) (Score:1)
http://cm.bell-labs.com/cm/cs/what/smlnj/sml.ht
Also for a more hacker-oriented flavor, try O'Caml at:
http://caml.inria.fr/
Haskell (haskell.org) is also worth checking out, too.
Re:Why is code readability such a big deal? (Score:1)
cc-mode for emacs does an awesome job of auto-indenting. Just go C-c C-q and the whole function is beautiful. Whee!
Re:My Guess (Score:1)
Yes, I have tried Python. =) As I say, it is nice, but that's not what seems to count for (many) hacker types!
Re:Well, while we're evangelizing... ;) (Score:1)
I know you're unwilling to budge on this, but:
There are advantages of code which can interpret itself, but the same functionality is easily achieved through the use of ML datatypes. Caml now even has a pre-processor which lets you invent your own syntax and do traversals if you really need it.
Static typing is awesome for large program development. Your programs are faster, and you catch bugs earlier (no more run-time type errors!). When you need "dynamic" typing (and one seldom does), datatypes or caml's Variant types make it so, so easy. Pattern matching makes it easier to write than lisp code, too (though bigloo has made some headway here..)
No other language I've seen has a module system which can compare to SML's. Polymorphism and functors are an amazing combination. The fact the language comes with a formal definition is also pretty keen.
As for being expressive, isn't it impossible to represent a real, honest-to-goodness integer in lisp? (because it is always tagged for dynamic dispatch?)
You should take 15-312!
Re:Why hasn't Python taken off? (Score:1)
Python is closer to Java than it is to Python? ;)
Re:Well, while we're evangelizing... ;) (Score:1)
By "function polymorphism" you mean overloading? You can use variant tags in ocaml to do the same thing, which is just what happens in lisp (except you can use pattern matching. =))
Pattern matching is better than just conditionals. First of all, they can be compiled into jump tables for better efficiency. Second, you can nest them, which has the advantage of nicer-looking code (I guess this is subjective). Less subjectively, the translations of some patterns require duplicating code: the lisp version would have many copies of the same code which would need to be maintained in parallel.
Lisp does not have static type-checking, at least not in the sense of SML or O'caml. It just doesn't!
You really really should try out some more languages (in depth). Lisp is good, and indeed they are all turing-equivalent, but we have come a long way! You may thank yourself...
My Guess (Score:4)
Programming in python might produce better code, but it is enjoyable to write? Most write-only code (ie, scripting tasks) are tedious if you write them the "nice" way. Hackers find (perverse, perhaps) joy in writing these clever minimalist perl scripts that rely on its various uncivilized features.
When it comes to writing big code, though, writing in any scripting language is problematic for a number of reasons. (Not the least of which are performance, lack of modularity features, and difficulty in producint "stand-alone" apps.) So even if Python may be a nicer language in almost every respect (and who's to say if it is?), that doesn't mean anything, because scripts were meant to be dirty.
In other words, when it comes to scripting languages for use by hackers: terse, tricky, stateful, but "powerful" languages win.
Re:Why hasn't Python taken off? (Score:2)
Tabs and spaces are treated differently!
This means that I can write code that looks right, but the parser chokes on it. If I edit some else's code and they use spaces but I use tabs, everything gets screwed up. This, to me, defeats the entire purpose - "enforced readabiliy" far too easily easily gets transformed into "obfuscated syntax errors".
This is the same reason makefiles make my head hurt. To me, it's a glaring user interface / usability problem, in an otherwise very cool language.
Re:Python in enterprise (Score:1)
There are now. This is my preferred (YMMV): glade+python(with gtk and libglade modules). Yo go like this:
Clean and fast.
Re:My Guess (Score:2)
Yes. You can have all the fun you want (and more). Like many Very High Level Languages, Python frees you from most of the housekeeping a programmer has to do with C, C++ and even Java.
Tanks to its coerent semanthics and clean syntax, you wont have to squeeze your brain trying to remember obscure rules (or checking brackets)).
Did you ever give-up adding feature X to your program, because it would take too long? Just think : how much of this 'too long' was housekeeping? With python, you might find that you have the time ...
Re:needs a Perl Journal equivalent (Score:1)
--
News for geeks in Austin: www.geekaustin.org [geekaustin.org]
needs a Perl Journal equivalent (Score:2)
Just my two cents, becuase I think that having a central print magazine coming out every month is a really strengthening thing for a "marginalized" community (e.g. what the linux journal did/does for the linux community). I say "marginalized" from the standpoint that python is a much smaller community than, say, java.
My other four cents worth would be a) something besides whitespace for block indentation (by that I mean let me use {} if I want to, and I do, if for no other reason that when I'm 5 levels deep and want to write something liked WithSimilarlyLongAndDescriptiveName(someObviouslyN amedParameters,someOtherObject.someOtherMethod());
someProperlyAndDescriptivelyNamedVariable = somObjectWithAnotherLongAndDescriptiveName.aMetho
it's running off the side of a normal xterm real quick) and b) constructing a CPAN equiv. (addressed by posts above, so thats minus two cents).
--
News for geeks in Austin: www.geekaustin.org [geekaustin.org]
Re:Well, while we're evangelizing... ;) (Score:1)
And BTW, I'm at CMU too
Re:Well, while we're evangelizing... ;) (Score:1)
According to a good friend, OCaML does not have function polymorphism (such as 'defmethod' in Lisp) but it can be achieved through various hacks.
If you really want to write your own syntaxes nothing compares to the Lisp macro facility, (my friend wants to be able to infixify functions in OCaML, like in SML, but I think that's just a waste of time
All good Lisp compilers can infer types at compile-time, just like the OCaML compiler, and you can even specify static types and alter the amount of optimizing a compiler will do. Not only can you specify static types, but you can specify ranges as well! For example: (the (integer 0 100) x) specifies that x must be an integer from 0 to 100.
Pattern matching is an interesting feature, but its not that hard to write a condition to check for a cons and then do something. Recursive types are also interesting, I need to experiment more with those.
Re:OK, I'm lazy (Score:1)
However, IMO, Java is starting to suffer from Ada syndrome; starting from a clean design, marketing and/or design by committee is causing it to add every damn possible feature in the world, causing a mess. Python, however, remains simple.
Re:Why hasn't Python taken off? (Score:1)
He mentions pygame a couple times (Score:3)
This type of project goes a good way to show python is more than up to the task for quick paced arcade games. Currently pygame is adding support for the pyopengl modules, which is looking surprisingly good in terms of performance.
Honestly, seeing my humble project listed in the "What do you think are the most exciting developments going on in Python right now?" answer has made for a sweet day!
Re:Reason's Python has never caught on for me... (Score:1)
Re:My Guess (Score:1)
Have you tried Python? I'm a sucker for the fun-factor in programming languages, and Pythons straight, clean syntax and straightforward implementation of object-oriented ideas (totally dynamic binding is a bliss for Quick-and-Dirty stuff) makes it every bit as fun as perl. Python "just feels right", while Perl is "everything for everyone" .
Ever tried doing object oriented development in Perl? Used lots of references (Python uses references all the time), typeglobs? Fun? Well, perhaps it's fun but some people don't have time to learn all that stuff just to learn the kludges of one programming language.
Obviously, perl rocks for awk/sed style stuff.
Re:My Guess (Score:1)
Look at this script [uchicago.edu] and tell me if it's written nicely (and yes, it does actually work)
Python and Smalltalk (Score:2)
This isn't a dig at Python; something good is something good, no matter where it turns up. But what is it about Python which makes it popular, while Smalltalk never seems to quite make it?
But ParcPlace not taking up Sun's offer to bundle VisualWorks with SunOS. Ow!
There's got to be more to it than that, though.
Re:The Mark Lutz Impediment Factor... (Score:1)
-----------
MOVE 'SIG'.
Re:Why hasn't Python taken off? (Score:1)
Re:what a load of nonsense (Score:1)
--
Re:Why hasn't Python taken off? (Score:3)
Why hasn't Ruby taken off? (Score:2)
All my respects to Python, but I have to ask the same question about Ruby.
As you say, it's clean, fast, easy to extend, easy to code for. And there's no whitespace issues to balk at, even for 30 seconds (although there are legitimate reasons to balk at whitespace issues for more than 30 seconds).
I have used Perl almost extensively, and love it--Perl deserves all the use and attention it has--but when I think of something "cleaner" I'd like to use, my thoughts switch to Ruby, not Python.
In Ruby's case, though, I can probably say its age is why it hasn't moved further yet (at least in the U.S.;the first Ruby conference is this year). Ruby's acceptance has moved rather quickly when you think about it.
If you have been thinking about Python, and haven't taken a look at Ruby, *please* do. You'll probably like it. Ruby's too good to not at least check out.
www.ruby-lang.org [ruby-lang.org]
Pegasus Mail v4 and Python (Score:2)
-Kraft
Re:My Guess (Score:2)
Apparently you haven't used Python, or even read the docs; modularity is one of its strongest features.
Programming in python might produce better code, but it is enjoyable to write? Most write-only code (ie, scripting tasks) are tedious if you write them the "nice" way.
First of all, I use the interactive Python console to accomplish simple scripting tasks, which is a breeze. I spend so little time accomplishing my goal that I can move on to something I really enjoy in short order, such as a more challenging program.
If the task is slightly more complex, I figure out the basics on the console and then write the complete program in a module (in Python, a module is just a file of code--a "script"). When I'm done with my simple scripting task, that module lies around waiting for me to need some slice of its functionality (a function, for instance) in the future. If I do, I just 'import' it and go to town.
For more complex tasks I use OOP, which is pleasant in Python, though not as formal and featureful as in the likes of C++. For example, I've written a fairly involved network app that uses both multithreading and sockets extensively. OOP happens to match the way I think, so I consider solid support for it indispensable (before you suggest this, I was not "raised on OO" and therefore did not begin exploring the broad world of languages with a favorable bias toward it).
As for power, Python has it aplenty. The language's philosophy, though, is that extra power should be added uniformly--through the modules and class mechanisms--rather than cluttering the core language with lots of bizarre constructs.
Concurrent programs are a breeze with the threading [python.org], there's a parser [python.org] module for manipulating Python parse trees, an shlex [python.org] module for concocting simple lexers right off the bat, a Numeric [pfdubois.com] module for maxtrix manipulation and other scientifically oriented numeric programming, various imaging/graphics modules [vex.net] for graphics programming. These are just a few of the modules that I actually use. All of this, and the core language remains the best compromise of simpilicity (Lisp) and comfort I've ever used.
For most programming tasks (even complex ones), C++/Java-type languages aren't clearly superior. Bruce Eckels, author of _Thinking_in_C++_ and _Thinking_in_Java_ (thus clearly well acquainted with both), says [mindview.net] "Python is my language of choice for virtually all my own programming projects".
Re:Why hasn't Python taken off? (Score:1)
Re:Jython#PerlC++XMLNET is the Future (Score:1)
Let this be a lesson on how fatal software bugs can be and how even bad jokes can lead to tragic results:
The wrong poverty attribute is set in the method solveWorldPoverty() - I mean how bloody obvious was that but still - the worldPoverty attribute is actually part of the super languagePlatform.., Java and not relevant here. I should have set the attribute noMorePoverty instead. (Note to self: you are an idiot!)
See how such a small error can cause such a catastrophic problems on a world scale! My apologies go out to all the victims. I am truly sorry.
Just imagine if I had used Office 2000 instead of Office 10 to cure cancer though ... *shiver*
Jython#PerlC++XMLNET is the Future (Score:4)
Hahahahahaha! Python, Perl, Java,
I own your buzzwords .... I own your languages ......
Ladies and Gentleman I introduce the language, the platform, the enabler that will unite the world ..........
Jython#PerlC++XMLNET
I have a prototype and some examples shown below, in java, for you to realise the power and show that I am not talking out my arse:
public languagePlatformEnablerAndAllRoundGoodGuy Jython#PerlC++XMLNET extends Java implements Python, Perl, C++, C, C#, .NET, XML
{
private boolean worldPeace = false;
private boolean noMorePoverty = false;
public void solveWorldPeace()
// World peace brother!
{
worldPeace = true;
}
public void solveWorldPoverty()
// No more poverty man!
{
worldPoverty = true;
}
public void cureCancer()
// With the powerful new feature of M$ Office 10 who needs cancer!
{
new MSOffice10().setCancer(false);
}
}
Re:Does Python suck less than Perl? (Score:1)
I'm considering cleaning up my scripts and releasing them in some sort of mishmash, just on the off chance that other people can make use of them..
Re:Why hasn't Python taken off? (Score:2)
Of course, enforced readability might very well be what is holding the language back.
Re:Why hasn't Python taken off? (Score:2)
Most Important Change (Score:1)
$Cha-Ching$!!!
Re:Well, while we're evangelizing... ;) (Score:1)
Re:an interesting take on python (Score:1)
But that's a relatively new feature. (Score:2)
Instead of showing one simple way of doing it, he showed many complex ways of doing it, justifying it on the grounds of performance, thus implying that it was necessary for acceptable performance. These are exactly the kind of trade-offs and effort that one goes to a scripting language to not bother with.
Where Programming Perl tells you over and over again "do it however you like, it's okay to be ugly as long as it's useful, don't worry too much about performance unless it bites you," Programming Python emphasizes things like performance, at a time when Python was much slower than Perl (has this changed much?), and well-thought-out elegant, maintainable code, in a language that's supposed to replace my favorite hack-it-out-in-five-minutes kludge language. That's entirely aside from the poor organization and generally bad writing.
--
I agree totally. (Score:3)
In Perl, you want a stack? Use push and pop on an array. Want a queue? A deque? A shelf or scroll? Use shift and unshift too. It's all done in C, and faster than anything you can write yourself in a scripting language, even though it's all random access, too. In Python, you write a class, making sure you provide all the methods you will want to use with it, and carefully considering the performance issues of various methods, because you're working around a tremendously slow interpreter to make a basic data structure that should be built into every scripting language.
(incidentally, the multifunction list of Perl is probably my favorite feature, even over regexps and hashes; I use stacks and queues for everything, far more often than I use random-access arrays)
That's the impression I got from this book anyway. I was very enthusiastic about Python before I read Programming Python. To this date I don't know whether Python really only looks good until you actually try to use it, or I just got that feeling of utter hopelessness from the book.
--
Here's what Larry Wall thinks... (Score:3)
wanted it worse." - Larry Wall, 14 Oct 1998