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

Pointers are only real if you ignore MMUs and cache lines and imagine that C actually gives a good model of real modern hardware.


> Pointers are only real if you ignore MMUs

Which is true on architectures without MMUs, which probably account for about 90% of the computing devices in use. Okay, maybe 85% since tablets and smartphones became important.

And is also obviously true in MMU code.

And then they're just pointing at an imaginary address that the MMU "projects", so they're still very real in the sense that the author is using (i.e. in one form or another, we're going to keep having to write arbitrary values at arbitrary addresses that mean something until someone figures out a better way to talk to devices).

I don't think that better way doesn't exist. Like anyone who ever found himself wishing PDP-11 would just fucking die already, I even have a few ideas of my own about a better way. Alas, I'm probably wrong about them and I don't know of any commercially-available processor that has a better way of doing that.

> ...and cache lines

Which you can generally do as long as you remember to account for it when it comes to timing and you don't have a buggy cache.

I know a guy who spent about an year and a half chasing a bug that got traced to a bug in the IP. It would occasionally decide to flush the cache, even though it didn't. Talk about dedication.

> and imagine that C actually gives a good model of real modern hardware.

It never really did, not even on the PDP-11, but that's hardly the point. LISP didn't really give that good a model of the LISP Machine either, but it provided an abstraction that was close enough to be useful and allow you to reason about what you had to do.




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

Search: