Live data from Hacker News

Why MIT switched from Scheme to Python

wisdomandwonder.com

111–120 of 140 posts

Re: Why MIT switched from Scheme to Python

#111
post #3

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…

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

    (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

#112

It it just me who is seeing a cowardly surrender to cultural decay here? From the renowned Sussman, no less. The glorious MIT of the 1980s and prior appears to be dead. Erased, in fact, without a trace. Consider the following: http://mitpress.mit.edu/catalog/browse/browse.asp?btype=2 These are the latest releases from MIT press. Among them you will find nothing remotely like SICP, but plenty of postmodernist/related…

"You have to do basic science on your libraries to see how they work, trying out different inputs and seeing how the code reacts." Is this not an atrocity, to be fought to the last bullet?"

I think it's an acceptance of reality. There is a phase change when systems become too complex for a single human to ever understand them in their entirety. Dealing with systems at that level is a different beast than dealing with simpler systems where "what you see is all there is".

"What creativity can there be when your medium is shit mixed with sawdust?"

The same sort of creativity artists possess, who work with media that are idiosyncratic. It's a different mindset. I see the reddit-gen programmers talk about things on a completely meta-level. To them, MySql is the hardware. Is it a bad thing? Not necessarily. Some of them hopefully will dig down the stack and be the low-level heroes. But that should (and probably can) only be a small percentage.

Now I guess one could argue that those sorts of heroes are what MIT is supposed to produce, but as has been mentioned, this course is not just for CS students. So the real question is, can the CS heroes of tomorrow survive an introductory course in Python? Well, consider that they have probably been modding games since 10, hacking PhP at 12, realizing at 14 they need to learn a 'real' language (C#, Ruby, Python), by 15 I bet they've abstracted out the fact that languages are not all that important; they're just the tip of the iceberg of complexity.

So yes, I think they will survive.

Re: Why MIT switched from Scheme to Python

#113
post #71
post #33

Earlier quoted context omitted.

People often say that Java has great libraries, but is it true? AWT is crufty and ugly. Maybe there are impressive XML parsers (Xerxes is 188,000 lines of Java!), but I don't want those. Numerical libraries seem bad. So what is the library that might convince me to use Java for something?

http://freshmeat.net/tags/java-libraries I'm not saying they are all are high quality, or relevant to your task, or that there are no C++ or Python equivalents - just that there is a high quantity of Java projects. Why not have a quick search? Maybe there is a project there that will convince you. AWT is about the most prejudiced example imaginable - it was rushed out, disowned by its authors, and quickly replaced. I…

"AWT is about the most prejudiced example imaginable - it was rushed out, disowned by its authors, and quickly replaced."

Ahh yes -- replaced with Swing. Do I need to spell it out?

Re: Why MIT switched from Scheme to Python

#114

Earlier quoted context omitted.

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

(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!

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

#115

Earlier quoted context omitted.

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

(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!

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 in .

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

#116
post #70

Earlier quoted context omitted.

Why can't we keep the indents and drop the parens?

{} means object [] means array So you would not be able to just drop them, since they mean two different things.

for associative arrays foo: bar, for non-associative foo, bar,

surely this is unambiguous?

    x:
      y: "a",
      z: "23",
      q: 54,
         32,
         45
    ,
    r: 43

Re: Why MIT switched from Scheme to Python

#117
post #103

Earlier quoted context omitted.

lucene

Which is a clone of a Common Lisp search engine ;-)

This took me quite a bit of googling to "confirm" so I thought I'd save the next guy some trouble.

Lucene is sort of Doug Cutting's Java version of Text Database (TDB), which he and Jan Pedersen developed at Xerox PARC, and which, to complete the circle, was written in Common Lisp (see "An Object-Oriented Architecture for Text Retrieval").

http://code.google.com/p/montezuma/

Re: Why MIT switched from Scheme to Python

#118
post #44

Earlier quoted context omitted.

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 crude…

"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…

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

#119

Earlier quoted context omitted.

In my current project, I've implemented a source-to-source compiler. In the places where I emit C code, I usually don't have a handle to the scopes above me. I could get one, but it would take more work. The code I generate has no indents and no newlines. Not having to keep track of these makes life simpler. To make my generated code more legible, I just run indent on it.

I've written C code emitters too. FWIW, I've found nicely-indented output templates help to keep the source code of the emitter clear (and with no need to get at the enclosing scopes). But the question you raised was whether indentation-only was harder to generate, and I'd say no, because code.replace('\n', '\n ') is as simple as '{' + code + '}', if slightly slower.

And my point was that with the transformations I generate, I don't just say '{' + code + '}'. I'm applying transformations to existing code, not generating all of my own code from scratch.

Again, I see no point in making efforts to generate clean looking code when utilities like indent exist.

Re: Why MIT switched from Scheme to Python

#120
post #103

Earlier quoted context omitted.

Which is a clone of a Common Lisp search engine ;-)

This took me quite a bit of googling to "confirm" so I thought I'd save the next guy some trouble. Lucene is sort of Doug Cutting's Java version of Text Database (TDB), which he and Jan Pedersen developed at Xerox PARC, and which, to complete the circle, was written in Common Lisp (see "An Object-Oriented Architecture for Text Retrieval"). http://code.google.com/p/montezuma/

Please put newlines in the above, or don't put the two spaces in.
Post reply on HN