3 ms·
Lack of non-local dynamic control transfers with unwinding is the real deal breaker. Exceptions are a red herring; they are just something you can build if you
by kazinator 11y ago
Lack of non-local dynamic control transfers with unwinding is the real deal breaker.
Exceptions are a red herring; they are just something you can build if you have dynamic control transfers with unwinding. And if you have macros, or at least some kind of access to the language to bend the syntax. Plus perhaps other goodies like testing whether some object X is of a type which is a subtype of T so you can make exception handling frames decide whether the elevator stops here.
The underlying control mechanism not being there makes the language crippled.
Just give me C. Then I also have forty years of research out the window: but but at least with setjmp and longjmp.
How does Bash recover to the top level prompt when the scriptage fails deeply nested in some function calls? Why, longjmp! I will fake the unwinding if I have to.
- kjksf 11y agoGo has panic()/recover(), which is better than setjmp/longjmp (thanks to GC you won't leak memory like you would in C with setjmp/longjmp). I'm not saying using panic()/recover() is a good idea but if your issue with Go is lack of non-local dynamic control transfer then good news: you're mis-informed and Go will be great for you!