Live data from Hacker News

Structure and Interpretation of Computer Programs – JavaScript Adaptation

sicp.comp.nus.edu.sg

51–60 of 188 posts

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#51
post #42

Earlier quoted context omitted.

Why? Why does a textbook about fundamental principles need to be 'adapted' to technology currently in use in industry? The Feynman Lectures uses an example of a screw jack with 10 threads per inch, and a 20" lever. Should we update this to a name brand screw jack with 8 or 16 threads per inch, and an 18" breaker bar, because those are common in industry today? Be sure to extend the introduction of that chapter to inc…

> Why? Why does a textbook about fundamental principles need to be 'adapted' to technology currently in use in industry? Because it's widely used in the industry.

Why does that matter? You are not going to get paid to work through the SICP exercises on a job. Rather, you are going to use the things you learned through SICP on a job. Like deciding when JavaScript is the right tool and when it isn't.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#52
post #49

Every now and then a great movie comes out. Then it gets its American remake. It's been proven you can put Al Pacino, Robert de Niro and Bruce Willis in any movie (with predictable results!). This is the book equivalent of an American remake for me. Is Javascript the new pseudocode? Honestly I'd rather be forced to learn a new language to understand a book than to read the book adapted to JS.

There is a simple explanation of course. You are not the intended audience. Ditto for the blockbusters you mentioned.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#53
post #42

Earlier quoted context omitted.

Were you going to let the rest of us mere mortals in on the reason? I think it's good to offer a version of SICP adapted to a language that's used today very prominently and is relevant to many current jobs in the industry.

Why? Why does a textbook about fundamental principles need to be 'adapted' to technology currently in use in industry? The Feynman Lectures uses an example of a screw jack with 10 threads per inch, and a 20" lever. Should we update this to a name brand screw jack with 8 or 16 threads per inch, and an 18" breaker bar, because those are common in industry today? Be sure to extend the introduction of that chapter to inc…

> The Feynman Lectures uses an example of a screw jack with 10 threads per inch, and a 20" lever

Well, it would certainly help to change the examples to proper SI units.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#54

Earlier quoted context omitted.

Of course SICP is brilliant in Scheme. But hello? There is no such thing as a “blub language.” Your comment misrepresents the entire point of the original PG essay! The point is that givens some fictional language called “Blub” for the sake of the essay, some programmers believe that their language has everything that could possibly be useful, productive, expressive, &c. But PG’s contention that languages exist on a…

Simple question: do you know enough lisp to write a self hosting interpreter in it? People talk up their language until they learn lisp then this happens: https://www.draketo.de/proj/py2guile/

As a C developer: while I could probably do that given a few months, I've somehow managed 25 years without needing to interpret C? It's cool and all, but in terms of product requirements tends not to be high on the list?

Most languages are vulnerable to contexts where their particular gimmick doesn't work. You probably wouldn't write an interrupt handler in Lisp. You wouldn't write a bootloader in it either (although you might choose Forth, the other fanatic minimalist language). Conversely C gives you no runtime dynamism. Endless people try to write language-to-Verilog converters and are disappointed.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#55
What an interesting and ambitious project! Of course the first thing I did was skim the Metacircular Interpreter section to see how they handled the additional syntactic complexity. They gloss over the "parse" function, which is probably the best one can do. That the Scheme function "read" could be implemented by a novice is one of the advantages of using Scheme for SICP and it wouldn't be reasonable to expect an adaptation like this to reproduce the exact experience. I do think it's great the way SICP leads people through doing powerful things with a programming language, and then shows them that they themselves could implement the language they've been using. It gives a powerful feeling of control in an environment (computer programming) that can otherwise be intimidating. I think this adaptation does almost the same thing.

The translation is pretty direct, so the data structures are more idiomatic to Scheme than they are to JavaScript. I think that's OK.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#56
post #3

There's kind of a reason why SICP was written in Scheme in mind and not a blub language...

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.” ― Bjarne Stroustrup

Assuming Stroustrup is the authority on programming languages.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#57
post #40
post #3

There's kind of a reason why SICP was written in Scheme in mind and not a blub language...

Hal Abelson thinks that javascript is Today's Scheme. That is is carrying the flame of the ideas of Scheme forward.

Since JS isn't homoiconic, that's pretty hard to believe.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#58
post #53
post #42

Earlier quoted context omitted.

Why? Why does a textbook about fundamental principles need to be 'adapted' to technology currently in use in industry? The Feynman Lectures uses an example of a screw jack with 10 threads per inch, and a 20" lever. Should we update this to a name brand screw jack with 8 or 16 threads per inch, and an 18" breaker bar, because those are common in industry today? Be sure to extend the introduction of that chapter to inc…

> The Feynman Lectures uses an example of a screw jack with 10 threads per inch, and a 20" lever Well, it would certainly help to change the examples to proper SI units.

In America, at least, that's still not what we use in industry. So the top response to my comment is a proposal to make this classic American book even less practical here!

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#60
post #40

Earlier quoted context omitted.

Hal Abelson thinks that javascript is Today's Scheme. That is is carrying the flame of the ideas of Scheme forward.

What's your source for that? Not that I doubt you, I just can't find any record of him saying that.

https://corecursive.com/039-hal-abelson-sicp/ - about 21-22 mins in
Post reply on HN