3 ms·
> In C, you can see what the machine is doing. Allocations don’t hide behind constructors, and destructors don’t quietly run during stack unwinding. You can pro
by ivanjermakov 9mo ago
> In C, you can see what the machine is doing. Allocations don’t hide behind constructors, and destructors don’t quietly run during stack unwinding. You can profile at the machine-code level without feeling like you’re peeling an onion, appropriately shedding tears the whole time.
This is why explicit control flow is important design goal for systems programming language. This is basically 2/3 of core design principles in Zig.
- pjmlp 9mo agoLike setjmp()/longjmp() and signal(), very explicit. /s
- rramadass 9mo agoThe control flow is explicit; there is no language "magic" here. Non-local gotos in the former case and asynchronous callbacks from the OS in the latter case are pretty well known.
- pjmlp 9mo agoExcept knowing where the jump lands, very explicit.
- rramadass 9mo agoThese are low-level api and hence if you know the caveats to follow, then using them correctly is not difficult; Eg. keep the context of the function calling setjmp active, don't use jmp_bufs allocated on a stack etc. Not knowing how to do something is the fault of the programmer and not the language/tool.