Introducing RealtimeSanitizer for Swift

Hello Swift Community,

We’re excited to announce the release of RTSanStandaloneSwift, a real-time sanitizer for Swift!

LLVM 20 introduces the new RealtimeSanitizer, which is natively integrated with Clang.

RTSanStandaloneSwift is a lightweight wrapper around RealtimeSanitizer. It includes a prebuilt version of LLVM’s RealtimeSanitizer and provides a convenient Swift API for easy integration.

Check out our announcement blog post for more details, and let us know your thoughts!

14 Likes

It's great to see the growing interest in using Swift for programming in real-time contexts.

The use of this tool to highlight the shortcomings in the audio buffer management example is interesting.

Now, how can we code in Swift to avoid or work around these shortcomings? Are there any resources, documentation, or examples demonstrating best practices for using Swift in real-time contexts? Or does the language not yet support it, and this tool is reserved for language and compiler designers so they can diagnose and improve it?

1 Like

There's been very promising @_noLocks, @_noAllocation, but from my experience, I would hit some limitation of it sooner or later.

Runtime analysis, as it is performed by RealtimeSanitizer is much more practical for use cases we work on.

and this tool is reserved for language and compiler designers so they can diagnose and improve it?

The goal of this tool is to be used regular development. We've been using/exploring it for some time in context of audio application development and it works fairly well for us.