A Swift wrapper around the Racket CS runtime that simplifies embedding Racket in Swift applications. Noise also includes C++ bindings via CppNoise.
- Clone this repository.
- Install the Racket Serde packages:
raco pkg install Racket/noise-serde{-lib,-doc}/- Build the framework:
makeNote:Git LFS is required. Binary files in Lib/ and Sources/Noise/boot are stored via LFS.
The shared libraries and boot files must match the Racket version used to compile your code. The files on the master branch likely will not match a release build of Racket. To use your own, build Racket from source and run:
./Bin/copy-libs.sh arm64-macos /path/to/src/racketThe first argument depends on your target OS and architecture:
| OS | Architecture | Argument |
|---|---|---|
| macOS | x86_64 | x86_64-macos |
| macOS | arm64/aarch64 | arm64-macos |
| iOS | arm64/aarch64 | arm64-ios |
| iOS Simulator | arm64/aarch64 | arm64-iphonesimulator |
Configure Racket with:
configure \
--host=aarch64-apple-darwin \
--enable-ios=iPhoneOS \
--enable-pb \
--enable-racket=auto \
--enable-libffiFor the iPhone Simulator, change --enable-ios to iPhoneSimulator. After building, merge libffi into libracketcs.a:
libtool -s \
-o racket/lib/libracketcs1.a \
racket/lib/libracketcs.a \
/path/to/libffi.a \
&& mv racket/lib/libracketcs{1,}.aPre-compiled builds for specific Racket versions are available on dedicated branches:
racket-9.0racket-8.18racket-8.17racket-8.16racket-8.15(first branch to include an iOS build)racket-8.14racket-8.13racket-8.12racket-8.11.1racket-8.11racket-8.10
The core Swift wrapper around the Racket CS runtime. Provides a Racket struct for loading and evaluating Racket code from Swift.
A serialization/deserialization layer that allows data structures to be automatically shared between Racket and Swift. Install from Racket:
raco pkg install Racket/noise-serde-lib/
raco pkg install Racket/noise-serde-doc/
raco docs noiseBuilds on NoiseSerde to provide a client-server model where the Racket server runs in a background thread and the Swift client communicates via pipes.
C++ bindings providing Noise, NoiseSerde, and NoiseBackend headers for embedding Racket in C++ applications (including WinUI support).
Noise/
├── SwiftNoise/ Swift packages (Noise, NoiseSerde, NoiseBackend)
├── CppNoise/ C++ bindings
├── Racket/ Racket packages (noise-serde-lib, noise-serde-doc)
├── Examples/
│ ├── Swift/ Swift NoiseBackend example app
│ └── Cpp/ C++ NoiseBackend example (WinUI)
└── .github/workflows/ CI and release builds
- Swift: See
Examples/Swift/NoiseBackendExample/andSwiftNoise/Tests/NoiseTest/RacketTest.swift - C++: See
Examples/Cpp/NoiseBackendExample/ - External: NoiseBackendExample
Noise and its associated packages are licensed under the 3-Clause BSD License.
See Racket's license for information on Racket's license.