The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 18, 2019, 12:49:46 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: callback for sir nop  (Read 3208 times)
daemon
n00b
*
Offline Offline

Posts: 3


View Profile
« on: November 16, 2009, 05:38:03 AM »

hi nop,

I'd like to know what do you think of Guido van Rossum's blog post here,

h++p:// neopythonic .blogspot. com/2009/05/so-you-want-to-learn-python.html
especially the part about SICP

My respect for Guido Van Rossum (as a programmer) dropped many places after reading the blog post.
Personally I tend to agree with this guy's comment,



Okay, once you tried to demonstrate that Tail Call Optimization is evil, something that, even after almost half a month, I still cannot stomach. Now, you try to say that SICP is a bad book just because it tries to explain one of the weirdest ability of computer programs (aka interpreting other programs). Now, I DON'T want to learn Python.

Let's talk about SICP. The book has 5 chapters, only one of which (4th one) is about interpreter, the first 3 are about programming in general and the last one is on compilation.

Now, SICP is not about how to impress your clueless peers by throw out the buggiest program possible that has a pretty interface, nor how to write yet-another-accounting-program, nor how to get the top paying job. No, it is about programming and computer program. It is written for college-level students, whose goal are supposed to be understanding and command over their subject matter, not for children who want to satisfy their ego.

As such, it tries to demonstrate a simple way, with the minimal number of tools necessary, to do everything with a computer. It is supposed to teach modern magic, which relies not on a huge library and consumer-centric ideologies, but on deep understanding of both theory and pratice of Computer Science. If you care reading it, from time to time, you will see comments like "This is not how such and such things are implemented, since real implementation wants efficiency; we just want to show a simple way to do this". If its secret agenda is to convince the young minds that interpretion, why would it bothers with these comments?

The best effect of SICP I experience is that nothing seems either mysterious or difficult anymore. Once, to me, compiler is like the hardest thing possible, and many problems are just impenetratable. Even writing an OS is easier to gasp than a compiler: at least you have something to start with (the compiler itself), right? Now, after SICP, nothing is impossible in my view. Yes, it is difficult, but it is possible. And the book also blurs the distinction between programming paradigms, or between code and data. In short, I feel EMPOWERED: I can do everything, as long as I am careful enough.

Maybe this is why Lispers are generally better programmers than, says, Pythonians, or Java programmers, or (God forbids) Basic and Cobol programmer. Because their communities, their books, their programming languages tell them that, "hey, you CAN do it. Nothing is impossible, eh?", not, "NO, YOU ARE FORBIDDEN TO DO SUCH AND SUCH, YOU UNWORTHY, STUPID, UNDISCIPLINED CREATURES. THESE ARE THE ONLY THINGS YOU CAN DO."

By the way, I think I have discovered the secret agenda of Python and its community. Let me guess: take away the can-do spirit of the programmers, enslave them into some pre-defined ways of doing things, and jail them into the von Neumann architecture forever. What a noble cause!

You know, once upon the time, Computer Science is the best, the most optimistic, the funniest discipline to be in, since it is where we, humans, deal directly with our thoughts, and can do anything that we can think of, unlimitted by physical restrain. Now, look at this kind of languages, Python and its kindreds of Java and C# and C++ and (I highly suspect) Ruby, which seek to, um, "protect" the programmers, and render programmers no more than mere coders. How sad that is.


<edit: url munged by Perk>
« Last Edit: November 16, 2009, 01:36:01 PM by perkiset » Logged

No links in signatures please
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #1 on: November 16, 2009, 07:38:35 PM »

Problem is an expert makes a comment, and then people take it out of context, and programming languages become a religion.
Python has lots of warts on it, what language does not ?
Guido is not Jesus, or Mohamad, or Buddah.


When Guido made python he has these goals in mind.
1) A language that is fairly easy for non-programmers to pick up. So python has a very simple syntax, very few key words. But on the other hand he wanted a language that is powerful. (A contradiction, yet this goal has been met).
2) Ability to modify/program the language at runtime like you can with lisp. This is very important. I can fire up a python shell, (or even with jython or iron python) and start poking arround in the insides. This stops you from making throw away test proggies. So with iron python I could import the .net forms. Start creating forms at runtime. Scipy takes this one step further. You basically have a matlab in python. Very useful.
3) On the other hand you can go one step deeper. The meta classes, generators and decorators of python allow you to do this. The origional patch I make to pywebkitgtk was taken 1 step further by this fellow https://launchpad.net/pyjavascriptcore . Basically the class/objects are being created at run time.
4) Very easy to interface python with C/C++ or with DLLs. The above patch I made was actually written in cython (python compiled to C) and it interfacing with JS C Api in webkit. In 3 days I was able to make a module that allowed you full access to all JS objects from python. I think perks showed the work required to make a C module to PHP (not trashing PHP) python has this ability. As a result all C/C++ code (or just DLL) can be used from python. So all ur old code is not wasted.
The concept of being able to interface with C/C++ easily is very important from an optimization perspective. 5% of the code might take up 95% of ur computing time. Once you find the bottle neck, you can recode those parts in C/C++.

About the only thing python lacks from lisp/scheme is macros and lambda. Functional programming can be done in python (they just do not tell you that). A lot of the macro/lambda ability can be done with decorators and metaclasses. People for example will bitch about lack of switch statement in python. No need for that it can be done using jump tables etc.
So once u see what Guido's goals where in mind, then u see python has met all of these achievements. So that is why it is a very successful language.

Again right language for the job.
PHP works pretty good for doing web shit. But i get annoyed when PHP programmers (who are usually newbies) start talking about how great PHP is etc. It was designed for web, not for systems programming.

Erlang is a functional language. It was designed so the program never needs to be restarted. It has built in RPC etc. And it has 99.999999999% uptime. Basically erlang is a cloud language. Great for doing this shit. But i am not going to use erlang to make a throw away script to upload a bunch of files to my website.

Prolog is great from solving problems like magic square, the goat cabbage and fox problem. Solving logic problems. Prolog coders are a quiet logical bunch Smiley You never hear them saying stupid things like saying you should use prolog to program an operating system Smiley.

Lisp/Scheme power comes from programs that can interpret themselves. The macro system in lisp/scheme is amazing. Also you can get very small versions of scheme (chicken scheme) that can compile to C. Chicken Scheme is very fast. Also it is suitable for embedding. The chicken scheme version of scheme is very small. I think it is like 50K+ of scheme code that is basically scheme macros and makes a full blown compiler. I suspect that many large AI companies use lisp, but they just keep it secret because of the amazing power of lisp/scheme. Lisp programmers have a chip on their shoulder. Mainly because OO, JIT, VM all existed in lisp way back in 1960 and yet Java etc claims they are "new features". Also when AI went bust way back when, lisp was blamed as the fault which is 100% not true. Bottom line is how many programs need the ability to interpret/rewrite themselves. Very powerful, but not needed for most programs. Also co-routines in scheme are very interesting.

Basically python takes the best of all of the above, and attempts to make it work. It does a fairly good job on the whole.
I have looked at other languages like ruby etc. Not to say they are bad languages, but they do not do anything which python can not do and I am familiar with python.

Was looking for a book I had about advanced python programming techniques, but the name slipped my mind.
Mainwhile found this.
http://www.programmingforums.org/thread5951.html
Python is a language that is often underestimated, and often underused. Beneath its deceptively simple exterior, Python has some very powerful features that you may not be aware of. This post will introduce you to some of these less well known corners of the Python programming language.

Again it does not cover metaclasses and decorators which are very powerful. I am not an expert by any means in those things.
(You can hurt urself bad with them Smiley)

Anyway back to the article.
Anyway I have no idea what everyone is barking about.
Guido has said countless times that a lot of python was based on ideas from lisp and various other languages.
I have no idea what that guy you quoted is barking about being empowered.
Go make a python -  scheme bridge (i think there is one already out there). So u get best of both worlds Smiley
And now there is some sort of "secret agenda". Yah Guido plans to take over the world with his "python".
I kind of think you might be right about Guido not being a "great programmer", compared to Ian Bickering and guys like him probably true.
But one of the successes of python is Guido for the most part keeps a hands off policy. So people are able to improve the language etc.
A lot of founders have religous goals of some sorts or ego etc.
Guido does not have this, hence the exceptional growth of python, the amount of implementations (jython, iron python, green python etc).

Ruby after X years is still arguing about threads and a VM.
Perl has been talking about Perl 6 for years.
For python u have the http://psyco.sourceforge.net/ a JIT compiler for python.
Or ctypes which allows u to call shared libraries from python.
or cython.
Instead of arguing about BS like is it morally right or some crap, python coders get shit done.
Ctypes worked so well it has been incorporated into the python core.

In the last thread about the pystar case. I compared perks and apple to a hitler and the jews.
I am just trying to point out that every human has a bias.
Some asshole is probably going to do 1 of 2 things.
1) Assume I am some sort of neo-nazi and say that what a horrible person I am wanting to throw jews in ovens.
2) Say that I am some sort of liberal and don't want any law what so ever Smiley
Either way u lose, but u get a good laff in the meantime Smiley

 






Logged
daemon
n00b
*
Offline Offline

Posts: 3


View Profile
« Reply #2 on: November 17, 2009, 01:29:09 AM »

Thanks for your reply nop

I agree with you on the merits of python and I am pretty confident there isn't any big agenda behind python (actually i used python quite a lot before learning scheme), but for Guido to trash SICP saying that its underlying motivation is to make you write languages that interpret other languages only, was a little hard for me to digest.

I learnt a lot of things from SICP ,functional programming, data-driven programming and oop (mentioned as message passing) even though the book doesn't mention classes or OOP explicitly and I finally got what OOP was all about. Without SICP, it would have taken me atleast 10 books and many years to understand these concepts, let alone put them to use.

I'd read many books and wrote many programs but could'nt get why OOP was so great and all (I thought you could get the same reusability if you just wrote a library containing all your functions) until I read the book and in less than three pages the book tells you how if you have a variable that has local state, then you can gain a lot of modularity using OOP concepts.

The book also teaches that there isn't one fixed way of doing things and that if you don't like the way things are or the tools you use, you can always go and build your own. This was the biggest takeaway for me and I don't think any other book shows you that.

Anyway I just thought that some readers might not want to read SICP after reading that blog post, then go read the book after 5 or 10 years and regret that they hadn't read SICP earlier.



Logged

No links in signatures please
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #3 on: November 17, 2009, 01:38:35 AM »

@daemon
What version of scheme are u using ?
What are u using it for (if u do not mind me asking).

Scheme has its advantages, big thing about python is the huge ammount of libraries available for it.
Logged
daemon
n00b
*
Offline Offline

Posts: 3


View Profile
« Reply #4 on: November 17, 2009, 01:56:35 AM »

I'm using plt-scheme because its got a very good gui framework (something that all the other free scheme and lisp implementations lack), creates small and fast executables, and has reasonable number of libraries (nowhere near python but atleast enough for what I do).

I use scheme mainly for some GUI development stuff ( i'm a part-time isv), nothing all that deep. If I do well i'll probably just get a Lispworks license in the future.

The only thing plt-scheme or any good lisp implementation lacks is the number of available libraries and i'm sure they won't catch up with python anytime this century Smiley, and that doesn't bother me much because i'm learning C at college (its compulsory) so that i'll be able to write wrappers to C libraries.

« Last Edit: November 17, 2009, 01:59:25 AM by daemon » Logged

No links in signatures please
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!