Hello everyone, OP here. This is my first Show HN post.
I guess most of you should know what SICP is. I took a class where it was used as a textbook (only the first 3 chapters, unfortunately) and loved it.
Most of the syntax-highlighted code fragments can be clicked on and edited. Either click somewhere else after that or press ctrl-enter to re-evaluate the scheme code. There are also some auto-graded exercises which involve writing code, as well as some multiple-choice questions (inspired by coursera)
So far only the first section is up. I don't think I can finish converting the whole of SICP to this format, so any help is much appreciated! I've tried to make the API as short as I can, but still able to run arbitrary code (eg for auto-graders). The main code is in isicp/coding.js and the content is stored in chapter-specific html files. All this is done via client-side javascript. I used biwascheme for the scheme interpreter and codemirror for the editor.
Open to suggestions? Since we're using Scheme, it would be nice to have the hierarchy of parentheses rainbow-highlighted when you hover an expression with the mouse, much like what is done at http://wiki.call-cc.org/chicken-for-php-programmers
I think there's a typo in example 1.5: "In normal-order evaluation, (p) is not evaluated because predicate of if evaluates to false". The 'false' should be 'true'.
One reason it was possible to choose SICP was the license (Creative Commons), which I think is pretty rare for a text of this quality. If I could I'd do the same for K&R.
Great job, over the past week i have been doing an interactive implementation of SICP picture language, and have a working prototype to play around, check it out here: http://rquintas.net/picture-language/
SICP is an advanced text, and using it to teach amateurs how to program is, probably, a mistake.
Brian Harvey have done a great job to simplify and make it more freshman-friendly. I think his CS61A is the best intro course available (but I don't think that the sentence ADT is a such great idea, and it make things little messier, not more clear).
The HtDP2 approach is also remarkable, but problem is it is part of Racket promotion (word dr.racket is used hundred times in the first chapter). The idea to make changes in a program visible, via using graphical primitive functions is brilliant, but controversial one - it is too soon (but it kicks and makes a progress visible)
I think that functions with multiple arguments, first-class "citizens" (values has a type, everything is a pointer), pairs, lists, then generic functions and environments must be taught first, and visualized interactively, similar to that python tool. Then, after, you can teach parts from HtDP and then SICP.
People who really enjoyed this initiation will go through whole books themselves.)
I can't say how "amateurs" maps to MIT freshmen, but I wanted to point out that back in the day SICP was used, in its entirety, in 6.001, the one-semester entry-level computer science course at MIT.
I'm currently doing SICP with Harvey and to be honest after list and cons in general are introduced I wish the course would abandon sentences altogether.
I agree. I'm doing the same course and because I couldn't get their implementation of Scheme(ucb-scheme) to work, I'm really out-of-sync with the course.
Are you taking 61as, the self-paced version? I was under the impression they were either already using, or planning to switch to, a JavaScript Scheme implementation to ease just this sort of problem.
I know one of he people who is running 61as, and I believe he wants to move as much as possible into the browser. In fact, they might even use a JavaScript-based Emacs clone instead of Emacs proper next time.
I think using the browser should make setting up the environment much easier than using some old, unsupported Scheme implementation!
I'll need to check out the Javascript based implementation sometime. But it is really annoying that the course is using something that hasn't been updated in ages.
In that case, I think that's what they're going to be working on over winter break for the next iteration of the class. At the very least, I'm sure it's a possiblity; there's obviously no guarantee that it is practical or will get done.
I think it's a good idea, personally. It could also make many of the assignments more interactive.
Are you having trouble because you're running a different platform that they developed their implementation on?
If so my way of dealing with this when I'm too lazy to deal with trying to get stuff to work on another system, is to using something like Virtual Box and work on the exact OS the library/language I want to work with was made for.
No, I'm using Linux(Arch) so I guess I am on an intended platform. It is on the user contributed repos but the installation didn't work. I tried installing just stk-scheme too but that didn't work either.
I've done some of the picture exercises from Concrete Abstractions. They were quite fun but significantly harder than assignments which didn't tax my spatial perception skills.
I just checked, MIT holds the copyright for HtDP, so an interactive version like this isn't possible.
Good initiative. I wish it was done in clojure/clojurescript, would have been great. But still its a nice way to learn.
One suggestion. Add paredit mode to balance the parens.
Without paredit mode one has to worry about balancing the parens and its a painful experience. It's like coding in notepad.
Looks great! Looking forward to more chapters :)
I can't imagine a Clojure SICP really working. The whole idea of SICP is to take a super-simple language and learn to build your own data-structure, psuedo-languages, and clarify how expressions, structures, etc. we use everyday are used, created, and implemented.
I really wish people wouldn't look at Clojure and think that it is the same as Scheme, especially the flavor presented in SICP, because it isn't. They're two entirely different languages and conflating the two as the same because OMG Parenthesis is like saying Python and Ruby are the same because they are categorized as scripting languages.
Clojure and Scheme attempt to solve very different issues. Scheme does a wonderful job in the sphere allocated in SICP. SICP could theoretically be taught with Clojure, but one must wonder why it hasn't been fully attempted yet. I think that once you try out Clojure, you would see the glove doesn't fit very well, so to speak. The main issue is that SICP is extremely fast and ideally, you'd want a language that takes a day to sort of learn and understand. Clojure certainly does not have this advantage. Clojure has many built-in structures. If you did do SICP in Clojure, you'd effectively be using a Scheme without cons, car, and cdr and using a Clojure without map, filter, etc etc etc. What's the point of that?
Yeah, I do agree that the simplicity of scheme helps. It really is a good teaching language. That said, courses are starting to adapt SICP to different languages (MIT and UCB use python, while my own university, NUS, uses javascript: http://www.comp.nus.edu.sg/~cs1101s/ - there's an interactive SICP in javascript there, too)
I think a clojure interactive textbook of this sort would have to be targeted at the kind of programmer wishing to learn clojure - ie it would assume some prerequisites and discuss features specific to clojure. It seems to me to be a shame to strip clojure down to a very small scheme-like language and then teach that.
Oh. Well both biwascheme and codemirror use javascript, and the amount of glue code I have to write isn't that much, so I'm not sure the benefits of clojurescript would outweigh that of being able to talk to these libraries directly.
I thought about doing this 3 or 4 days ago (eerily similar -- I had even decided on Biwa Scheme as well). To avoid duplication of effort, I would rather contribute to your iSICP than start my own.
The autograder checks for (+ 5 4 (- 2 ...)), instead of nesting the additions. You can view the source to see the grader. I'm not sure how to make it accomodate all the ways it could be nested though.
Why not check the result and also check for the presence of parentheses? That way you can verify the result and make sure nobody's just copying and pasting in an answer.
One could easily do something like (-2.466..) as the answer, but given that you just need a simple way to verify answers, I think my strategy works well.
I think you could get away with not even checking for parens, if you go with the idea that people doing it properly won't try to cheat it (because they'll learn nothing).
For people who do want to 'cheat', the grade is meaningless anyway.
I thought about that, but my reasoning for checking parens is that there's a decent subset of people who might get stuck and just google an answer, but if it gets rejected, then they'll put more time into figuring out the correct answer.
I guess I'm trying to view it from the POV of a beginner, as most CS people/programmers can work through this without needing the website.
"Green Bar" on the right: It is the navigation menu that comes into focus once you click on it. You can focus on the content w/o getting distracted by the ToC. :)
To OP. Don't worry. It is intuitive enough (for me at least (-; )
3, if possible, DO develop an app for mobile device, so you could get income or reputation which could driven you to continue this greate initial and finally done the job
sorry if it's not intuitive - I wanted the content to not be too wide (for reading) and had an idea to place some non-critical things on the remaining space, but then I decided it shouldn't always be visible
edit: I've fixed the page to make the green tab visible by default
I usually don't interrupt my reading so often with interaction. I like to read a section at a time and then do the exercises. But with this format, I could see dabbling in a little interactive work more often - which is probably a good thing.
I guess most of you should know what SICP is. I took a class where it was used as a textbook (only the first 3 chapters, unfortunately) and loved it.
Most of the syntax-highlighted code fragments can be clicked on and edited. Either click somewhere else after that or press ctrl-enter to re-evaluate the scheme code. There are also some auto-graded exercises which involve writing code, as well as some multiple-choice questions (inspired by coursera)
So far only the first section is up. I don't think I can finish converting the whole of SICP to this format, so any help is much appreciated! I've tried to make the API as short as I can, but still able to run arbitrary code (eg for auto-graders). The main code is in isicp/coding.js and the content is stored in chapter-specific html files. All this is done via client-side javascript. I used biwascheme for the scheme interpreter and codemirror for the editor.