4 ms·
> Of course assembly language has zero memory safety or other guarantees which probabilistically increases risk. I can't say if I think they balance out one way
by 10000truths 3y ago
> Of course assembly language has zero memory safety or other guarantees which probabilistically increases risk. I can't say if I think they balance out one way or the other.
I would posit that assembly + Linux kernel ABI is safer than the traditional C/C++ stack because they are not littered with nearly as much "undefined behavior". Signed arithmetic overflows and underflows as expected. Memory allocation with mmap + MAP_ANONYMOUS initializes it to 0 as expected. Accessing unmapped memory in your address space (including address 0) triggers a SIGSEGV as expected. Your assembler makes much fewer assumptions than your C compiler and doesn't try to be half as clever, so it's more likely to crash and burn on error instead of silently subverting your expectations.
- mgaunard 3y agoThis isn't a problem in practice because C++ developers are expected to know the rules of their language and respect them.
- 0x0 3y agoI think you meant "in theory" instead of "in practice" :)
- moron4hire 3y agoI think it was meant sarcastically
- mgaunard 3y agoIt wasn't sarcastic. Being a C++ developer requires discipline, and that's why hiring is much more selective and specialized.
- badsectoracula 3y agoI'm certain "in practice" was intentional, after all this seems to be what C++ compiler developers expect :-P
- badsectoracula 3y ago> C++ developers are expected to know the rules of their language and respect them In the same way children are expected to respect fire :-P
- IshKebab 3y agoMaybe so but I wouldn't recommend running forum software written in C++ either! "This footgun is safer than a footknife!"