3 ms·
My toy language project is also built around multi-stage (though the way it's formed it's more like literate programming) and partly motivated by writing cloud-
by gsuuon 2y ago
My toy language project is also built around multi-stage (though the way it's formed it's more like literate programming) and partly motivated by writing cloud-native applications. I played around with a sketch of this idea implemented using F# computation expressions[1] and partly implemented an Azure backend, at a high level it appears pretty similar to Winglang. When run at "comptime" / CLI, it spins up those resources if necessary and then produces artifacts via msbuild task for servers that run the "runtime" part of the code. The computation expression handles exposing a client and forming the ARM template based on the context. It gets around the inflight/preflight distinction by including the entire app (including provisioning stuff) in each runtime instance, so references outside of route scopes work (instance-globally, not app-globally).
Very excited for multi-stage - especially it's potential to provide very good LSP/diagnostics for library users (and authors). It's hard to provide good error messages from libraries for static errors that are hard to represent in the type system, so sometimes a library user sees vague/unrelated errors.
[1] https://github.com/gsuuon/kita/blob/d741c0519914369da9c89241df283581dbe9c5fd/tests/Kita.Providers.Azure.Test/App/App.fs#L79 https://github.com/gsuuon/kita/blob/d741c0519914369da9c89241...