r/ProgrammingLanguages • u/Bitsoflogic • May 31 '26
Docker as the runtime
I want to move the boundary of the language beyond a single process. The compiler can own communication between processes and provide type safety throughout a larger system.
Over time, I've realized one of the key language features I'm developing is durable functions.
To that end, I'm seriously considering docker as the runtime. One container will host a database for storing the state of the durable functions and be completely managed by the "runtime". Each service the developer defines will be its own container as well.
From the developer's point of view, it should feel like its included the same way a garbage collector is included.
Have you seen any other attempts along these lines? Unison and Erlang are the closest I've found, but nothing targeting Docker.
9
u/yuri-kilochek May 31 '26
Can you explain the problem that you have and expect Docker to solve?
8
u/prehensilemullet May 31 '26
What do you mean by this? The GC is embedded in the same process as the user’s code executes, whereas the database container you’re considering would not, so I don’t see how it’s possible for it to “feel” this way.
Are you talking about “included” in the sense of how you can use a userland garbage collector crate in Rust?
4
u/pauseless May 31 '26
If you’re prepared for the cost of containers, why not just a sqlite DB locally? Why docker?
I’m not sure what you mean by durable functions. Do you mean functions that also have state? Lisp, Smalltalk, APL and more are probably your references as they all have the image model.
5
u/oscarryz Yz May 31 '26
This is what DBOS does, it is not a language but a library that makes your functions durable
https://dbos.dev/
I dont think you need a docker to run a separate (large) database, SQLite can run embedded and can hold a very large amount of data.
Even just having a runtime keeping the state in a hash map should be enough for durable functions unless you want to make this distributed across the network.
3
u/6502zx81 May 31 '26
Erlang and its library do somthing related.
1
u/mhfrantz May 31 '26
This sounds a little like "code as infrastructure" or "infrastructure from code". There are some frameworks (e.g. Wing, Nitric, Ampt, Klotho, StackGen, Encore, Shuttle) for various languages that derive cloud infrastructure requirements from annotated source code, rather than having to maintain separate deployment code. But in your case, you want to deploy to a single Docker instance. Maybe some of those frameworks could be used the way you envision.
2
u/prehensilemullet May 31 '26
Aside from my other question, why not define an interface for a persistence mechanism so that you’re not limited to one way of doing it? If the language is in control of everything, it would be harder to set up database replication and failover necessary for a high availability production deployment.
2
u/stststuttering May 31 '26
you can take inspiration from data orchestration libs like apache airflow, flyte etc
2
u/ReedTieGuy May 31 '26
To me it sounds like you're trying to recreate images.
2
u/drift_throwawayhq Jun 02 '26
You are basically just rebuilding Erlang but with a heavier container stack and more overhead. Using Docker as the runtime layer feels like it would make local debugging a nightmare compared to just letting the runtime manage the actor tree itself.
2
u/[deleted] Jun 02 '26
[removed] — view removed comment