7 ms·
Show HN: Interactive SICP
- Tyr42 14y agouhh, It's got some sort of green bar, but it's stuck waaay over to my right and I can't read it. Chrome OSX
- zodiac 14y agotry clicking on the left edge of the green bar 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
- DigitalJack 14y agosame with safari, osx
- grannyg00se 14y agoSame. Firefox Win7 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.
- zodiac 14y agoHello 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.
- shelf 14y agoA great initiative. I hope you manage to finish it. I hope people extend the same treatment to non-lisp canonical texts.
- zodiac 14y agoOne 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.
- dbaupp 14y agoI 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'.
- jrajav 14y agoOpen 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 http://wiki.call-cc.org/chicken-for-php-programmers
- Surio 14y ago"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 (-; )
- dschiptsov 14y agoSICP 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.)
- dmazin 14y agoI'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.
- samrat 14y agoI 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. I'm doing the examples and exercises in Racket.
- mattstreet 14y agoAre 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.
- 14y ago
- firesofmay 14y agoGood 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 :)
- dizzystar 14y agoI 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?
- firesofmay 14y agoI was actually thinking of the whole web app being written in clojure/clojurescript actually. And not teaching SICP via clojure.
- zodiac 14y agoOh. 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.
- sudhirj 14y agoThe site doesn't seem to need a server to function - so it would be awesome if you could add a cache manifest to make it available offline: http://www.html5rocks.com/en/tutorials/appcache/beginner/ http://www.html5rocks.com/en/tutorials/appcache/beginner/
- zodiac 14y agoSorry for repeating myself, but I really need contributors for this - I can't finish it just working on my own on weekends.
- franciscoap 14y agoHey, 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
- ghubbard 14y agoSICP - Structure And Interpretation Of Computer Programs Is an MIT computer science textbook. http://mitpress.mit.edu/books/structure-and-interpretation-computer-programs http://mitpress.mit.edu/books/structure-and-interpretation-c...
- BlackJack 14y agoLooks awesome. I think exercise 1.2 is broken. I enter in: (/ (+ 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.
- vhf 14y agoI came up with the same solution and had the same wrong result.
- sur 14y agoI think it expects you to combine the addition and multiplication, like this: (/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7)))
- zodiac 14y agoThe 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.
- BlackJack 14y agoWhy 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.
- FuzzyDunlop 14y agoI 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.
- BlackJack 14y ago
- arikrak 14y agoIf I ever get up to Scheme, I'm adding this to my chart of interactive resources for learning programming.
- jyf1987 14y agowell, i just planing to post a blog about interactive books, hmm , seems late
- jyf1987 14y agook, here is my suggestions: 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-basics.html` 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
- zodiac 14y agoAnyone have ideas for how best to show footnotes? The current version doesn't have them.