Live data from Hacker News

Structure and Interpretation of Computer Programs – JavaScript Adaptation

sicp.comp.nus.edu.sg

141–150 of 188 posts

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#141
post #84

Earlier quoted context omitted.

There's a reason SICP isn't called Structure and Interpretation of Lisp Programs. Lisp is incidental.

There is a reason SICP uses Lisp.

There is. Scheme is a great pedagogical language. The book isn't _about_ Lisp though.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#142
post #75

Earlier quoted context omitted.

It's useful and practical and has a lot of work put into it so it can't really be called bad, but it doesn't really stack up to what native languages can provide at the high end, and never will (even if it can get pretty darn close). Though I acknowledge its immense utility, I feel like JS always tends to go for "good enough" solutions rather than "best in class" solutions. That is its own kind of quality, but there'…

For sure, if you have a shot at making a world class system you probably don’t want JS. But I’ve never been in a job where we had a shot at building a world class system. Maybe I just have bad luck, but at each place I have worked the problems in the codebase are obvious and the impediments are institutional not technical. There are hundreds of problems I could list in our current codebase that are causing slowdowns,…

The problem is that if the system was world class then it might actually be ok if it was in js. Most codebases are a bit of a mess, like you say, and js just makes it much harder to figure out what is going on. It's not just a dynamic language, it seems to encourage a gratuitously dynamic style. So you have to figure out everything in the debugger. That is if you can even determine where to set a breakpoint!

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#143
post #78

Earlier quoted context omitted.

> JS is a great language literally no one believes this

I like JS. I use JS daily. JS is part of the workflow for nearly everyone I know who works with code. For me, ES6 is fantastic to use. Some of the better books on JS [I'm thinking specifically of Haverbeke's "Eloquent Javascript"] are general computing classics in their own right. I used to be a snob about JS, due to the fact that in the 90s / early 2000s, it had major shortcomings and produced a lot of slow, crashy…

>JS daily. JS is part of the workflow for nearly everyone I know who works with code.

What about there being no choice when you want to do almost anything web related

WASM ain't mature yet.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#144

Earlier quoted context omitted.

I like JS. I use JS daily. JS is part of the workflow for nearly everyone I know who works with code. For me, ES6 is fantastic to use. Some of the better books on JS [I'm thinking specifically of Haverbeke's "Eloquent Javascript"] are general computing classics in their own right. I used to be a snob about JS, due to the fact that in the 90s / early 2000s, it had major shortcomings and produced a lot of slow, crashy…

>JS daily. JS is part of the workflow for nearly everyone I know who works with code. What about there being no choice when you want to do almost anything web related WASM ain't mature yet.

Are you pretending that there's not a fair amount of devs writing Node services?

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#145
post #75

Earlier quoted context omitted.

Typical dramatic Hacker News user. JS is a great language and enjoyed by millions of developers.

It's useful and practical and has a lot of work put into it so it can't really be called bad, but it doesn't really stack up to what native languages can provide at the high end, and never will (even if it can get pretty darn close). Though I acknowledge its immense utility, I feel like JS always tends to go for "good enough" solutions rather than "best in class" solutions. That is its own kind of quality, but there'…

Depends on what you mean by "the high end", but I agree with you overall

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#146

Earlier quoted context omitted.

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/

"Do you know enough lisp to write a self hosting interpreter in it?" Short answer: Yes. Long answer: No! I learned Lisp and TI-Scheme in the early 80s, and somewhere around then we did some SICP-like stuff in undergrad CS. I later came upon SICP and worked my way through it, having the usual "Aha!" moments. I thought I knew something about Lisp and Scheme at that point. I built some self-hosted interpreters using the…

Thank you for writing this up Reginald. I appreciate seeing the journey that someone such as yourself has taken in learning these ideas, and the perspective that it has imparted along the way.

"When we admit we know nothing, then we are free to think anything."

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#147
post #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 ada…

> The translation is pretty direct, so the data structures are more idiomatic to Scheme than they are to JavaScript. I think that's OK. I do wonder if it wouldn't be simpler to write a Scheme interpreter in JS (or take one of the undoubtedly existing ones) and make the book interactive with that. This version feels more like something that has added value if you already know JS, not so much when you're learning JS

> This version feels more like something that has added value if you already know JS, not so much when you're learning JS

Totally agreed, which I think is a strength of SICP. I know historically it was for learning computer science, but I've gotten so much out of reading it, despite not being a newcomer to the field.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#148
post #130

Earlier quoted context omitted.

Agreed. I'm pretty sick of the anti-JS kneejerk rhetoric that happens here. It adds zero value to any discussion. It's nothing more than a desperate attempt to gain some internet points. It's a popular language and it has flaws, but that doesn't automatically make it worthy of the amount of hate it receives here. This type of discussion has more in common with /r/iamverysmart than it does with valuable discourse that…

I do enjoy "Professor Frisby's Mostly Adequate Guide to Functional Programming", which uses JS examples extensively. Despite the fact my last job was mostly JS, I had to look up functions all the time and stretch my brain muscles. Modern JS is different than "keep it the same" JS. But... converting a book to a different programming language rubs me the wrong way. I miss an opportunity to see another language, too. It…

Adapting a book for another language doesn't really make you miss an opportunity, though, right? The original is still freely available for you to look at and see another language.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#149
post #138

Earlier quoted context omitted.

What an extremely weak criticism that has been played out. 1) Don't concatenate them in the first place 2) Use TypeScript Pro-tip, if the world is going JS and you don't get it, it's probably you. With JS (TypeScript) I can develop on every platform natively (React Native). I can compile to native code. (AssemblyScript). I'm not saying you can't do those things on other languages, but JS is becoming a powerhouse than…

> develop on every platform natively (React Native) If "native" means bundling a runtime and having your program pass serialized messages to a different thread where the actual native platform code lives, the same can be said for any language. You just need to build the wrappers for the native API – which is a lot of work but could be done for QBASIC running in DOSBox just as well as for JS running on V8.

Yes, but it hasn't been done for any other language.

Re: Structure and Interpretation of Computer Programs – JavaScript Adaptation

#150

Earlier quoted context omitted.

I like JS. I use JS daily. JS is part of the workflow for nearly everyone I know who works with code. For me, ES6 is fantastic to use. Some of the better books on JS [I'm thinking specifically of Haverbeke's "Eloquent Javascript"] are general computing classics in their own right. I used to be a snob about JS, due to the fact that in the 90s / early 2000s, it had major shortcomings and produced a lot of slow, crashy…

JS is a terrible language. The amount of pitfalls, language features you must avoid, and obscure paradigms you must follow to make JS usable is mind-boggling. Just because you can use JS well doesn't mean it's a good language.

Out of curiosity, what languages do you think are good ones?
Post reply on HN