Earlier quoted context omitted.
> So then astronomy is about telescopes...? No? I never said that. SICP teaches concepts, those concepts are better understood with lisp. Astronomy teaches concepts, those concepts are better understood with telescopes. In neither case is the subject about the tool, it's just better understood with the tool.
I just really think you should be ready to accept the full force of your words: >Same thing here -- SICP just isn't the same if it's not in scheme or lisp. That straight up reads like SICP and lisp are inseparable and that exactly means that SICP is not as general as people claim. What we have here is unstoppable force meets immovable object (otherwise known as a contradiction). The resolution is simple: either SICP…
SICP in JavaScript
101–110 of 126 posts
Re: SICP in JavaScript
#102Earlier quoted context omitted.
It’s calculating the derivative. 0 and 1 aren’t used for their truthiness, but as values. d/dx x becomes 1 and d/dx y becomes 0 (the two cases, same variable and different variable).
JavaScript will coerc the types. 1+1 and true+true both = 2
Re: SICP in JavaScript
#103Earlier quoted context omitted.
I think SICP would be just peachy in Elixir, but I’m coming around to the notion that keeping functional programming for functional programmers is a form of professional neglect. Functional core, imperative wrapper is one of the few sane ways to build a large (Conway’s Law afflicted) system, and too many of my peers never studies SICP in school. They don’t even know the damage they do, and as we’ve learned in many, m…
Scheme is not a functional programming language. The last 2/3rds of sicp are possible only because you can mutate state.
Re: SICP in JavaScript
#104I might be wrong, but I feel like writing SCIP on JS is like "Sustainable Energy using Oil." Not quite the right analogy... JS isn't as bad as Oil. But you get the idea... Kinda... don't make sense?
>writing SCIP ... Then you should probably SCIP SCIP.
Re: SICP in JavaScript
#105It seems like they have attempted to write scheme using JavaScript syntax to avoid having to make any significant changes to the non-code sections of the book. Here is an excerpt, it's not good: function deriv(exp, variable) { return is_number(exp) ? 0 : is_variable(exp) ? is_same_variable(exp, variable) ? 1 : 0 : is_sum(exp) ? make_sum(deriv(addend(exp), variable), deriv(augend(exp), variable)) : is_product(exp) ? m…
The tragedy of JS if blocks being statements not expressions is made explicit here
Code example below, `cond` is an example in their tutorial: https://www.sweetjs.org/doc/tutorial.html#sweet-cond
let realTypeof = cond {
case x === null: 'null'
case Array.isArray(x): 'array'
case typeof x === 'object': 'object'
default: typeof x
}
Discussed in 2017 on HN: https://news.ycombinator.com/item?id=14695495Re: SICP in JavaScript
#106Earlier quoted context omitted.
>writing SCIP ... Then you should probably SCIP SCIP.
Did you mean to say "SCIP SICP"? :-D
To be more precise, as Thomson and Thompson (of Tintin comics) would say, I meant it as a double irony on the GP's misspelling or typo.
Re: SICP in JavaScript
#107Re: SICP in JavaScript
#108Earlier quoted context omitted.
Did you mean to say "SCIP SICP"? :-D
No. I say what I mean, and I mean what I say, like that quote by (maybe) the Mad Hatter in Alice in Wonderland :) To be more precise, as Thomson and Thompson (of Tintin comics) would say, I meant it as a double irony on the GP's misspelling or typo.
SICP(SICP)
;-)
Only the math and Lisp / Scheme cognoscenti will get that one.
Re: SICP in JavaScript
#109Earlier quoted context omitted.
I just really think you should be ready to accept the full force of your words: >Same thing here -- SICP just isn't the same if it's not in scheme or lisp. That straight up reads like SICP and lisp are inseparable and that exactly means that SICP is not as general as people claim. What we have here is unstoppable force meets immovable object (otherwise known as a contradiction). The resolution is simple: either SICP…
Oh come on, would you reckon that SICP would be just as good in Assembly? Just because computation is substrate independent doesn't mean our brains don't care about the form computational concepts are expressed in.
Re: SICP in JavaScript
#110It seems like they have attempted to write scheme using JavaScript syntax to avoid having to make any significant changes to the non-code sections of the book. Here is an excerpt, it's not good: function deriv(exp, variable) { return is_number(exp) ? 0 : is_variable(exp) ? is_same_variable(exp, variable) ? 1 : 0 : is_sum(exp) ? make_sum(deriv(addend(exp), variable), deriv(augend(exp), variable)) : is_product(exp) ? m…
Uh oh. That's like the original Numerical Recipes in C. All the arrays had their first value as 1, instead of 0. It was a conversion from FORTRAN, where arrays really did start at 1. The Numerical Recipes authors provided an array allocator which generated an address offset before the beginning of the array to make that work. It was awful. I rewrote the algorithms I needed with sane layout. The whole point of SCIP wa…
I found the most helpful part of SICP is the chapter 4, but to call it mathematical is a bit like to say "everything is foundamentally math"...