Questions tagged [sicp]

SICP is the book Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman with Julie Sussman and published by the MIT Press.

Quoting the wikipedia page:

Structure and Interpretation of Computer Programs (SICP) is a textbook published in 1984 about general computer programming concepts from MIT Press written by Massachusetts Institute of Technology (MIT) professors Harold Abelson and Gerald Jay Sussman, with Julie Sussman. It was formerly used as the textbook of MIT introductory programming class and at other schools.

Using a dialect of the Lisp programming language known as Scheme, the book explains core computer science concepts, including abstraction, recursion, interpreters and metalinguistic abstraction, and teaches modular programming.

The book is available online, with accompanying video lectures.

660 questions
11
votes
2 answers

Is there a Scheme interpreter that uses Normal-order evaluation?

I've been slowly working my way though the exercises in Structure and Interpretation of Computer Programs. Section 1.1.5 talks about applicative vs. normal-order evaluation, and the topic has come up several times in the text afterward. Since the…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
11
votes
2 answers

seek for some explanation on SICP exercise 1.5

The question can be found here. In the book, I found one description of normal order evaluation was: "An alternative evaluation model would not evaluate the operands until their values were needed. Instead it would first substitute operand…
Javran
  • 3,394
  • 2
  • 23
  • 40
11
votes
1 answer

Lexical vs dynamic scoping in terms of SICP's Environment Model of Evaluation

In Section 3.2.2 of SICP the execution of the following piece of code (define (square x) (* x x)) (define (sum-of-squares x y) (+ (square x) (square y))) (define (f a) (sum-of-squares (+ a 1) (* a 2))) (f 5) is explained in terms of this…
ddk
  • 1,813
  • 1
  • 15
  • 18
11
votes
2 answers

Managing state - chapter 3 of SICP

I've been working through in Structure and Interpretation of Computer Programs and completing the exercises in Haskell. The first two chapters were fine (code at github) but Chapter 3 is making me think harder. It starts by talking about managing…
Chris Taylor
  • 46,912
  • 15
  • 110
  • 154
10
votes
2 answers

Why does average damping magically speed up the convergence of fixed-point calculators?

I'm reading through SICP, and the authors brush over the technique of average damping in computing the fixed points of functions. I understand that it's necessary in certain cases, ie square roots in order to damp out the oscillation of the function…
afkbowflexin
  • 4,029
  • 2
  • 37
  • 61
10
votes
12 answers

Concepts that surprised you when you read SICP?

SICP - "Structure and Interpretation of Computer Programs" Explanation for the same would be nice Can some one explain about Metalinguistic Abstraction
yesraaj
  • 46,370
  • 69
  • 194
  • 251
10
votes
1 answer

What the heck is the "Structure and Interpretation of Computer Programs" cover drawing about?

What the heck is the Structure and Interpretation of Computer Programs cover drawing about? I mean I know what "eval", "apply", and 'λ' all mean, but I'm having a hard time deciphering the rest of the picture. Who the heck is the maiden? Does she…
Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
10
votes
1 answer

SICP recursive process vs iterative process: using a recursive procedure to generate an iterative process

in SICP Section 1.2.1 The author giving such a code example below to show how to using iterative process to solve the factorial problem: (define (factorial n) (fact-iter 1 1 n)) (define (fact-iter product counter max-count) (if (> counter…
zuozuo
  • 376
  • 2
  • 7
9
votes
6 answers

Structure and Interpretation of Computer Programs, what level of maths ability is required?

I regrettably haven't studied mathematics since I was 16 (GCSE level), I'm now a 27 year old C# developer. Would it be a fruitless exercise trying to work through Structure and Interpretation of Computer Programs (SICP)? What kind of mathematics…
handles
  • 7,639
  • 17
  • 63
  • 85
9
votes
2 answers

How do you write an MIT Scheme macro to return a lambda form?

I'm baffled by trying to create the equivalent of this trivial (in Common Lisp) macro in MIT Scheme: (defmacro funcify (exp) `(lambda (x) ,exp)) This is for a simple personal project, a numerical equation solver based on the functions built in…
Bogatyr
  • 19,255
  • 7
  • 59
  • 72
9
votes
7 answers

I want to implement a scheme interpreter for studying SICP

I'm reading the book Structure and Interpretation of Computer Programs, and I'd like to code a scheme interpreter gradually. Do you knows the implementation of the scheme most easy to read (and short)? I will make a JavaScript in C.
freddiefujiwara
  • 57,041
  • 28
  • 76
  • 106
9
votes
2 answers

Run SICP Scheme files like fast-failing tests

After a few years of programming it seems time to finally attack SICP. However, instead of editing and running everything in Emacs, I'd rather use a different editor and a simple makefile to run all the exercises. This doesn't seem to be entirely…
l0b0
  • 55,365
  • 30
  • 138
  • 223
9
votes
1 answer

Scheme, SICP, R5RS, why is delay not a special form?

This is concerning chapter 3.5 from SICP, in which streams are being discussed. The idea is that: (cons-stream 1 (display 'hey)) Should not evaluate the second part of the cons-stream, so it should not print “hey”. This does happen, I get the…
KnowsLittle
  • 1,197
  • 2
  • 13
  • 20
9
votes
1 answer

Short explanation of last two chapters of SICP

Can anybody give me a clear and concise explanation of the last 2 chapters of SICP(structure and interpretation of computer programs), ch4 meta-linguistic abstraction and ch5 computing with register machines? I'd also like to know if(and how) these…
ToToMakings
  • 91
  • 1
  • 3
9
votes
4 answers

What are data structures at the lowest level?

I recetly watched a SICP lecture in which Sussman demonstrated how it was possible to implement Scheme's cons car and cdr using nothing but procudures. It went something like this: (define (cons x y) (lambda (m) (m x y))) (define (car z) (z…
1 2
3
43 44