Live data from Hacker News

SICP: JavaScript Edition available for pre-order

mitpress.mit.edu

41–50 of 123 posts

Re: SICP: JavaScript Edition available for pre-order

#41
post #22

Holy crap take a look at some of the JS examples in Chapter 4 - functions declaring functions declaring functions returning functions

I hate this style of coding. I don't see how it's any better than turning everything into data and code in encapsulated class objects and passing them around

It's handy sometimes, but I think it starts looking worse the further from Scheme you travel. Even in Common Lisp it's probably too far, but with a Lisp-1 you get some really pretty high-level abstractions. Of course I find I don't miss them very much, but they sure are fun.

Re: SICP: JavaScript Edition available for pre-order

#42
post #6

One major benefit here is how approachable this is. One could even simply open Dev Tools on their browser and use the console as a REPL. As someone who installed Scheme/Dr Scheme/Dr Racket long ago, it's nice to say, "you can get started right now". I know there'll be a lot of complaint about JS as a language choice but, it's pretty ubiquitous. And, much like Scheme, no one's saying, "you should use this for your nex…

This is the wrong kind of approachable, because you have to learn a ton of random web things before you do anything outside the repl and before your program can even process user input and then people struggle with those two concepts that would be trivial to them if they could be introduced earlier. Having seen what having javascript as a first language does to first year students I can't understand why this is consi…

Bringing the best education materials to the most widely used environment, and language doesn't seem very difficult to understand.

Nothing prohibits them from learning, "better" languages after you reach them, but first you have to reach them.

Re: SICP: JavaScript Edition available for pre-order

#43
post #10

I saw this the other day on Amazon while picking up the SICP instructor's edition. For the life of me, I can't figure out why they chose JavaScript to do this. And the new authors are professors . Since the original SICP has a permissive license, I've actually thought about doing something similar, but with a more modern functional language.

Yeah, imagine the craziness of making materials like this accessible to users of the most widely used language.

SCIP uses an amount of high-level functions that are frankly ridiculous outside of a very functional language. Hell, maybe even outside of a Lisp-1. That's not to say that Scheme is the best language (probably not in my top 5), but there are better languages than javascript for SCIP, and better programming methods than SCIP for javascript.

Re: SICP: JavaScript Edition available for pre-order

#44

Note to the unaware, both* this version and the classic (Scheme) version are Creative Commons-licensed and freely available online. (*edit: thanks to keithwinstein for enlightening me -- I wrongly thought it was just the one. The publisher's site doesn't advertise this at all!) https://sicp.sourceacademy.org/ (JS version) https://mitpress.mit.edu/sites/default/files/sicp/index.html (1984 classic)

I believe they are both CC-licensed. See https://sicp.sourceacademy.org/ A ton of work seems to have gone into this -- they have a meta-circular evaluator in JavaScript (and it's not that much longer than the original Scheme)!

Very respectfully disagree; but long or short, this looks really bad:

    list("sequence",
         list(list("constant_declaration",
                   list("name", "size"), list("literal", 2)),
              list("binary_operator_combination", "*",
                   list("literal", 5), list("name", "size"))))
https://sourceacademy.org/sicpjs/4.1.2 ("4.1.2 Metalinguistic Abstraction / Representing Components")

This isn't an ideal language for doing this stuff. The Scheme version is completely transparent about what you're doing; whereas this kind of language makes you work through a thick veil of abstractions.

(This line doesn't occur in the Scheme version, but the analog would be (quote (let ((size 2)) (* size 5))). Which would you rather debug?)

Re: SICP: JavaScript Edition available for pre-order

#45
post #10

I saw this the other day on Amazon while picking up the SICP instructor's edition. For the life of me, I can't figure out why they chose JavaScript to do this. And the new authors are professors . Since the original SICP has a permissive license, I've actually thought about doing something similar, but with a more modern functional language.

Yeah, imagine the craziness of making materials like this accessible to users of the most widely used language.

Because those people were born programming Javascript?

What is "accessible" in this context is purely a state and attitude of the intellect.

Re: SICP: JavaScript Edition available for pre-order

#48

Earlier quoted context omitted.

No, it's proof that you are already in hell.

I think hell is coded in Java

Hell, Heaven and Earth are written in Java. That is why most people are slow after waking up and why you need to sleep for garbage collection to run.

Re: SICP: JavaScript Edition available for pre-order

#49
I got a chance to talk to Hal Abelson and two things I found surprising where: 1) he thought part of SICPs success was due to the calibre of students MIT gets and 2) He though Javascript was a fairly good scheme approximation ( although with too much syntax).

Re: SICP: JavaScript Edition available for pre-order

#50

I have a copy of SICP right next to me, and it's one of my favorite computer science books. I'm not sure how I feel about this javascript edition though...

I was doing some Javascript coding today.

A

   false != x
test failed for a zero-valued x; had to make it !==. WTF? I never want false and 0 to be other than different objects.

Almost every twist and turn in this language is an imbecillic clusterfuck.

I had one instance of a if (foo.bar = 0) typo; no warning from the implementation. Why do we want stupid C mistakes in a higher level language, without the C fixes for them?

   list.forEach(function (item, i) {
     ...
   });
makes my eyes bleed. JavasSript borrows the syntax of languages geared toward a form of computing at which JavaScript is poorly suited for; when you're combining functions together, it looks like dog's breakfast.

To get a value out of a switch statement, you have to wrap it in a function that is immediately called?

   function () {
     switch (WTF) {
     }
   }();
the switch statement has the idiotic break with fallthrough found in C.

One redeeming feature: A || B || C ... works a lot like (or A B C ...).

Unfortunately, this is required for the simple task of incrementing a nonexistent dictionary key from zero:

    dict[key] = (dict[key] || 0) + 1;
this calls for two dictionary key lookups. You want this sort of thing in a single operation.

Oops! In the following, j isn't lexical:

    for (let i = 0, j = 0; ....
I copy and pasted something like this from a StackOveflow answer into a recursive function and spotted that the j in a recursed frame was messing with the j in outer frames, there just being one j.

What is "function scope" and why even have something so idiotic? Just let, or GTFO! C has function scope for goto labels, that's it; why introduce something like that.

Appending together Lists has functional semantics, like Lisp:

   a.concatenate(b)  // new thing is returned, a stays the same, so you must do a = a.concatenate(b).
But

   a.push(b)         // mutates a in place.
Here is a shitshow, curently with a fitting number of upvotes: 666.

https://stackoverflow.com/questions/881085/count-the-number-...

I accidentally wrote

   if (foo.bar.indexOf[key] 
code was silently skipped even though foo.bar is an empty list. No diagnostic, nothing. Oh, indexOf is a function, which is an object. Every damned object is a dictionary with properties you can access as strings with square bracket indexing, and that is always safe: it yields undefined if the property is not found.
Post reply on HN