/r/sicp

Photograph via snooOG

This is subreddit for studying SICP - Structure and Interpretation of Computer Programs - a well-known textbook for learning how to program.

Here you can participate in a joint SICP studying or ask any question. Feel free to contribute in any way you feel right.

/r/sicp

847 Subscribers

6

how much time does it takes to complete sicp ?

I had started sicp 2-3 weeks ago (again, as I failed to continue it the last time I tried). I am currently on 1.2.4, I feel like as I progress ahead, my pace is getting slower, like after few pages I cant do it, ps I get stuck in some of the exercises which really makes me feel dumb, how much time does it takes to complete this what is the normal pace ?

7 Comments
2024/10/24
10:31 UTC

4

Pair, Head and Tail in JS

Hi,

I am going through SICP JS edition and chapter 2 starts by talking about the primitive JS functions pair. head and tail as equivalents to the Lisp functions cons, car and cdr. My problem is that using both Node.js and my browser, these functions do not seem to be primitive JS functions. I'm getting a little baffled by it. Am I missing something?

1 Comment
2024/09/11
10:37 UTC

5

Berkeley CS61A low resolution is killing my eyes

I have started taking Brian Harvey's CS61A classes on YouTube but the low resolution on the text editor screen is killing my eyes. Is there a solution to that or an alternative?

0 Comments
2024/08/14
13:51 UTC

2

help with the lectures

i have completed the 2nd lecture

i am following the slides along with the actual book sicp

i feel like the lectures and slides and the book are following a different pace ...

can anyone tell me the right order to watch and read ... or am i rushing it ???

1 Comment
2024/07/16
07:11 UTC

2

Top-down iterative solution to 1.11

Most iterative solutions to 1.11 that I've found on the internet does a bottom up approach, the solution I came to was a top-down approach.

(define (f2 n)
  (define (f2-iter n a b c) 
    (if (= n 3)
        (+ (* 2 a) b) 
        (f2-iter (- n 1) (+ a b) (+ (* 2 a) c) (* 3 a))))
  (if (< n 3) n
      (f2-iter n 1 2 3))) 

Obviously I did some math to get to this code, but that's left as an exercise for the reader :p

0 Comments
2024/02/13
16:43 UTC

1

Solidify Understanding of Expression Evaluation

I just started reading SICP and exercise 1.4 threw me for a loop for a second.

So, when we have...

(define (mystery a b)

((if (> b 0) + -) a b))

and let's say that a = -7 and b = -10

after we start evaluating and end up with the combination of (- -7 -10)

It will first evaluate the -7 and -10, and then go to the operand to make it work like normal math?

(How I imagine it: (-7) - (-10) = (-7) + 10)

I think the prefix notation is confusing me, so I just wanted to make sure I'm understanding this completely.

THANKS

2 Comments
2024/01/31
22:50 UTC

10

Learning SICP 2024

Hi Everyone,Looking for people who are actively looking to learn about SICP book and the Video lectures.I have this time table to follow and also a discord group created.

Let us know if you are interested in it.

https://docs.google.com/spreadsheets/d/1_wsoCgaj1RIWTXprLmWDWxC27CFceq4eJY4ymefak88/edit?usp=sharing

Edit:
adding my Discord ID: vamsimadhavh

19 Comments
2024/01/03
17:17 UTC

9

Should i get SICP JS edition?

Hello, I wanted to get the original version but here only JS version is available locally. Should i wait, i don't know how long it might take? Or JS version is good too? I heard the mixed review about JS version saying how SICP was wrote with scheme in mind and such

4 Comments
2023/12/29
03:42 UTC

1

Eval-Apply

What is so special about the SICP eval-apply loop? What is so enlightening about it?

0 Comments
2023/10/31
08:54 UTC

6

Is it normal to look up a a lot of solutions?

I am in the middle of chapter 2. in the first chapter i sometimes had to look up solution’s to the exercises, but pretty much since the beginning of chapter to i constantly need solutions tio for the exercises to solve them completely. My ideas are right most of the time but I often need help with the coding part. Is this normal? Should i spend more time on finding solutions myself?

4 Comments
2023/09/25
15:20 UTC

11

Just wanted to post this great resource here

0 Comments
2023/09/06
22:12 UTC

4

Read Along MIT's Structure & Interpretation of Computer Programs

TL;DR: Seeking cs/math oriented penpal to read along SICP


Hey there, I'm a math student from the US looking for someone who'd wanna read along Structure and Interpretation of Computer Programs.

My programming experience is very new. I only just started doing real coding with golang this summer (as opposed to simple python scripts, matlab, and, god forbid, excel for school.) I also got really into linux and free software and vim and all the rest.

So why SICP?

I could just learn C or better linux ricing or even something like common lisp (I'll probably learn all three later on), but I miss all the math I used to do for fun.

I wanna read sicp cause I wanna learn more about recursion and general abstraction and other math/cs border topics that I don't get to explore enough in my code or in my particular math classes. This is a book written by mathematicians, so I'm hoping to get the same high from this as I get from a cool vector analysis class.

plus there's a wacky wizard next to a lambda on the cover.

Then why are you not just learning it yourself?

I have a real bad tendency to abandon cool projects I embark on cause I have no one to share my progress with. Learning with others and discussing discoveries is a real joy, and it's also way more embarrassing abandoning something and disappointing a friend.

What are you looking in a programming penpal?

My main hope is to find someone that has a similar kind of passion for the subject instead of some soulless javascript bootcamp so many people are chasing (nothing against js itself though.) Coding is cool, coding is fun, and wanting to feel clever is the best justification for learning in general.

Specifically, I wanna find one or two people that'd be interested in doing ~weekly calls to discuss readings and using git to share exercise with each other. That's the basic idea anyways.


If my perspective of finding insights and fun from learning resonates with you, send me a pm.

cool bye now B-)

1 Comment
2023/09/02
18:08 UTC

2

ETA of Completion?

How long do you think it would take someone to get through this book working a genuine 6 hours a day? With prior programming experience and a math major?

3 Comments
2023/07/06
03:12 UTC

0

Sicp status

Who knows about Sicp

1 Comment
2023/06/29
14:38 UTC

0

Sicp

1 Comment
2023/06/29
14:37 UTC

2

Exercise 1.3 Help

Hi, I've been trying to learn programming with SICP. I'm currently on exercise 1.3, which I've been really confused with because of my code outputting this error:

The error.

The code.

Here's the entirety of the code: Exercise 1.3 - Pastebin.com. It's not the best, but it's working when I use the definitions to get the individual largest and second largest numbers.

There are solutions on the Internet, but I want to understand how and why my solution doesn't work.

Any help will be appreciated. Cheers.

PS: I'm using DrRacket.

2 Comments
2023/05/28
09:10 UTC

3

What's the minimum math requirement to get the most out of this book?

I wanna read it but I fear I don't have enough math maturity to fully understand or even do the exercises in SICP. So, what's at least the minimum I can study to get the most out of the book? Because I don't want to spend months studying all Calculus and Proofs just to make it through the book. If at least I knew what Calculus problems or proofs methods to focus on I'd get through the book alive.

1 Comment
2023/04/25
03:08 UTC

6

anyone wanna be a study-buddy for this "magic" book?

9 Comments
2023/01/19
22:32 UTC

0 Comments
2022/11/23
05:46 UTC

3

Iterative vs recursive Processes

I just started The book and was wondering If I can distinguish Iterative vs recursive Processes simply by looking at where the funtion calls itself. Am I right in thinking that a recursive process calls itself inside an operand and a recursive Process calls itself as an outermost operator? example from the book:

(define (+ a b)

(if (= a 0) b (inc (+ (dec a) b))))

is a rercursive process because it calls itself in the operand for inc but

(define (+ a b)

(if (= a 0) b (+ (dec a) (inc b))))

is an Iterative process because it calls itself as an outermost operator.

Am I right in thinking this?

2 Comments
2022/11/20
05:02 UTC

2

Figure 3.1 Shows pointers to frames but says pointers to environments ???

Section 3.2 of 2d ed says "environments are sequences of frames," then says "each frame has a pointer to its enclosing environment." However, Figure 3.1 shows one environment, and pointers to frames within the environment. Caption says "C & D point to the same environment," but Figure clearly shows them pointing to the same frame. These contradictions leave me confused about how to write software for these structures. Anyone be so kind as to clear this up for me?

2 Comments
2022/11/09
15:29 UTC

2

A bug in chapter 5

Hey guys, If you did the compiler, didn't you find it odd that the generated instruction sequence for lambda bodies requires env register? Even though it modifies it long before accessing it. It so, it's probably a bug, but it does not affect anything since the way compiler handles proc application does not use preserving procedure. But it's possible to safely remove env register from the needed registers list.

(define (compile-lambda-body exp proc-entry)
 (let ((formals (lambda-parameters exp)))
  (append-instruction-sequences 
   (make-instruction-sequence
    '(env proc argl)
    '(env)
    `(,proc-entry
      (assign env (op compiled-procedure-env) (reg proc))
      (assign env (op extend-environment)
       (const ,formals) (reg argl) (reg env))))
   (compile-sequence (lambda-body exp) 'val 'return))))

Becomes

(define (compile-lambda-body exp proc-entry)
 (let ((formals (lambda-parameters exp)))
  (append-instruction-sequences 
   (make-instruction-sequence
    '(proc argl)      ;;; like this
    '(env)
    `(,proc-entry
      (assign env (op compiled-procedure-env) (reg proc))
      (assign env (op extend-environment)
       (const ,formals) (reg argl) (reg env))))
   (compile-sequence (lambda-body exp) 'val 'return))))
0 Comments
2022/09/01
06:19 UTC

4

Starting a new study group on Discord

At the moment we're planning to follow the MIT semester schedule at half pace (about 7 and a half months), doing both textbook problems and the MIT problem sets (though clearly some of the MIT problems are dependent on their computer environment and we'll skip what we can't do).

Here's the invite link. If the link doesn't work, feel free to PM. (Update: the owner of a larger server transferred ownership to me, now the invite leads to that server.)

1 Comment
2022/08/07
23:07 UTC

4

What mathematic topics I need to learn before going to SICP and Computer Science in general

So as the title said, I want to learn the math needed for computer science and to help me later on for other topics, so what I need to learn, I want you to assume that I have no background knowledge with math at all

( only how to sum and substract and divide and multiply )

I know there is a lot of subject that I learn in the high school but it's has been long time + hardly memorize any of it, add on that I wasn't give much attention for the classes

So I see this on OSSU

https://github.com/ossu/computer-science/blob/master/FAQ.md#how-can-i-review-the-math-prerequisites

any other topics I need to learn other that ?

also if you try any resources or someone try that before I'll be thankful for hearing about your experience and how you mange your time for it + how long did it take

also is it possible to study multiple topics simultaneously ?

4 Comments
2022/04/05
16:02 UTC

19

Completed chapter 1 and 2. So far so good.

I'm using the beautiful sarabander version.

I did all exercises, except for the ex.2.16 and ex.2.92 where the authors stated that the exercise was very hard.

I'm keeping a repo here.

Most exercises are very doable. The nice thing about a programming exercise is that you can keep at it until it works :-) I got ex.2.64 and 2.76 wrong because they were not programming exercises.

Doing all the exercises makes the individual exercises easier because there's often a logical progression between them. A given exercise will be much harder if you don't have the insight gained from the previous exercises.

Doing all the exercises was also essential for me to get a good enough grasp on the lisp functional programming concepts introduced so far. An earlier attempt at SICP, many years ago, failed because I was rushing it and I didn't understand the concepts well enough. I kept looking at the problems with my C/C++ hat on, and got frustrated.

You might learn a thing or two about math while going through the text, but you won't need more than high school math skills to be able to follow along. I enjoyed the math-y examples. I'd much rather learn about polynomial gcd computation through exercises than learn about cheese taxonomy or Goblin name generators.

I started in August last year. Slow but steady works for me. I'm alternating between SICP and learning FPGA programming. I'm hoping to combine the two projects someday.

I'm using Racket. I had to search a bit to find an implementation of 'put' and 'get', and I found out the hard way that '() is (was?) false in MIT Scheme and true in Racket, but no issues otherwise.

It's an amazing text. I know chapters 1 and 2 are just the beginning, but already I feel my mind stretching in ways it's not used to, which I enjoy deeply. If SICP is a five-course dinner, I just had an excellent appetizer! On to chapter 3!

4 Comments
2022/03/17
16:51 UTC

3

Study buddy or group

Hi guys and gals, I'm looking for a study buddy or group to go through the sicp book together.I saw someone posted a discord link but the link is dead now

1 Comment
2022/03/07
04:17 UTC

4

SICP: JavaScript Edition

3 Comments
2022/01/22
01:14 UTC

9

Looking for a buddy to study Structure and Interpretation of Computer Programs (that actually wants to be friends)

1 Comment
2022/01/16
20:44 UTC

Back To Top