
Show HN: Learn C and its lower levels interactively, in the browser - vasyop
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.<p>Sandbox: https:&#x2F;&#x2F;vasyop.github.io&#x2F;miniC-hosting<p>Tutorial part 1: https:&#x2F;&#x2F;vasyop.github.io&#x2F;miniC-hosting&#x2F;?0<p>More info: https:&#x2F;&#x2F;github.com&#x2F;vasyop&#x2F;miniC-hosting&#x2F;blob&#x2F;master&#x2F;README.md<p>Please support this project: https:&#x2F;&#x2F;github.com&#x2F;vasyop&#x2F;miniC-hosting&#x2F;blob&#x2F;master&#x2F;support.md
======
philonoist
You 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
Get notified when new tutorials are released
[https://docs.google.com/forms/d/e/1FAIpQLSectFtg9jl4zkFZqPnQ...](https://docs.google.com/forms/d/e/1FAIpQLSectFtg9jl4zkFZqPnQkSRChNG7-I0qzR3247NRzdmAqEHCZA/viewform?usp=sf_link)

------
burfog
Nice, 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
It 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
I 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.

~~~
kazinator
Beginners 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.

------
jventura
I 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!

------
anon42428428313
I 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
I am also tinkering a bit (pun intended :)) with low level stuff, currently
reading Low-Level Programming by Igor Zhirkov.

------
intenex
This is basically the coolest thing ever huge insane thanks for putting this
together man, you are a true hero

------
equalunique
Awesome work!!!

Reminds me some of Compiler Explorer:
[https://godbolt.org/](https://godbolt.org/)

------
Bucephalus355
Have waited forever for something like this. So. Many. Things. Boil down to C.

Thank you thank you thank you

------
ucha
Just a heads up: it works on Chrome but not on Safari

~~~
azakai
Looks like it's a blazor app (mono compiled to wasm using emscripten), so it
should run in all modern browsers - what error do you get on Safari?

~~~
macintux
Mobile Safari gives me a blank page.

~~~
snazz
Same here. Had to check that I had JavaScript turned on.

------
q3k
This could be very useful to visually teach exploitation basics (buffer
overflows, stack smashing, ROP).

------
bogomipz
This is really fantastic. Looking forward to more tutorials. Thanks for
sharing.

------
ayepif
This is a very well-thought out pedagogical tool. Can't wait for part 2!

------
mattsfrey
This is super cool and would be great for CS classes, well done!!

------
Panoramix
This was great! Looking forward to them for loops.

------
tyingq
Very cool. Maybe add malloc() and friends to missing functionality.

~~~
vasyop
there is new

~~~
unwind
Not in C, there isn't.

------
DyslexicAtheist
wow, absolutely amazing!

------
thegabez
Great tool! Thanks for making and sharing.

------
Siira
These links are blank pages for me.

~~~
cwhsu
You might have to wait a few seconds. It's blank initially, but it shows the
code snippet and compiler in 3 seconds on my laptop

~~~
saagarjha
I could not get this to work in Safari, but they do show up in Chrome.

~~~
sgt
Same, it's not working in Safari.

------
GoToRO
What is 1 in CALL 1?

------
Jahak
Not bad

