Skip to content

Determa v0.3 Spruce

Latest

Choose a tag to compare

@AndyFerns AndyFerns released this 08 Dec 19:43
· 4 commits to master since this release

Determa v0.3 - Spruce

  • Major Language Upgrade: Functions, Calls, Locals & Recursion

  • This release represents one of the most significant milestones in the evolution of Determa — transforming the language from a simple expression evaluator into a fully structured, function-oriented programming language.

🌟 What’s New in v0.3

  • First-Class Functions

Determa now supports user-defined functions with:

  • Named functions

  • Parameters & arguments

  • Multiple statements in a function body

  • Return values

  • Type-annotated return types

Example:

func add(a, b): int {
    return a + b;
}

print add(4, 5); // 9

Function Calls + Call Stack Frames

A full call stack architecture has been implemented:

  • Each function call uses its own CallFrame

  • Arguments & locals are isolated per frame

  • Correct handling of nested and chained calls

Example:

func twice(x) { return x * 2; }
func quad(x) { return twice(twice(x)); }

print quad(5); // 20

Recursion Support

  • Determa now correctly handles recursive functions, including deep recursion.

Example:

func fib(n): int {
    if n == 0 return 0;
    elif n == 1 return 1;
    return fib(n-1) + fib(n-2);
}

print fib(10); // 55

Local Variables + Lexical Scoping

Full support for:

  • Local variable declarations inside blocks

  • Proper lifetime & cleanup

  • Shadowing of globals by inner-scope locals

Example:

var x = "global";

{
    var x = "local";
    print x; // local
}

print x; // global

Typechecker Expansion

The typechecker now validates:

  • Function parameter counts

  • Type consistency in return statements

  • Undefined variables inside functions

  • Mismatched or missing returns

  • This dramatically reduces runtime errors.

VM Improvements

The Determa VM now includes:

  • Correct function call handling

  • Stack frame isolation

  • Stable return value semantics

  • Clean REPL execution resets

  • Better error reports with stack traces

  • Stability improvements eliminate silent crashes & ensure deterministic execution.

New Automated Test Suite

  • A brand-new testing architecture was introduced:

  • VM tests rewritten to support function-based execution

  • Locals & shadowing testcases

  • Recursion tests

  • Function argument tests

  • End-to-end parser → typechecker → compiler → VM pipeline tests

Determa now ships with over 200 automated assertions across multiple subsystems.

Tooling & Developer Experience

  • Improved REPL consistency

  • Cleaner debug/log output

  • Faster compilation pipeline

  • New test_functions module for validating advanced language features

Installation

Download the archive for your platform below — no compiler or external dependencies required:

Windows: determa-windows-x64.zip

Linux: determa-linux-x64.tar.gz

macOS: determa-macos-x64.tar.gz

Just extract and run:

./determa file.det

Full Changelog

Compare all changes from v0.2.x:

v0.2.1-Cedar → v0.3

Contribute

Determa is a passion project of mine and hence its fully open source - contributions are welcome!

Try the language, report issues, submit ideas, and help shape the next release.

👉 Pull Requests: Always welcome!

Thank you for reading (👻)!