News for hackers. Stuff that matters.
Re:The descent to C by csmithuk on Tuesday January 28, 2014 @07:10AM (#7136602)
Few of the top of my head:

1. Performance reasons. For example: zero copy data structures, mutable data structures, controlling data locality.

2. Direct memory mapped hardware access. For example: device drivers, kernel, embedded systems, microcontrollers.

3. Bitwise and machine specific conversions. For example: endianess conversions.

4. Structure type coercion. For example: object systems, tagged data structures etc.

Re:The descent to C by fanf2 on Tuesday January 28, 2014 @03:49PM (#7139606)
If you are doing unsafe or machine-dependent endurance conversion code, you are almost certainly doing it wrong. http://commandcenter.blogspot.co.uk/2012/04/byte-order-falla...
Re:The descent to C by deletes on Tuesday January 28, 2014 @05:02PM (#7140079)
Thank you for that link.

#leaves to check some old code

.

.

.

#comes back

Apparently my younger self knew what he was doing. ( The conversion is done correctly :shocked: )

Re:The descent to C by mcguire on Wednesday January 29, 2014 @11:38AM (#7144930)
Sometimes I wonder about Rob.

"In fact, C may be part of the problem: in C it's easy to make byte order look like an issue. If instead you try to write byte-order-dependent code in a type-safe language, you'll find it's very hard. In a sense, byte order only bites you when you cheat."

Re:The descent to C by csmithuk on Wednesday January 29, 2014 @04:55AM (#7142989)
That's a great article - thanks for posting.
Re:The descent to C by fanf2 on Wednesday January 29, 2014 @06:05PM (#7147779)
"endurance"?! Damn you, autocorrect.
Re:The descent to C by pjmlp on Tuesday January 28, 2014 @08:18AM (#7136842)
All of those examples are possible in safe systems programming languages like Modula-2 and Ada, with the difference that only the tiny spot where it matters is marked explicitly unsafe.

Whereas in C there is no way to distinguish between unsafe and safe code.

Re:The descent to C by numeromancer on Tuesday January 28, 2014 @10:08AM (#7137432)
2. Direct memory mapped hardware access. For example: device drivers, kernel, embedded systems, microcontrollers.

Of course doing this usually means your code isn't portable, sometimes not even to other versions of the same compiler. I often wish C had a defined order for bitfields, for example.

One of the things I do to help debug & test embedded code is to factor out code which isn't dependent on the hardware platform (eg communication protocols) into a library, and compile it for, and write test programs to test them on, the host. So even embedded code is often best written to be as portable as possible.

Re:The descent to C by mcguire on Wednesday January 29, 2014 @11:47AM (#7144989)
Oddly enough, I've spent the last week playing around with type-agnostic garbage collection.