6 ms·
Show HN: Learn C and its lower levels interactively, in the browser
I made a simple virtual machine that runs C in the browser.This project is made as an experiment to see if C can be learned easier if the lower level is covered in paralel.
Sandbox: https://vasyop.github.io/miniC-hosting
Tutorial part 1: https://vasyop.github.io/miniC-hosting/?0
More info: https://github.com/vasyop/miniC-hosting/blob/master/README.md
Please support this project: https://github.com/vasyop/miniC-hosting/blob/master/support.md
- anon42428428313 8y agoI know basic C but never digged into what happens below the surface. As someone who doesn't know these things I find the tutorial really well-made, with a clean and concise exposition.
- smnplk 8y agoI am also tinkering a bit (pun intended :)) with low level stuff, currently reading Low-Level Programming by Igor Zhirkov.
- philonoist 8y agoYou should put this in "Show HN: " This project is amazing! My hunch is that academia is already sniffing this and musing to adopt into their courses.
- vasyop 8y agoGet notified when new tutorials are released https://docs.google.com/forms/d/e/1FAIpQLSectFtg9jl4zkFZqPnQkSRChNG7-I0qzR3247NRzdmAqEHCZA/viewform?usp=sf_link https://docs.google.com/forms/d/e/1FAIpQLSectFtg9jl4zkFZqPnQ...
- DyslexicAtheist 8y agowow, absolutely amazing!
- Siira 8y agoThese links are blank pages for me.
- jventura 8y agoI think it is quite interesting, although I think you do have too much information on the tutorial (too much clicking to do). I think it would be better if you could provide a much simpler example that it would allow people to learn how to use the tool by themselves. For instance, maybe start with what a push means, etc. The thing is that you have two levels of learning here: the compilation step and how the machine works. It could be better to start with how the machine works and eventually how to write programs for it.. Keep up with the good work!
- Jahak 8y agoNot bad
- Bucephalus355 8y agoHave waited forever for something like this. So. Many. Things. Boil down to C. Thank you thank you thank you
- Panoramix 8y agoThis was great! Looking forward to them for loops.
- q3k 8y agoThis could be very useful to visually teach exploitation basics (buffer overflows, stack smashing, ROP).
- tyingq 8y agoVery cool. Maybe add malloc() and friends to missing functionality.
- ucha 8y agoJust a heads up: it works on Chrome but not on Safari
- thegabez 8y agoGreat tool! Thanks for making and sharing.
- bogomipz 8y agoThis is really fantastic. Looking forward to more tutorials. Thanks for sharing.
- intenex 8y agoThis is basically the coolest thing ever huge insane thanks for putting this together man, you are a true hero
- equalunique 8y agoAwesome work!!! Reminds me some of Compiler Explorer: https://godbolt.org/ https://godbolt.org/
- ayepif 8y agoThis is a very well-thought out pedagogical tool. Can't wait for part 2!
- denniskane 8y agoI have a similar kind of functionality in Linux on the Web, but dealing with parsing wasm (web assembly) files. There is a desktop environment, but I think it is best to use the shell environment at https://linuxontheweb.org/shell.os https://linuxontheweb.org/shell.os. First, do this: $ cp /site/root/system/wasms/games/binjgb.wasm . The system is built around the concept of command libraries. You are going to need to import the wasm library like this: $ import wasm This loads a fairly powerful command called parsewasm. To get an informational printout of the toplevel sections in that file, run the command: $ parsewasm --toplevel binjgb.wasm There are lots of other subcommands in parsewasm, but the coolest part is that you can list out the names of exported functions and then dump out the code bodies of whatever functions you want to inspect.
- mattsfrey 8y agoThis is super cool and would be great for CS classes, well done!!
- burfog 8y agoNice, but some of the missing features really hurt: I couldn't do a simple #define. This is pretty fundamental to typical C programming. One would also expect stringification, token pasting, and variadic macros. I added a goto, and it won't compile. Yes, this is a valid and useful part of C, and must be learned by any C programmer. If you doubt this, count occurrences of goto in the Linux kernel. I also couldn't do modern array initializers. I'll guess the same is true of modern struct initializers. These are important for producing maintainable code. There seems to be no support for the restrict keyword. This keyword makes a dramatic performance difference.
- jamestimmins 8y agoIt seems like this comment is missing the point of this project, which is explicitly billed as an experiment to test the viability of an approach. It also sounds like you may have more extensive C experience than the target audience. But more importantly, every MVP is going to lack certain features that some folks deem essential. But when we focus on missing features, or worse, miss the point of a project ("you built X but what I really want is Y"), we discourage them or others from trying/sharing future experiments.
- burfog 8y agoI sort of am the target audience: I'm currently teaching C. The lack of important standard features means I can't just say "this is C". For teaching, normal data type sizes are important. Being able to have static data is important. Beginners need to see how these things work. I do applaud the effort. I think it is a great idea.
- deleted 8y ago[deleted]
- kazinator 8y agoBeginners also need to know that a specific translation to machine or virtual machine instructions isn't the definition of the program's behavior. If this was a good idea, Kernighan and Ritchie would have filled the pages of that book with PDP-11 instruction sequences accompanying bits of C code.
- GoToRO 8y agoWhat is 1 in CALL 1?