It is really crazy how limited debugger options are on macOS. Is it simply the case that there are not that many people writing code in systems languages on macOS outside of XCode?
I used to be such a person, but after years of feeling as though Apple found people like me irritating and wished we would all stop bothering them, I finally took the hint.
Linux may not be so pretty, but it's far more comfortable.
What problems do you encounter? Which sorts of laptops do you prefer?
My "all Thinkpad, all the time" strategy has generally served me well (though I was disappointed by the most recent one, a T14, which would never sleep properly).
MacBookAir + aarch64 linux vm -- best of all the worlds. Linux for the 5% of things I need linux for, amazing battery life and hardware for the remaining 95% of things my laptop does.
Apple continuously makes the life of third party debuggers difficult, to the point where doing so today on a “stock” system requires malware-like techniques to get around their mitigations.
The author of the post claims that defer eliminates the need for RAII.
Well, goto also eliminates the "need" but language features are about making life easier, and life is much easier with RAII compared to having only defer.
It makes things easier. Usually the move constructor (or move assignment operator) will cause the moved-from object to stop being responsible for releasing a resource, moving the responsibility to the moved-to object. Simplest example: move- construct unique-ptr X from unique-ptr Y. When X is destroyed it will free the memory, when Y is destroyed it will do nothing.
So you can allocate resource in one function, then move the object across function boundaries, module boundaries, into another object etc. and in the end the resource will be released exactly once when the final object is destroyed. No need to remember in each of these places along the path to release the resource explicitly if there's an error (through defer or otherwise).
I agree that it makes some things easier (at the expense of managing constructors/destructors), I'm disputing the blanket assertion that it's superior to manual management, in the context of Jai (and Odin). You're also introducing a reference count, but that's besides the point.
In Jai/Odin, every scope has default global and temp allocators, there's nothing stopping you from transferring ownership and/or passing pointers down the callstack. Then you either free in the last scope where the pointer lives or you pick a natural lifetime near the top of the callstack, defer clear temp there, and forget about it.
You may also want to pass a resource through something like a channel, promise/future pair or similar. So it's not just down/up the callstack, sometimes it's "sideways". In those cases RAII is a life savior. Otherwise you have to explicitly remember about covering all possibilities:
- what if resource never enters the channel
- what if it enters the channel but never gets retrieved on the other side
- what if the channel gets closed
- what if other side tries to retrieve but cancels
They can ask for Israel's assistance, they managed to (relatively) covertly develop nuclear weapons without a major power getting in their way.
Granted, the US president who was pushing the most for inspections of Israel's Dimona nuclear facility was JFK, who ended up no longer being a problem for them (how very convenient).
Yes in theory and that's Taiwan's best bet. But the US would never go along with that because guarding Taiwan's democracy is not the main objective even as it is the main talking point. The main objective is US interests, which are not served by nuclear proliferation or by losing Taiwan as either a bargaining chip to extract concessions, or a chess piece in a proxy war to weaken China, the main rival to US global dominance. Taiwan's value as a bargaining chip or as an acceptable battleground to both sides for a controlled conflict, is unfortunately greater than it's value as a democracy
reply