Ascavim is a small programming language built around one idea: ordinary functions should be able to run locally or be dispatched to a remote worker without the programmer writing any RPC glue.
fn add(a: i32, b: i32) -> i32 {
return a + b;
}
remote fn analyze(value: i32) -> i32 {
return value * value;
}
fn main() {
let result = add(10, 20);
print(result);
let squared = remote analyze(result);
print(squared);
}The remote keyword marks a function as eligible for out-of-process
execution — and that's not a simulation: ascavim run --remote ships the
call over gRPC to a separate ascavim-worker process, which as of v0.4
can be a pod running on an actual Kubernetes cluster.
| Stage | Status |
|---|---|
| Lexer / Parser / AST | done |
| Semantic analysis (undefined vars, call arity) | done |
| Tree-walking interpreter | done |
| Ascavim IR + WASM codegen | done (numeric/boolean subset - see below) |
| WASM execution via wasmtime | done |
| gRPC worker + real remote execution | done |
| Kubernetes deployment (control plane) | done (see below) |
| Kubernetes operator / CRDs | not started (v0.5) |
ascavim buildcompiles a program to a real.wasmmodule;ascavim run <file>.wasmexecutes it with wasmtime.ascavim-workeris a standalone gRPC server that registers a compiled WASM module and executes named functions in it on request (proto/ascavim.proto) - it also ships as a Docker image (worker/Dockerfile).ascavim run <file>.asc --remote <addr>runs a program with the interpreter, but everyremote fncall is dispatched over gRPC to the worker at<addr>instead of running in-process — a real cross-process call, not a local fallback.<addr>works the same whether the worker is a local process or a Kubernetes pod reached via port-forward.control-plane/is a small Go program using client-go that deploysascavim-workeras a real Kubernetes Deployment + Service and reports on its status - not a script wrappingkubectl, an actual Kubernetes API client.
The WASM backend (and therefore anything sent to a worker) currently
covers i32/bool, functions, recursion, if/while, and print —
arrays, strings and for loops aren't lowered to WASM yet (they still
work fine in main under the interpreter, just not inside a remote fn).
See docs/ROADMAP.md for why, and the note in
docs/ARCHITECTURE.md on why this uses
wasm-encoder rather than Cranelift for WASM output.
See docs/ROADMAP.md for the full plan and docs/ARCHITECTURE.md for how the pieces fit together.
Requires a recent Rust toolchain.
cargo build --workspace
# run a program with the interpreter
cargo run --bin ascavim -- run examples/hello.asc
# compile to WASM and run it with wasmtime
cargo run --bin ascavim -- build examples/hello.asc -o hello.wasm
cargo run --bin ascavim -- run hello.wasm
# parse + semantic-check only, no execution
cargo run --bin ascavim -- check examples/hello.asc
cargo test --workspaceTry the other examples in examples/:
hello.asc— functions, arithmeticfib.asc— recursion,whileloopsloops.asc— arrays,for .. inloopsremote_demo.asc— theremotekeyword; see below for actually running it remotely
# terminal 1: start a worker
cargo run --bin ascavim-worker -- 127.0.0.1:50051
# terminal 2: run the program, dispatching `remote fn` calls to it
cargo run --bin ascavim -- run examples/remote_demo.asc --remote http://127.0.0.1:50051main's loop and array handling run in the interpreter as usual; each
remote analyze(item) call is compiled to WASM, registered with the
worker, and executed there over gRPC - a different OS process computes
the result and sends it back.
Requires Docker, kind,
kubectl, and Go.
# build the worker image and load it into a local kind cluster
docker build -f worker/Dockerfile -t ascavim-worker:dev .
kind create cluster --name ascavim
kind load docker-image ascavim-worker:dev --name ascavim
# deploy it as a real Deployment + Service via client-go
cd control-plane && go run . deploy && cd ..
# -> deployment/ascavim-worker applied, waits for the pod to be Ready
# reach the pod from your machine (stands in for a proper gRPC ingress -
# see docs/ROADMAP.md, Milestone 4)
kubectl port-forward svc/ascavim-worker 50051:50051 &
# same client, same command, now talking to a pod instead of a local process
cargo run --bin ascavim -- run examples/remote_demo.asc --remote http://127.0.0.1:50051
# see it happen from the cluster's side, independent of the client
kubectl logs deploy/ascavim-worker
cd control-plane && go run . status # or: teardownA deliberately tiny language: i32, bool, string, arrays; let,
assignment, if/else, while, for .. in; functions with typed
parameters and return types; remote fn for distribution. No generics,
traits, structs, or async yet — those come later, once the core pipeline
(parse → IR → WASM → schedule) is proven end to end.
The project is split by what each language is actually good at:
- Rust — the compiler and execution engine (
compiler/,runtime/,worker/). Memory safety and mature WASM tooling matter here. - Go — the distributed control plane (
control-plane/, and lateroperator/). This is where Kubernetes client libraries, controllers, and gRPC services are strongest.
remote fn is the feature the whole project is organized around, not a
bolted-on extra: the compiler pipeline, the IR, and the runtime's
executor/scheduler split all exist to make "call this function, maybe
somewhere else" a first-class, statically-known part of the language.
compiler/ lexer, parser, AST, semantic checks, IR, WASM codegen, interpreter (Rust)
runtime/ WASM executor (wasmtime) + gRPC client + generated proto types (Rust)
worker/ gRPC server + Dockerfile: registers/executes WASM modules on request (Rust)
proto/ the AscavimRuntime gRPC service definition
control-plane/ deploys ascavim-worker to Kubernetes via client-go (Go)
cli/ ascavim command-line tool (Rust)
examples/ sample .asc programs
docs/ architecture and roadmap
operator/ Kubernetes operator / CRDs (v0.5, not yet implemented)
operator/ contains only a short README describing its intended
purpose — see docs/ROADMAP.md for why it's sequenced
after control-plane/.
MIT — see LICENSE.