News for hackers. Stuff that matters.
Re:Why MIT switched from Scheme to Python by trjordan on Tuesday March 24, 2009 @03:34PM (#530659)
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.

Re:Why MIT switched from Scheme to Python by jules on Tuesday March 24, 2009 @04:17PM (#530736)
> 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!

Re:Why MIT switched from Scheme to Python by sharkbrainguy on Tuesday March 24, 2009 @08:16PM (#531145)

  def 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

Re:Why MIT switched from Scheme to Python by jules on Wednesday March 25, 2009 @08:30AM (#531724)
The 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.

Re:Why MIT switched from Scheme to Python by scott_s on Wednesday March 25, 2009 @09:59AM (#531811)
Keep in mind this is a freshmen level course. You don't have to - and shouldn't - cram every important CS concept into an intro course.
Re:Why MIT switched from Scheme to Python by jules on Wednesday March 25, 2009 @06:09PM (#532518)
I agree. And this course probably is a lot better than the course I got (C++, ugh). That may be the reason I'm biased...
Re:Why MIT switched from Scheme to Python by silentbicycle on Tuesday March 24, 2009 @09:19PM (#531221)
It'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.)

Re:Why MIT switched from Scheme to Python by Kaizyn on Wednesday March 25, 2009 @07:28PM (#532631)
Your 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
Re:Why MIT switched from Scheme to Python by danprager on Wednesday March 25, 2009 @07:49PM (#532654)
They do work; they just don't integrate with the built-in types: Why should they?

Try instead:

  car(cons(1,2)) 
    -> 1

  cdr(cons(1,2)) 
    -> 2

  car(cons('a', cons(2, 3))) 
    -> 'a'
Re:Why MIT switched from Scheme to Python by maggie on Tuesday March 24, 2009 @04:31PM (#530755)
You 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.
Re:Why MIT switched from Scheme to Python by abstractbill on Tuesday March 24, 2009 @04:54PM (#530810)
But the above examples are taken straight from SICP. Wasn't that the textbook for 6.001 before they switched to Python?
Re:Why MIT switched from Scheme to Python by jerf on Tuesday March 24, 2009 @05:09PM (#530842)
Which 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.

Re:Why MIT switched from Scheme to Python by abstractbill on Tuesday March 24, 2009 @05:24PM (#530875)
Yeah, 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?

Re:Why MIT switched from Scheme to Python by bk on Tuesday March 24, 2009 @05:37PM (#530900)
> 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?

If it leads to more (non-CS) students taking a programming class, I'd call it a big win. Other fields can benefit greatly from programming skills. I'd almost go as far as calling it a new form of literacy.

Re:Why MIT switched from Scheme to Python by irrelative on Tuesday March 24, 2009 @07:27PM (#531070)
Absolutely I'd call it a new form of literacy. The most impressive applications of computer science always happen outside the realm of computer science disciplines.
Re:Why MIT switched from Scheme to Python by jjames on Tuesday March 24, 2009 @05:33PM (#530892)
"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?"

6.001 from my experience does not in any way imply a student's focus on computer programming or software development. I've heard horror stories about people in completely unrelated majors ending up in that class and having their brains thoroughly melted. In my personal opinion, Python will be considerably more humane in that department.

Re:Why MIT switched from Scheme to Python by wheels on Tuesday March 24, 2009 @07:39PM (#531089)
There are probably a lot of physics, math and engineering students taking intro to programming that haven't written a line of code before.

I'd assume most, if not all, computer science students have, but there's still a difference from learning to bang out some code in high school that does neat things, vs. starting back at the beginning and approaching it as, well, computer science.

The way my university covered it was doing Pascal for the intro courses (this was the mid-90s) and then in third-semester "Programming Languages" we worked mostly in Scheme implementing language fundamentals. That seemed to be a reasonable balance.

Re:Why MIT switched from Scheme to Python by Kaizyn on Wednesday March 25, 2009 @07:22PM (#532625)
6.001 presumed the students had prior exposure to college physics and calculus mathematics. If your son has this level of foundational knowledge, then SICP probably would be the most efficient way to bring someone up to speed on programming. If they have not attained that level of education, then this isn't the best intro point to computer science. Predicate logic and set theory is probably a better starting point. Or if you're feeling particularly cruel, Java. :-)
Re:Why MIT switched from Scheme to Python by stcredzero on Tuesday March 24, 2009 @04:42PM (#530782)
My 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

Re:Why MIT switched from Scheme to Python by tlb on Tuesday March 24, 2009 @05:11PM (#530845)
I 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.

Re:Why MIT switched from Scheme to Python by mattjones on Tuesday March 24, 2009 @07:32PM (#531079)
Libraries aren't the issue. I use Chicken Scheme for a few things, which has plenty of libraries and a fantastic package system called eggs. Sure, other languages like Perl and Python have more libraries now, but that's not what made them popular.

What made them popular was the design of the core languages. I started using Ruby because it was faster to type and easier to remember how to do things than Perl, not because it had more libraries, which it didn't.

The problem with Scheme is that the core language isn't terse enough, and so it gives the impression that it will be hard to do things. And that's correct. Scheme requires much more typing and is harder to remember than Ruby.

Consider:

Ruby:

  h = {}
  h[:foo] = "hi"
  h[:foo] #=> "hi"
  h[:bar] #=> nil
Scheme (Chicken):

  (define h (make-hash-table))
  (hash-table-set! h 'foo "hi")
  (hash-table-ref h 'foo) ;; "hi"
  (hash-table-ref/default h 'bar #f) ;; #f
That, in a nutshell, is why people don't use Scheme. The people who made Perl etc. popular hate typing, and the core language of Scheme forces you to type a ton. There are other problems like really slow string functions, things that should be core being in SRFIs, libraries being called "SRFI 18" rather than normal things like "threads" so that it's extra hard to tell where a function is coming from, where its documentation is, or what you have to import to get it. Lack of libraries (if indeed that's a problem for you) is downstream of the core problem, which is that Scheme has a lot of clumsy design features that discourage would-be library writers from using the language a lot.

This isn't a Lisp problem, it's a Scheme one. A Lisp with a better core and enough users would get lots of libraries eventually, just like any language.

I think Scheme is good for teaching though, and would rather learn it in a course than Python.

Re:Why MIT switched from Scheme to Python by jimbokun on Wednesday March 25, 2009 @10:06AM (#531816)
Clojure:

    user> (def h {:foo "hi"})
    #'user/h
    user> (h :foo)
    "hi"
    user> (h :bar)
    nil
The main difference with the Ruby is the immutable by default data structure, which is why I replaced the assignment with a literal definition of the map. In any case, I think this demonstrates how Clojure has stolen some of the good ideas from Ruby and Python in addition to stealing many of the best ideas from other Lisps.
Re:Why MIT switched from Scheme to Python by mattjones on Wednesday March 25, 2009 @10:56AM (#531877)
That is a great demonstration that Scheme's problems are not Lisp problems. I'm hoping that we're about to see a lot more experimentation with new Lisp dialects.
Re:Why MIT switched from Scheme to Python by smallpaul on Tuesday March 24, 2009 @10:50PM (#531312)
> Libraries aren't the issue

You say libraries aren't the issue, but the discussion is about a blog pst that said: "And why Python, then? Well, said Sussman, it probably just had a library already implemented for the robotics interface, that was all."

I'm sure your experience is grounded in a general reality. But the post you disagreed with was about a specific case: i.e. the one described in the blog post.

Re:Why MIT switched from Scheme to Python by mattjones on Wednesday March 25, 2009 @10:47AM (#531869)
From the point of view of a person at an instant in time, libraries are a concern. But when we're talking about Scheme being displaced by Python at MIT, where Scheme was developed 30 years ago, we really ought to ask what's been happening to Scheme during that 30 years.

The problem, at MIT and elsewhere, is that hackers don't like hacking Scheme enough. Python has more libraries than Scheme now, but that's not the main thing that made more people use it. People use it because they prefer the language. This is something that Sussman and others at MIT should be trying to understand, but it doesn't strike me that they are trying to understand it. They're just saying "Python has a better robotics library -- oh well!" as if this were something completely random that they have no control over. That doesn't seem like the sort of attitude that produced Scheme in the first place.

My point of contention with the comment I replied to is the idea that fixing the problem is a question of writing more libraries for Scheme. Writing or interfacing to libraries for numerics, 3D graphics, etc. is a trivial task compared to making a language hackers love.

Now, maybe hackers' distaste for Scheme is Scheme's fault, or maybe it's hackers'; but in any case, the issue is with the core language, not the libraries. And based on my personal experience with Scheme I would say that enough of the fault lies on Scheme's side that it's worth fixing.

Re:Why MIT switched from Scheme to Python by asciilifeform on Wednesday March 25, 2009 @01:27PM (#532109)
The prospect of Scheme as a potential mainstream programming language went down with the rest of the Lisp ship in the late-1980s AI winter - the same one that sank Symbolics and anyone who was remotely Lisp-guilty by association.

It is no accident that it survived almost exclusively in non-saltmine sanctuaries like MIT, where industry herdthink held less sway. In the linked article, Sussman directly admits that he is unable or unwilling to fight back against the intellectual decay that has consumed non-academic programming.

He has decided to "go with the flow" - namely, the flow of industrial sewage into students' heads.

Re:Why MIT switched from Scheme to Python by sadfsa on Sunday May 03, 2009 @07:05PM (#591517)
Ease of programming isn't the issue, at least not when it comes to writing libraries that must interface with C code (as a robot-interfacing library is likely to). Most Schemes and Lisps can interface to C by means of a few simple declarations, while Python requires the C code to accept and return Python's internal data structures (and convert them to a form that can be used by C code), and requires it to register those functions that are to be made visible to Python.

Scheme (PLT)

  (require scheme/foreign)
  (unsafe!)
  (define my-c-lib (ffi-lib "libmylib")) ;; loads libmylib.so
  (define my-c-func (get-ffi-obj 'my_c_func my-c-lib (_fun _long -> _long)))
  ;; The C code does not need to take Scheme into account--
  ;; Existing C libraries can be interfaced with Scheme
  ;; with a trivial amount of effort.
C (to be linked against Python code-- Python can load the resulting shared library as if it was written in Python). Notice that all this code does is interface Linux's htonl function to Python:

  #include <Python.h>
  #include <netinet/in.h>
    
  static PyObject *
  py_htonl(PyObject *self, PyObject *args) {
     long my_arg;
 
     if(!PyArgParseTuple(args, "l", &my_arg))
         return NULL;
     return PyBuildValue("l", htonl(my_arg));
  }
  
  static PyMethodDef methods[] = {
      {"htonl", py_htonl, METH_VARARGS,
       "Demonstrate Python's C interface\n"}
  };
  
  static char module_doc[] = "Demonstration";  
  
  PyMODINIT_FUNC
  initfunc(void) {
    PyInitModule3("mylib", methods, module_doc);
  }
Re:Why MIT switched from Scheme to Python by silentbicycle on Tuesday March 24, 2009 @06:43PM (#530994)
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.

Thank you. Cannot stress this enough. (Making said libraries portable helps, too!)

Re:Why MIT switched from Scheme to Python by palish on Tuesday March 24, 2009 @06:19PM (#530964)
Just 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.
Re:Why MIT switched from Scheme to Python by tlb on Tuesday March 24, 2009 @06:38PM (#530989)
Yes, 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

Re:Why MIT switched from Scheme to Python by palish on Tuesday March 24, 2009 @06:54PM (#531014)
Nice. Yeah, the GL graphics code is pretty easy to convert to C++ when performance matters. It's wonderful to quickly prototype graphics code in Python with full error checking.

Also, if you haven't used it yet, check out Py++. It takes a lot of the pain out of hand-authoring a Boost.Python code file. I'm using Py++ to automatically generate Boost.Python bindings for the C++ library FCollada. (FCollada is a library for accessing 3D modeling data exported into the .dae COLLADA format.)

Thanks for the tip about Cairo.

Also, glVertex3d, 3dv, 3f, etc are part of the standard GL API. The 'd' suffix indicates 'double', 'f' indicates 'float', 'i' indicates 'int', 's' indicates 'short', and the 'v' suffix indicates that the function accepts a pointer rather than 3 separate components passed by value. Of course, the glVertex* API has been deprecated because VBOs are far more efficient.

Just curious again, why do you use OpenGL for Anybots? Do you create simulations before building new robot prototypes?

Re:Why MIT switched from Scheme to Python by tlb on Tuesday March 24, 2009 @07:09PM (#531038)
My point was there's no single 'gl.Vertex3' call that takes native Lisp numbers. Thinking about double/float/int/short should be abstracted out below the Lisp level.

We use OpenGL to show real-time renderings of the robot, derived from the gyros and joint angle sensors. We have an analysis tool that shows, either in real time or post-run analysis, renderings synchronized with high-speed video of the robot and scrolling strip charts of every important variable over time. I always see much more looking at slow-motion videos & renderings afterwards than looking at the real robot.

OpenGL rendering also turned out to be useful for extracting data from CAD models. Our CAD software (SolidWorks) can export STL files (a list of polygons) and we need to extract center of mass and moment of inertia and such. Doing that without visualizing it is a nightmare.

We have done dynamics simulations (using ODE), but they haven't had much predictive value.

Re:Why MIT switched from Scheme to Python by palish on Tuesday March 24, 2009 @07:31PM (#531076)
Ah. Very cool.

Are you computing center of mass / moment of inertia yourself, or using a 3rd party library to do it? PhysX is free, and I believe it can do those calculations for you fairly automatically. (In PhysX, a 'scene' is composed of 'actors', and each actor is described by a set of shape descriptors. A shape descriptor can represent a box, a sphere, a capsule, a convex hull, etc. So a laptop actor could crudely be approximated with two box shape descriptors (one for the screen, one for the body) connected by a joint. Given those shape descriptors, the library calculates the actor's center of mass / moment of inertia / etc. If your CAD software simply exports a list of polygons, you'll need to decompose those into a set of convex hulls using convex hull decomposition techniques: http://codesuppository.blogspot.com/2006/04/approximate-conv... ) You also might have better luck running dynamics simulations with PhysX than with ODE. It comes with a large number of code examples to get you started: http://developer.nvidia.com/object/physx_downloads.html

Re:Why MIT switched from Scheme to Python by tlb on Tuesday March 24, 2009 @08:21PM (#531148)
I use a very simple and exact O(N) algorithm to calculate mass properties of polyhedrons without computing convex hulls or anything:

http://www.cs.berkeley.edu/~jfc/mirtich/massProps.html

Maybe 80 LOC. I'm not sure why anything more complex is needed.

PhysX does seem promising.

Re:Why MIT switched from Scheme to Python by palish on Tuesday March 24, 2009 @09:07PM (#531208)
Yeah, that works. I mentioned computing convex hulls because I wasn't sure whether your CAD program exports "manifold" meshes, that is, closed polygonal meshes where each edge is connected to exactly two faces. When a mesh is manifold, it is possible to compute whether a point in space lies within or outside of the mesh, for example. It is also possible to compute the mesh's mass properties. In the video game industry, artists create models with techniques that are much less precise than CAD techniques, and so non-manifold meshes are very common, which makes them difficult to analyze in physical ways. The solution to that problem is to decompose the mesh into a set of convex hulls, then analyze the convex hulls.

The other reason I mentioned convex hull computation is because PhysX can only simulate dynamic actors that are composed of boxes, spheres, capsules, and convex hulls, IIRC. Arbitrary polygon meshes aren't supported for dynamic actors, because they are very difficult to simulate in realtime. So if you wanted to use PhysX for dynamics simulations, you would probably need to decompose your model into a set of convex hulls.

Good luck -- if you need any assistance with PhysX, feel free to contact me at [email protected].

Re:Why MIT switched from Scheme to Python by danbmil99 on Thursday March 26, 2009 @05:15AM (#533215)
"You also might have better luck running dynamics simulations with PhysX than with ODE." I worked on the simulator at Anybots, and I'm pretty much convinced a different physics engine isn't going to magically make things better (in terms of using simulations to predict real robot behavior). The problem is more about getting every little physical detail of the actual robot -- and its interactions with the environment -- into the model. The particulars of how collision, joint constraints, and dynamics are numerically computed isn't what makes the problem really hard.
Re:Why MIT switched from Scheme to Python by palish on Thursday March 26, 2009 @09:27AM (#533409)
Yeah, after giving it some thought, it would be very tough to repurpose a realtime physics simulator like PhysX or ODE to be useful to Anybots. But that doesn't necessarily mean that it isn't practical to create a simulator suited for rapid prototyping of robots.

(I'm just brainstorming ideas in the rest of this post; I'm not sure whether they'll work, but it's a fun problem to think about.)

Perhaps it would be useful to write your own simulator that incorporates data about how the components of the robot behave in the real world, to get a more accurate simulation. By that I mean, the problem is that the robot model has so much complexity that it's difficult to simulate accurately. So instead of creating a mathematical model for how a compressed-air actuator behaves, for example, gather real-world data about how it actually behaves in the robot, then incorporate that data into the simulator. I mean, if the robot is walking slowly on a flat surface, then its individual components behave in the same ways each time the robot takes a step forward, right? Therefore it seems like the behavior of the whole robot can be reproduced and predicted in a simulator, since the behavior of each component is known (under controlled conditions, like when the robot is walking slowly). Brute force the problem by using large amounts of real-world data, is what I'm getting at.

Re:Why MIT switched from Scheme to Python by danbmil99 on Sunday March 29, 2009 @02:28AM (#537171)
It's not that PhysX or ODE aren't good enough, it's that they only solve part of the problem. We did do some empirical analysis to get the pneumatic models.

"Brute force the problem by using large amounts of real-world data, is what I'm getting at."

Absolutely, that is Trevor's viewpoint, and I agree. Turns out to be somewhat difficult in practice. It's hard to even know what all the parameters should be, much less do all the work necessary to tune them. And all the while, the robot itself is changing. Joints get loose; servos get replaced. It's a constant battle.

There is a feeling among hard-core robotics folks that this level of simulation is either impossible or not worth the trouble. I tend to disagree. I think we got pretty far with the Anybots simulator; we did manage to evolve a neural network that balances on the simulator, and also balances the real robot. It's definitely a 'hard' problem to get a simulator good enough to be usefully predictive.

Re:Why MIT switched from Scheme to Python by anthonyb on Tuesday March 24, 2009 @07:00PM (#531023)
For Python, there are also a number of game libraries around which you might be able to repurpose. Pyglet, Pygame and PyOgre are three which spring to mind.

Depending on exactly what you're trying to do, of course...

Re:Why MIT switched from Scheme to Python by drawkbox on Tuesday March 24, 2009 @09:03PM (#531199)
Panda3D, developed by Disney and given to CMU for research. One real MMO built off of it, Pirates of the Caribbean.
Re:Why MIT switched from Scheme to Python by stcredzero on Wednesday March 25, 2009 @01:09AM (#531446)
Panda3D is quite good. It has many basic building blocks for 3D games. When I used it, docs were ok but a bit sparse in places, but you could deduce much from what was auto-generated.
Re:Why MIT switched from Scheme to Python by pg on Tuesday March 24, 2009 @05:25PM (#530879)
When it's not a code word for that it's often a code word for something bad. Not always, but often.

People defending what's right can say one should do it because it's right. But people defending something they know is basically wrong can't say one should do it because it's wrong. So they look around for another word, and "practical" is usually the first they find.

Re:Why MIT switched from Scheme to Python by tlb on Tuesday March 24, 2009 @06:28PM (#530975)
In this particular case of Gerry Sussman choosing Python over Scheme, I don't think he's using "practical" to mean "I know it's wrong, but I'm comfortable with Java so Python seems more familiar".

I think "practical" often means choosing your battles. Sussman's choosing to fight the battle of explaining some syntax to his students rather than the battle of implementing a real-time robot control library from scratch in a language where no implementation supports real-time very well. Sun-Tzu would approve.

Re:Why MIT switched from Scheme to Python by dhess on Wednesday March 25, 2009 @01:44AM (#531490)
I was fortunate enough to attend this ILC session last night. Some people here are reading way too much into what Gerry Sussman said. I don't think Lispers should castigate Gerry for MIT's decision to use Python in its new introductory EECS curriculum, nor should Pythonistas praise him for giving in to "practical" concerns.

It's not evident from Andy Wingo's blog post, but just to clarify, Gerry didn't choose Python over Scheme: a committee did. Gerry said that when they had their revelation about the state of computer programming in 1997, he and Hal Abelson decided to stop teaching 6.001, and they eventually stepped away from the course altogether. (I believe Gerry returned to teach the class for the final term it was offered, but he didn't get into that last night; I could be wrong.)

Gerry went on to say that 6.001 essentially languished until sometime around 2007, when a committee got together and redesigned the introductory EECS curriculum to be what is now 6.0[012]. He didn't say whether he was on that committee, but I got the impression he was not. He appeared to be speculating when he offered the reason why Python was chosen. It was an offhand remark, something to the effect of (and I'm paraphrasing here), "And why Python? I suppose there were already good libraries for controlling these robots."

It sounded like Gerry explicitly chose not to fight any battles at all on this issue, and simply walked away resigned to the fact that computer programming, and engineering in general, are much different now than they were when he, Hal and Julie wrote SICP.

Two more things:

* I don't recall Gerry using the word "practical" even once while reciting his short anecdote.

* Gerry continues to teach with Scheme, not Python, in 6.945, his advanced topics course.

Re:Why MIT switched from Scheme to Python by sayrer on Wednesday March 25, 2009 @03:26AM (#531588)
It sounds like a healthy attitude. It's not like Scheme and Python are radically different languages.
Re:Why MIT switched from Scheme to Python by pg on Wednesday March 25, 2009 @11:38AM (#531922)
Yeah, sure, I'm not saying it is in this case. Just that it's one of those words to watch for.
Re:Why MIT switched from Scheme to Python by smallpaul on Tuesday March 24, 2009 @10:47PM (#531310)
We're talking about the user interface to computational machines. There is no abstract "right" or "wrong" and no context-insensitive "practical" or "impractical."

He wanted to do a course about robots, and according to him, the interface to the robots was Python, which was otherwise an adequate language.

If you want to make a case to the contrary, it should be rooted in the specifics of the situation.

Re:Why MIT switched from Scheme to Python by danbmil99 on Thursday March 26, 2009 @05:20AM (#533218)

    (define (deriv f)
       (define (f-prime x)
         (/ (- (f (+ x dx)) (f x))
            dx))
       f-prime)
jeez, I wish it was easy to do that in Python. Python's main limitation, IMSHO, is lack of homoiconicity. Yes, I said it!
Re:Why MIT switched from Scheme to Python by sharkbrainguy on Thursday March 26, 2009 @06:03AM (#533248)
I hate to be the guy who's always saying the same thing but, that is easy in python.

  dx = 0.00001

  def deriv(f):
      return lambda x: \
             (f(x + dx) - f(x))/dx


  In [11]: def cube(x):
     ....:     return x*x*x
     ....: 

  In [12]: deriv(cube)(5)
  Out[12]: 75.000149996640175
I'd also so that most (high school) educated people find infix easier to read than prefix, so isn't the homoiconicity a detriment to readability in this example (and any involving mid sized arithmetic expressions).

I love scheme (alot more than I do python), but the only example that seems "impossible" to do is to implement a large subset of <language> in <language>.

You could obviously implement, a scheme-ish lisp in python, but there are alot of advantages to the host and guest languages being similar (or so that berkley professor would have me believe) that you would miss out on.

(You would also need a scheme expression reader in python... which I'm just itching to write now ... )

the example is from sicp: http://tinyurl.com/cubk49

Re:Why MIT switched from Scheme to Python by danbmil99 on Thursday March 26, 2009 @05:49AM (#533234)
actually, you can do it pretty easily with lambda... but it's just not the same somehow. You can't (in the general case) use Python to generate Python, except at the text level.
Re:Why MIT switched from Scheme to Python by sethg on Tuesday March 24, 2009 @08:27PM (#531158)
I'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.
Re:Why MIT switched from Scheme to Python by wheels on Wednesday March 25, 2009 @12:46AM (#531430)
I'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.

Re:Why MIT switched from Scheme to Python by brlewis on Tuesday March 24, 2009 @05:10PM (#530843)
Another 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.