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

There's something fundamentally different and mistaken about C's original implementation of variable integer sizes though.

People often describe C as "portable assembly", but despite this, integer sizes varying on different platforms results in non-portability of anything those programs _produce_. That is, a "file", or bit stream (not byte stream!) produced by one machine may be incompatible with another. The original integer-size independence is decidedly not portable.

That was probably less of a problem when it was rare to send data from one physical machine to another machine, let alone one of another type. But now the world is inter-net-worked and we have all sorts of machines talking to each other all the time.

Making the interfaces explicit reduces errors. These days we now even have virtual machines and programs running at different bit widths on the same machine, and emulated machines on the same machine running different ISAs!

I'm also part of what I'm sure is a small number of users who believe using "usize" should be a lint error manually overridden on Rust and also thinks endianness should also be explicit. Heck, it should be a compiler error to write a struct to a socket if it contains any non-explicit values!



Original C was portable to -platforms- and not to -users-.


And in an inter-networked model, that means it's not portable.




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

Search: