7 ms·
I think there's something else here, implicit in Sussman's comment, that's important. MIT was founded on a philosophy of practicality, and everything else is se
by trjordan 18y ago
I think there's something else here, implicit in Sussman's comment, that's important. MIT was founded on a philosophy of practicality, and everything else is secondary. If you couple that with the belief that fundamental computer science is the most efficient way to enhance practical software engineering, Scheme was a wonderful choice. Java and C++ may have been more directly practical to software engineers, but they are not good for the field or people pushing the limits of the field - you spent too much time mucking around with their paradigms and idiosyncrasies.
Python (and, frankly, a number of the scripting languages-turned-mainstream) combines this clarity of computer science with a practicality that Scheme never had. If you can convey 95% of the basic ideas in Python, and you can also open the door to learning how to deal with 3rd party code, you'd be a fool not to. It was never about programming purity anyway, so there's no reason to mourn the passing of Scheme. It's progress.
- jules 18y ago> If you can convey 95% of the basic ideas in Python But you cannot. Some of the ideas in SICP can nearly be conveyed in Python (like lexical scoping, closures, data types, streams). You'll use built-in language features in Python (classes, generators) instead of implementing the functionality. I think that implementing these things is important if you want to really understand them. An example, cons, car and cdr from nothing at all: (define (cons a b) (lambda (f) (f a b))) (define (car p) (p (lambda (a b) a))) (define (cdr p) (p (lambda (a b) b))) You can do this in Python in theory, but you can't throw this into a Python course. Other ideas, like interpreters, require a lot of effort. Try writing a metacircular interpreter!
- sharkbrainguy 18y agodef cons(a, b): return lambda f: f(a, b) def car(p): return p(lambda a,b: a) def cdr(p): return p(lambda a,b: b) As well as in theory you can do this in practice. It's about as elegant (hard for me to judge as I have a strong pro-lisp bias). Aside from lack of tail safety and performance issues with writing scheme-ish code I don't see why you couldn't implement those things in Python. The main difference is that typically in a real world situation you wouldn't because there's a library or a language feature
- silentbicycle 18y agoIt's also counterbalanced by there being an obviously standard, reasonably portable distribution of Python. You go to Python.org, and there it is. It took me a while to find a Lisp that I liked, and it certainly wasn't a decision I was prepared to make while I was still trying to learn the basics. (I eventually settled on Chicken Scheme.)
- jules 18y agoThe problem is not that you can't do this in Python, but that this is out of place in a Python course (you don't use linked lists in Python, for example). SICP shows that you need only a very small number of primitives to get a full programming language. You don't get this elegance with Python. This may not be important if you teach programming to people who want use programming languages, but it is important for people who want to advance the state of the art in programming (i.e. CS students). Maybe it's better if you teach Scheme in a seperate class class for CS students.
- Kaizyn 18y agoYour definitions do not work. foo = (1,2,3) bar = (4,5,6) print cons(foo, bar) print car(foo) console output: <function <lambda> at 0x00B3F430> Traceback (most recent call last): File "./test.py", line 14, in <module> print car(foo) File "./test.py", line 5, in car return p(lambda a,b: a) TypeError: 'tuple' object is not callable
- maggie 18y agoYou need to remember that 6.001 is an /introductory/ programming course. Presumably most of the people taking it at MIT have done some codework before : ] but an intro. course is an intro. course. The question of what language to use is a pedagogical one, not a question of thoroughness.
- abstractbill 18y agoBut the above examples are taken straight from SICP. Wasn't that the textbook for 6.001 before they switched to Python?
- jerf 18y agoWhich sort of wanders back around to begging the question; is that still the best way to start teaching, as Sussman talks about? I ask myself, "how would I teach my son to program?", and for all my copious academic and practical experience, "start with re-implementing car and cdr from lambda functions" isn't even remotely in the running. Sure, I'd introduce such things earlier than most people and SICP is still firmly in the running, but for that to be an introduction in the general case? Not so sure. There's definitely an argument to be made that robotics is in many ways a much more realistic starting point. While some people may find the idea that we should actually start out by making a case to the students that their major is cool and important and gives them the ability to affect things in the real world vaguely repulsive, I'd say that it's an idea at least worth considering. The student that can leap from lambda, car, and cdr, to realizing that right in the introductory course is so exceptional that you're not going to hold them back anyhow.
- abstractbill 18y agoYeah, I think I actually agree with the overall point. I got my first experience of programming using BASIC to get various Sinclair computers to paint stuff on the screen and make funny beeping noises. I'm all for instant gratification. On the other hand that was when I was 9. By 12 I was learning Lisp, and by college age I'd written my own little Lisp compiler. I've always had this image of MIT students that doesn't quite mesh with them needing a gentle introduction to programming, but maybe that's not really the case?
- newt0311 18y agoUm... Yes you can. Here is your above example: >>> def cons(a, b): ... def lm(f): ... return f(a, b) ... return lm ... >>> def car(cns): ... return cns(lambda a, b: a) ... >>> def cdr(cns): ... return cns(lambda a, b: b) ... >>> x = cons(1, 2) >>> car(x) 1 >>> cdr(x) 2 Most scheme code translates relatively cleanly into python code. The biggest problem in translation comes when code wants to modify variables in a closure. Since SICP is primarily concerned with functional programming, this is a non-issue. Furthermore, Python 3.0 includes the nonlocal statement which fixes this problem (details here: http://www.python.org/dev/peps/pep-3104/ http://www.python.org/dev/peps/pep-3104/). Python is not lisp but its pretty darn close and unlike lisp (or scheme in this case), it has a well designed, well tested standard library -- something extremely important in programming languages today. In light of this information, MIT's decision to move to Python is justified.
- stcredzero 18y agoMy concern is that "practicality" is often just a code word for "resembles Java or whatever else I was comfortable with so I can continue on doing what I've always done before." (With the result that the student learns less than if they were required to do something truly different.) Reminds me of this post that came up on HN not too long ago: http://funcall.blogspot.com/2009/03/not-lisp-again.html http://funcall.blogspot.com/2009/03/not-lisp-again.html
- tlb 18y agoI think here, "practicality" means "has a library for controlling robots". Also a good numeric library, a good matlab-like graphing library, good 3D graphics, good real-time performance, easy C++ embedding, etc. Rather than complaining about how everyone else is a bonehead for not using Lisp, write some libraries to make it useful for more things in the real world. Also, Python does pretty well for real-time control. At Anybots we use it to run walking balance feedback loops at 100 Hz in the same process as a GUI and logging and it never misses a tick. PLT Scheme (used on HN) frequently pauses for 10+ seconds to GC. While there are theoretical concurrent GC systems for Lisp, none of them seem usable in real implementations.
- palish 18y agoJust curious, which library are you referring to when you say "good 3D graphics"? I'm writing a graphics engine using PyOpenGL, but that's just a minimalist wrapper over the standard OpenGL API that's available for dozens of languages.
- tlb 18y agoYes, I use PyOpenGL in GTK (with GTKGLExt). People have said good things about Gazebo, but I haven't used it. Most of the 3D stuff is performance-critical, so I typically prototype in Python and then convert to C++, which for graphics code isn't too painful. The Boost.Python interface makes it pretty easy. Also, the Cairo graphics interface is wonderful for drawing charts, animated robot stick figures, and many other visualizations. It has a full Postscript rendering model with alpha blending. It looks like PLT Scheme has an OpenGL binding too, though I haven't seen it used. It looks very low-level, for instance it has separate methods named: gl.Vertex3d gl.Vertex3dv gl.Vertex3f gl.Vertex3fv gl.Vertex3i gl.Vertex3iv gl.Vertex3s gl.Vertex3sv
- brlewis 18y agoAnother good argument for not mourning the passing of Scheme is that it isn't dead. You just used it when you posted your comment. HN is implemented in Arc which is implemented in Scheme.
- sethg 18y agoI'm wondering if pressure on MIT to develop demonstrable practical skills in underclassmen has increased since (classic) 6.001 was introduced. I mean, if you're smart enough to get into MIT in the first place and you learn Scheme as a sophomore and CLU as a junior, then by the time you graduate and look for a job, you should be able to get up to speed pretty quickly in Java or C++ or whatever the flavor of the month is. But if you're looking for work in the summer between your sophomore and junior year, the employers don't want you to spend two weeks out of a two-month internship learning the syntax of an industry-standard language.
- wheels 18y agoI've not found a college on the planet that graduates good programmers. It's something you have to learn from experience, and a college curriculum simply include enough large coding projects for people to become good. I regularly run across code in recommendations stuff written by Ivy League post docs and most of it's pretty bad, even if the ideas it implements are smart. I think that realizing that universities can't effectively teach programming should be at the root of choosing which programming languages are used in computer science instruction. In college you get loaded up with the right concepts that will later facilitate you as a programmer, and I think languages chosen should be languages that are geared to that end. Perhaps the most instructive thing I've seen for student programmers, and which pays to boot, is Google's Summer of Code. That throws students in with a bunch of brutally honest and usually seasoned hackers and makes them fare for their own for a summer.