Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Too many people have replied to my post saying I'm wrong in some way, so rather than replying the same thing to almost every single comment, I'm going to reply to myself.

My original response was to the person claiming that it was basically cheating to use SDL. You need abstraction, so there is nothing wrong with having SDL in the way.

Someone said that it's C all the way down. It's not. The Linux kernel is not 100% C and it cannot possibly be.

There are no C facilities to:

- Read a keystroke and/or mouse (required for Flappy Bird) directly. C only supports reading from the stdin and stdout streams.

- Generate graphics (more on this below).

As I mentioned in the original post, some operating systems let you write straight to graphics memory.

While you can technically do this in C with a pointer to an address, you're still going to have to issue e.g. a BIOS call to set the mode to something other than the default text mode. But we can let that slide.

There is absolutely no way to do "C all the way down" when reading and writing I/O ports, executing interrupts, etc. which is required for I/O beyond just the buffered stdout and stdin streams that C provides.

Linux of course provides things in /dev, but they're also not C all the way down.

If there was a hypothetical computer which supported all graphics and other I/O via reading and writing to/from streams, then sure, but I don't think that computer exists.

I know very well what C can and cannot do, I've been using it for 40 years.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: