Integrate Pkl with Swift
mainPkl provides a rich integration with Swift that allows you to embed the Pkl runtime directly into your Swift programs and generate Swift code from Pkl source files. This enables type-safe configuration loading within your Swift applications.
@main
class MyApp {
static func main() async throws {
let config = try await MyConfig.loadFrom(source: .path("config.pkl"))
print("I'm running on host \(config.host)")
}
}