/r/sicp
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.
Structure and Interpretation of Computer Programs is arguably one of the best textbook for learning programming. Here we discuss and study it.
Video lectures:
/r/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 ?
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?
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?
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 ???
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
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
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
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
What is so special about the SICP eval-apply loop? What is so enlightening about it?
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?
code_report's incredible playlist: https://www.youtube.com/playlist?list=PLVFrD1dmDdvdvWFK8brOVNL7bKHpE-9w0
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-)
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?
Who knows about Sicp
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:
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.
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.
Let's look back at some memorable moments and interesting insights from last year.
Your top 10 posts:
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?
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?
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))))
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.)
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 ?
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!
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