Skip to content

Arith v0.1.0

Choose a tag to compare

@yunabe yunabe released this 03 Sep 10:34
· 46 commits to main since this release
25f1d91

The first complete implementation of Arith language version 0.1 — a small language that compiles arithmetic programs to executable .NET assemblies, built to explore every stage of a compiler. See LANGUAGE_SPEC.md for the language and docs/compiler-design.md for the architecture.

Language

  • Primitive types bool, i32, i64, f32, f64, and string, with expected-type inference for unsuffixed numeric literals and no implicit conversions.
  • Functions, recursion, local variables with shadowing, if/else, while, range-based for (.. and ..=), break, and continue.
  • Arithmetic, comparison, equality, and short-circuit logical operators; checked integer arithmetic; ordinal string equality and concatenation.
  • Explicit conversions between numeric types and from any primitive to string; the built-in print.
  • Typed main parameters that receive parsed command-line arguments, with a generated usage line and exit code 2 on bad input.

Compiler and tooling

  • arith build emits a framework-dependent .NET assembly (plus runtimeconfig.json and launchers) directly with System.Reflection.Metadata; arith build --aot produces a single native executable through the NativeAOT toolchain; arith run compiles and runs in one step.
  • Multi-diagnostic compilation: every stage recovers and continues, and diagnostics carry stable ARITHxxxx codes (docs/diagnostics.md).
  • An examples/ directory of ten programs, each pinned by an end-to-end test, including a measured tail-call experiment.
  • CI on Linux, macOS, and Windows.

Requires the .NET 10 SDK. Full history: CHANGELOG.md.