3 ms·
My major problem with Swift was its error messaging. “Error: -2.” Okay, well, I suppose I’ll attach a debugger and… it’s of absolutely no help, since it crashes
by freeone3000 1y ago
My major problem with Swift was its error messaging. “Error: -2.” Okay, well, I suppose I’ll attach a debugger and… it’s of absolutely no help, since it crashes internally to some function and I can’t get out a stacktrace.
Function calling is irksome, with implicit parameters and mandatory parameters vaguely mixing? And the typing is appalling - there are multiple bottom types with implicit narrowing casts, one of them being NSObject, so if you’re doing any work with the Apple APIs you end up with a mess.
We got it right with Java and Rust; C++ does a passable job; why Swift had to be as incomprehensible as typescript, I cannot fathom.
- saagarjha 1y agoYou should be able to get stack traces in the debugger, what issues did you run into?
- freeone3000 1y agoI think the issue was an async boundary - I was able to trace back to CoreFoundationLibrary but the trail ended there. Also, lldb was unable to get locals? Which is something I’ve not seen happen…
- saagarjha 1y agoWere you inside the library itself, perhaps?
- freeone3000 1y agoYes. That’s where the crash happened. (obviously not the cause, but…)
- saagarjha 1y agoYeah, if you are crashing inside the library, you won't have access to locals in that stack frame. You'll need to unwind a bit to your own code until they become visible.