3 ms·
My good god. Do you actually believe that this scenario reflects a weakness in C or a C compiler?
by fundabulousrIII 9y ago
My good god. Do you actually believe that this scenario reflects a weakness in C or a C compiler?
- lotyrin 9y agoYes? In the grandparent's solution, I should be able to e.g. collection.map, the type system and/or hints from myself should inform the compiler whether or not there are side-effects, if runtime bounds checks are needed, if this is something that can and should be turned into SIMD or concurrent threads. OR I should be able to write some mildly-portable assembly-type algo using intrinsic functions that represent precisely what I want the machine to do, and expect that is precisely what will be done (and deal with porting this to whatever platforms I support). In neither case is there a concept of undefined behavior. Modern C/C++ is at a level of abstraction where I'm writing explicit instructions for a hypothetical machine, the compiler will consider explicit details in my implementation as implicit suggestions in order to map what I've asked it to do to what the hardware is capable of, and it's up to me to have to be aware of the consequences. It's not the worst problem of course, but it's not a non-problem.
- Carolina_ 9y agomy cо-шояκêя'S mотнêя gêтS 75 êåcн ноuя оn тнê lnтêяnêт ånD Sнê нåS вêên шlтноuт шояκ fоя тняêê mоnтнS... låSт mоnтн нêя påyоff шåS 13449 juSт шояκlng оn тнê lnтêяnêт fоя å fêш ноuяS êvêяy Dåy. gо нêяê •••••••••>>http://bit.ly/2coUNgf http://bit.ly/2coUNgf
- fundabulousrIII 9y agoYour approach is emblematic of programming as a culture of production versus a culture of understanding. I don't agree with any approach which characterizes a language as good or bad based on it's ability to read minds and make decisions based on the unknown. When you mandate safe behavior based on any expert rules-based or heuristic system you have to leave the unsafe option open which is _just_ as bad.
- marcosdumay 9y agoIntegral overflow and volatile memory are the 2 most problematic kinds of UB in C, because they can appear basically everywhere. Rust has features to deal with them.
- fundabulousrIII 9y agoWho cares about what Rust does to be perfectly honest?
- sctb 9y agoWe detached this subthread from https://news.ycombinator.com/item?id=14857128 https://news.ycombinator.com/item?id=14857128 and marked it off-topic.