Show HN: Interactive SICP
xuanji.appspot.com
xuanji.appspot.com
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.
I hope people extend the same treatment to non-lisp canonical texts.
If you find yourself in Boston, you can certainly visit CSAIL and chat with them if you want.
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'm doing the examples and exercises in Racket.
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.
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.
I think it's a good idea, personally. It could also make many of the assignments more interactive.
I just checked, MIT holds the copyright for HtDP, so an interactive version like this isn't possible.
A person could ask. Sometimes these things are done reflexively and a simple query will get a pleasant response.
The rest of us, however, might find it overwhelming, due to lack of appropriate habits and training.
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?
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.
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.
Drop me a line at me@f.rancis.co
Is an MIT computer science textbook.
http://mitpress.mit.edu/books/structure-and-interpretation-c...
(/ (+ 5 (+ 4 (- 2 (- 3 (+ 6 (/ 4 5)))))) (* 3 (* (- 6 2) (- 2 7))))
and it tells me the result is wrong, but wolfram and my own REPL confirms the result.
(/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7)))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.
For people who do want to 'cheat', the grade is meaningless anyway.
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.
To OP. Don't worry. It is intuitive enough (for me at least (-; )
1, add a on page chat for people, so they could help each other
2, add comment extension for the page, so people could add extra notes or corrects for your error :] , i saw those style here `http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basi...
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
btw, I love your blog
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.