Skip to content

beelang-v0.1.1

Choose a tag to compare

@github-actions github-actions released this 06 Aug 11:59
· 4 commits to main since this release

Changelog

All notable changes to BeeLang are documented here. The format is based on
Keep a Changelog, and this project
adheres to Semantic Versioning.

[0.1.1] — 2026-08-06

Performance work focused on loops, condition checking, and string building. No
language or API changes — existing programs run identically, only faster. All
14 examples and the correctness suites pass unchanged.

Performance

  • Inline cache for global variables. Reads/writes of top-level (named)
    variables now go through a cached pointer instead of a std::map lookup on
    every access. Top-level loops that were ~3.7× slower than Python are now
    ~2.7× faster than before this change.
  • Cross-function JIT. The native JIT previously handled only direct
    self-recursion; it now compiles a whole numeric call graph — helpers and
    mutual recursion
    — into one module, so those calls are direct and
    inlinable. A helper-calling loop (e.g. a prime sieve) that used to fall back
    to the interpreter now runs ~6× faster than Python.
  • Top-level loops are JIT-compiled automatically. A numeric top-level
    while/for no longer needs to be wrapped in a function to hit native
    speed. The numeric globals a loop touches are passed as an in/out array,
    loaded on entry and written back only on clean completion; anything
    non-numeric (a print, a string, division by zero) transparently falls back
    to the interpreter from unmodified state. A 10 M-iteration top-level loop
    dropped from ~1.84 s to ~0.03 s (~16× faster than Python).
  • In-place string append. The x = x + rhs / x += rhs idiom was O(n²) —
    a fresh, growing string each iteration (~246× slower than Python). It now
    grows the buffer in place when the string is not aliased, falling back to a
    copy to preserve value semantics otherwise. Building a 200 k-character string
    went from ~2.46 s to ~0.03 s (~82× faster).
  • JIT warmup guard. A small, flat for loop with a compile-time-known trip
    count below ~40 k now runs interpreted instead of paying the ~3 ms one-time
    native compilation, which for such loops costs more than it saves. Nested,
    large, or unanalyzable loops still compile as before. A 10 k-iteration loop
    dropped from ~4.3 ms to ~0.5 ms, matching Python.
  • Void numeric functions no longer run twice. A function that falls off the
    end (no value-returning return) used to be compiled, executed natively, then
    discarded and re-run in the interpreter — doubling the work. Native completion
    now reports a nil result directly, so such functions keep their native run. A
    100 M-iteration side-effect-free function dropped from ~6 s to milliseconds;
    a 10 M-iteration accumulating loop runs ~20× faster than Python.

Full Changelog: v0.1.0...v0.1.1