Live data from Hacker News

Show HN: Learn C and its lower levels interactively, in the browser

news.ycombinator.com

21–30 of 37 posts

Re: Show HN: Learn C and its lower levels interactively, in the browser

#23
I 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.

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.

Re: Show HN: Learn C and its lower levels interactively, in the browser

#26
post #24
post #15

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

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?

Mobile Safari gives me a blank page.

Re: Show HN: Learn C and its lower levels interactively, in the browser

#27
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.

Re: Show HN: Learn C and its lower levels interactively, in the browser

#28
post #24

Earlier quoted context omitted.

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?

Mobile Safari gives me a blank page.

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

Re: Show HN: Learn C and its lower levels interactively, in the browser

#30
post #27

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 m…

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.

Post reply on HN