Hacker News new | past | comments | ask | show | jobs | submit login

I recall discussing C with a person using a processor where chars, shorts, and ints were all 32 bits. He stressed that writing portable code was necessary.

I pointed out that any programs that needed to manipulate byte data would require very special coding to work. Special enough to make it pointless to try to write portable code between it and a regular machine.

It's unreasonable to contort the standard to support such machines. It is reasonable for the compiler author on such machines to make some adjustments to the language.

For example, one can say C++ is technically portable to 16 bit machines. But it is not in practice, because:

1. segmented 16 bit machines require near/far pointer extensions

2. exceptions will not work on 16 bit machines, because supporting it consumes way too much memory

3. ditto for RTTI




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

Search: