SICP in JavaScript
sourceacademy.org
SICP in JavaScript
1–10 of 126 posts
Re: SICP in JavaScript
#2On my phone I just get a drawing of an alien spaceship? I tried loading it through an archive (and I do get the front page of a web book) but none of the links work there.
Re: SICP in JavaScript
#3I 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?
Re: SICP in JavaScript
#4On my phone I just get a drawing of an alien spaceship? I tried loading it through an archive (and I do get the front page of a web book) but none of the links work there.
it's supposed to redirect to https://sourceacademy.org/sicpjs/index
Re: SICP in JavaScript
#5On my phone I just get a drawing of an alien spaceship? I tried loading it through an archive (and I do get the front page of a web book) but none of the links work there.
seems to be some sort of loader, I got that but then it turned to the SICP in JavaScript cover - I did scroll so maybe it was the onScroll event.
Re: SICP in JavaScript
#6why
Re: SICP in JavaScript
#7I thought my hatred of Javascript was at its peak.
Re: SICP in JavaScript
#8It 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)
? make_sum(make_product(multiplier(exp),
deriv(multiplicand(exp),
variable)),
make_product(deriv(multiplier(exp),
variable),
multiplicand(exp)))
: error(exp, "unknown expression type -- deriv");
}
Here is the original code: (define (deriv exp var)
(cond ((number? exp) 0)
((variable? exp)
(if (same-variable? exp var) 1 0))
((sum? exp)
(make-sum (deriv (addend exp) var)
(deriv (augend exp) var)))
((product? exp)
(make-sum
(make-product (multiplier exp)
(deriv (multiplicand exp) var))
(make-product (deriv (multiplier exp) var)
(multiplicand exp))))
(else
(error "unknown expression type -- DERIV" exp))))Re: SICP in JavaScript
#9There is also the interactive version of SICP[0].
Re: SICP in JavaScript
#10Wasn’t JavaScript influenced by Modula-3?