Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Pyjong10935yDoes it say anything more than that? I'd like to hear the because part if there is any.. link perhaps?
-
Well AVR-GCC shows that C works also with Harvard. There's nothing in C that would require von Neumann.
-
@Fast-Nop Harvard has two address spaces. Pointers can't natively deal with that. I also don't know if code is generally writable in Harvard which it theoretically is in von-Neumann. E.g. a JIT: Write some instructions into memory and jump to it to execute them
-
@12bitfloat Well if you write code to memory and execute that, this means basically aliasing some data pointer and function pointers, and that's technically undefined behaviour anyway.
It's just that some machine specific hacks that are outside the abstract C machine may happen to work better on von Neumann than on Harvard. -
@Fast-Nop Writing instructions to memory and jumping to them is well defined behaviour (that's what JITs do). I don't argue that it's impossible compiling C code for Harvard, obviously that's possible (with some caveats), but I believe that C was fundamentally designed for Neumann-like machines
-
@12bitfloat it's undefined behaviour as far as the C standard is concerned. Obviously, because what you can even write to memory and execute is machine specific, and that wouldn't be the case for standard conforming C.
You can't even do that in C without casting some data pointer to a function pointer, and that's not allowed, technically.
Also, this is not a typical use of C. Everything that you typically use C for works as well on Harvard.
AVR needs the PGM hack only because on embedded, you want to access constant data from flash because RAM is scarce. In that regard, Harvard is a bad choice for such a target. But bigger machines don't have that issue.
Related Rants
"The C programming language was specifically designed to abuse the von-Neumann architecture"
- Some guy on StackOverflow
rant
von neumann
quote
c