MiniLang is an internal compiler/toolchain solution built around a single pipeline:
ANTLR syntax tree -> HIR -> MIR -> execution hosts. The repository currently ships
an interpreter, a register-VM backend, a custom
VM runtime with GC, shared tooling/hosting infrastructure, and an isolated
Experimental/Typing area for incomplete type-system work.
Compiler.FrontendGrammar, lexer/parser generation, syntax entrypoints.Compiler.Frontend.TranslationHIR/MIR models, lowering, semantics, builtins metadata, andExperimental/Typing.Compiler.Backend.JIT.AbstractionsBackend/runtime execution contracts shared by compiled backends.Compiler.Backend.VMRegister-VM backend host and MIR-to-bytecode compiler.Compiler.Runtime.VMVM runtime, values, heap, GC, and builtin runtime support.Compiler.InterpreterTree-walking interpreter host.Compiler.ToolingShared host orchestration, pipeline wiring, command options, logging, and diagnostics.Compiler.BenchmarksBenchmarkDotNet harness for factorial, sorting, and prime-sieve workloads.Compiler.TestsxUnit regression, parity, architecture, CLI, and documentation checks.
- Build:
dotnet build Compiler.sln -c Debug - Test:
dotnet test Compiler.sln - Format:
dotnet format
Solution-wide SDK settings live in Directory.Build.props, package versions in
Directory.Packages.props. The repository currently targets .NET 10
(net10.0).
The executable hosts use System.CommandLine with a run subcommand and are wired
through Microsoft.Extensions.Hosting.
- Interpreter:
dotnet run --project Compiler.Interpreter -- run --file Compiler.Tests/Tasks/factorial_calculation.minl - VM backend:
dotnet run --project Compiler.Backend.VM -- run --file Compiler.Tests/Tasks/factorial_calculation.minl
Common options:
-f|--filepath to.minlsource-v|--verboseverbose compiler/runtime logging--quietsuppress builtin stdout such asprint--timeemit total execution time
VM GC options for the VM host:
--gc-threshold <N>initial heap collection threshold--gc-growth <X>threshold growth factor--gc-auto <on|off>enable or disable opportunistic collections--gc-statsprint GC statistics after execution
Run the benchmark harness in Release mode:
dotnet run --project Compiler.Benchmarks -c Release
The harness compares interpreter and VM execution on:
- recursive factorial
- array sorting
- prime number generation
Compiler.Toolingis intentionally limited to host/orchestration concerns. Core language semantics stay inCompiler.Frontend.Translation.Compiler.Backend.JIT.Abstractionscontains only the generic MIR-to-backend compile contract. VM execution stays inCompiler.Backend.VM.- The VM backend is the primary compiled execution target. The interpreter is kept as a separate execution host and parity baseline in tests.
- The runtime builtin surface currently includes
array,print,assert,len,ord,chr, andclock_ms. Experimental/Typingis a deliberate WIP zone and is not part of the default compilation pipeline.