Random number generators in Swift
I present a few random number generators in Swift and investigate their quality versus performance. I also look at performance implementations and see if I can make a C algorithm run as fast as Swift.
I present a few random number generators in Swift and investigate their quality versus performance. I also look at performance implementations and see if I can make a C algorithm run as fast as Swift.
I present an implementation of Swift's Demangle.cpp, rewritten in Swift and use the two versions (the original C++ and my Swift version) to compare the C++ and Swift for writing parsers.
In my first truly 'Cocoa' article since restarting Cocoa with Love, I'll talk about presenting errors to the user. In particular, ensuring that errors we didn't expect or plan for are presented in a manner that allows error reporting by users and easier bug fixing.
In an ideal world, we would not know if our code was indented with either tabs or spaces. Remember: the moment you become aware of how your code indentation is encoded, you're not programming, you're managing your programming tools.
Struct types are not usually heap allocated, reference counted or able to perform work on deallocation. You can coerce them into having these properties but careful if you do: it can be a source of memory leaks, errant behavior and compiler crashes.
Error handling is a topic I plan to visit periodically but it's difficult since 'error' is such a poorly defined term. In this article, I give a clear definition of an error and further define the most common associated complications. The intent is to establish a foundation for future discussions on the topic.
Another debug analysis post, this time looking at gathering basic system information for attaching to diagnostic reports and other forms of reporting.
In this tongue-twister titled article, I discuss capturing control flow information with stack traces during ongoing tasks to aid debugging. Also included: a reimplementation of NSThread.callStackReturnAddresses in Swift for faster and more flexible stack traces.
Swift and C have different memory layouts. This means that using Swift to call C functions in a manner that would be valid in C can cause memory safety problems. I'll show how this can occur with a subtle Release build bug inspired by issues that occurred while writing the previous article.
Partial functions are risky but if you're going to write one anyway, you should do something completely crazy to test that it is risky in all the right places.