Hello Swift Community! This is the second time that I'm writing a post here. The first one was to introduce myself and show my interest in the project "Bridging Swift Error Handling Model to C++" meant to be part of Google Summer of Code 2022. This time, I'm writing to present the results I achieved during its development, even after not being selected to receive the GSOC scholarship, but still greatly mentored by Alex Lorenz!
The two main goals of this project was:
- Extend the C++ interface generator for a Swift module to emit C++ interfaces for Swift functions that throw, and a C++ class that represents Swift’s Error type and throw it.
- Create a C++ class that resembles the proposed std::expected class, to provide error handling for clients that don’t use C++ exceptions.
Let's consider this Division function that can thwors as an example:
@_expose(Cxx)