Re:Porting a Golang and Rust CLI tool to D
by mhh__ on Thursday August 20, 2020 @06:54AM
(#24221946)
Exception unwinding is not particularly cheap on the compiler although I think it's in the sense that it muddles the CFG and the register allocation rather than inserting huge amounts of code. The LLVM codebase has exceptions turned off for those reasons and binary size (it plays a role at their scale) although its quite hard to compare exceptions Vs error codes or monads for obvious reasons (LLVM's coding standards are rightly or wrongly a C++ sleuths dream with their custom dynamic casts etc.)
When it comes to generated code, I can imagine the panic unwinding code being a noticeable contributor to the size of a Rust binary, but since D has exceptions I imagine the D binaries have comparable code for unwinding.