> To iterate over something using the natural features
of the language (object references, array indexing), it would need to be an array managed by that same language implementation.
I seriously doubt that's true even in cython, and I know it's not true in rust. In rust, you could either just use raw pointers (but this doesn't meet the spirit of the demand) or you can assert to the compiler that this code isn't being mutably accessed by other code (an assumption even of the C code, or else it is incorrect) and get a slice. At that point there is no difference between that slice and one "managed by the language", whatever the heck that's supposed to mean.
I enjoyed the perspective. Simultaneously though, in 2021 it is just professional malpractice to continue to use C. There will always be the programmer that doesn't hold it right and introduces a bug. Meanwhile, the entire world of technology is under constant siege from within and without via the world's spy agencies and ransomware gangs. With these attacks routinely shutting down hospitals and costing lives, it's really hard to justify continuing down a path that hasn't fixed this problem in literally 40+ years.
8 comments
[ 3.9 ms ] story [ 29.1 ms ] threadJust to take the most egregious example,
> To iterate over something using the natural features of the language (object references, array indexing), it would need to be an array managed by that same language implementation.
I seriously doubt that's true even in cython, and I know it's not true in rust. In rust, you could either just use raw pointers (but this doesn't meet the spirit of the demand) or you can assert to the compiler that this code isn't being mutably accessed by other code (an assumption even of the C code, or else it is incorrect) and get a slice. At that point there is no difference between that slice and one "managed by the language", whatever the heck that's supposed to mean.
Some Were Meant For C (2017) [pdf] - https://news.ycombinator.com/item?id=26300199 - March 2021 (186 comments)
Further back:
Some Were Meant for C (2017) [pdf] - https://news.ycombinator.com/item?id=19736214 - April 2019 (176 comments)
Some Were Meant for C: The Endurance of an Unmanageable Language [pdf] - https://news.ycombinator.com/item?id=15179188 - Sept 2017 (240 comments)