News for hackers. Stuff that matters.
Re:Should you learn C to “learn how the computer works”? by geofft on Tuesday October 02, 2018 @03:01PM (#18124634)
> Our modern software empire is built on mountains of C, and deference to C is pervasive throughout higher-level software design.

This I agree with and also I'd call the most important reason for Rust programmers to learn C. The C ABI is a lingua franca, not because it's good or pure but (as with spoken linguas franca) happened to be in the right place at the right time. It defines certain conventions and assumptions that didn't have to be assumed (implicit stack growth without declared bounds, single return value, NUL-terminated strings, etc.) and a lot of software is written to it, to the point that if you want your (e.g.) Python code and Rust code to interoperate, the easiest way is to get them to both speak C-compatible interfaces, even though you're not writing any actual C code.

Re:Should you learn C to “learn how the computer works”? by ElijahLynn on Tuesday October 02, 2018 @03:11PM (#18124751)
For those who don't know what ABI means (as I did not) and thought it might be a typo.

ABI = Application Binary Interface

https://en.wikipedia.org/wiki/Application_binary_interface

https://upload.wikimedia.org/wikipedia/commons/b/bb/Linux_AP...

Re:Should you learn C to “learn how the computer works”? by geofft on Tuesday October 02, 2018 @03:27PM (#18124889)
Yup. In compiled-languages land it's common to see things that are API-compatible but not ABI-compatible: the compiled objects don't work together, but if you recompiled the same source code it would work with no changes. This happens (sometimes) when you do things like reorder members of a structure or switch to a larger integer type for the same variable.

C and libc have been ABI-stable on most platforms for decades. C++ on some platforms (e.g., GNU) is stable with occasional ABI breakages in the standard library; on others (e.g., MS Visual C++) it breaks with new compiler versions. Rust isn't ABI-stable at all and has no clear plans for it, despite a strong commitment to API stability (i.e., old code will compile on new compiler versions). Swift 5 is targeting ABI stability.

Re:Should you learn C to “learn how the computer works”? by Sir_Cmpwn on Tuesday October 02, 2018 @07:47PM (#18126629)
To save you the read: in web terms, the API is e.g. Stripe and the ABI is HTTP.
Re:Should you learn C to “learn how the computer works”? by umanwizard on Tuesday October 02, 2018 @04:50PM (#18125581)
There is not really any such thing as "the" C ABI -- different platforms have totally different conventions, even on the same instruction set.
Re:Should you learn C to “learn how the computer works”? by jdub on Tuesday October 02, 2018 @07:57PM (#18126664)
It's shorthand for "the ABI relevant to the current context", which is entirely reasonable.
Re:Should you learn C to “learn how the computer works”? by umanwizard on Wednesday October 03, 2018 @11:50AM (#18131439)
It wasn't at all clear to me from the post I responded to that this is what the poster meant, or that they knew the fact I was stating.
Re:Should you learn C to “learn how the computer works”? by saagarjha on Tuesday October 02, 2018 @05:18PM (#18125796)
I'm assuming "the" C ABI probably means System V.