Strict Programming Language

Strict Programming Language

  • Docs
  • API
  • Blog

›All Blog Posts

All Blog Posts

  • July 2025 New Strict parsing and runtime design overview
  • March 2023 Mutable
  • January 2023 Multi Line Text Expressions and Introducing New Lines in Strict
  • January 2023 Namings in Strict
  • December 2022 Traits and Components
  • November 2022 Multi Line List Expressions
  • November 2022 Strict Base and Example folders moved to separate repository
  • October 2022 Shunting Yard
  • September 2022 For loops
  • September 2022 Details about Mutability in Strict
  • July 2022 Introduction To Generics In Strict
  • May 2021 Strict Newbie Experiences
  • June 2021 Slow Progress
  • May 2021 BNF Grammar
  • May 2021 Next Steps
  • Jul 2020 Getting Back Into It
  • Jul 2020 Optimizing FindType
  • Jul 2020 Package Loading
  • Jun 2020 Parsing Methods
  • Jun 2020 As Simple As Possible
  • Jun 2020 Back to blogging
  • May 2020 Slow and not steady
  • Apr 2020 Sdk going open source
  • Feb 2020 Still work in progress
  • Jan 2020 website is up

July 2025 New Strict parsing and runtime design overview

July 20, 2025

Benjamin Nitschke

Architecture at a Glance

LayerResponsibilityWhen It RunsRejects / Optimises
Strict.LanguageLoad .strict files, package handling, core type parsing (structure only)File loadBad formatting & package errors
Strict.ExpressionsLazy-parse method bodies into an immutable tree of if, for, assignments, calls…First method callStructural/semantic violations
Strict.ValidatorsVisitor-based static analysis & constant foldingAfter expression parsingImpossible casts, unused mutables, foldable constants
Strict.RuntimeExecute expression tree via ~40 instructionsOn demand by the callerValue/type errors, side-effects
Strict.TestRunnerRun in-code tests (method must start with a test)First call to a methodFailing test expressions
Strict.OptimizersStrip passed tests & other provably dead codeAfter first successful runDead instructions, test artefacts

1 · Strict.Language

  • Parses package headers and type signatures only.
  • Keeps every package cached in memory for instant access.
  • Any malformed file is rejected before deeper compilation.

2 · Strict.Expressions

  • Method bodies are parsed lazily the first time they’re needed.
  • Produces an immutable expression tree — never mutated at runtime.
  • Early structural checks ensure only valid Strict constructs survive.

3 · Strict.Validators

  • Runs constant folding & simple propagation (e.g. "5" to Number → 5).
  • Flags impossible casts ("abc" to Number) and other static mistakes.
  • Separation of concerns: validation without touching runtime state.

4 · Strict.Runtime

  • The Runtime is the single source of truth for dynamic behaviour.
  • Executes ~40 byte-code-like instructions as statements, all in memory for now.
  • Very fast, the goal is to run this in Strict itself and go through millions of lines per second.

5 · Strict.TestRunner

  • Every method must open with a self-contained test.
  • Tests are executed once; passing expressions become true and are pruned.
  • Guarantees that only verified code reaches production.

6 · Strict.Optimizers

  • Final clean-up pass: Remove passed test code.
  • Eliminate unused variables created solely for testing.
  • Preserve original line numbers for precise error reporting.

Note: There are older projects like the VS Code LanguageServer, Cuda Compiler, Roslyn, Grammar, etc. but these are no the focus here, we just want to get the Runtime working, switch all the code to Strict itself and let it rip then ^^


Key Design Decisions

  1. Immutable Expression Tree
    Static analysis only; no runtime state sneaks in.

  2. Validation Before Execution
    Catch the trivial stuff early, let the Runtime handle the hard parts.

  3. Runtime Is King
    Only the VM sees real values and side-effects — optimisation happens post-execution.

  4. One-Time Tests
    Tests live where the code lives, run once, then disappear.


Why This Matters

Only needed code that is actually called is ever parsed, validated, tested and runs in the Runtime. This is a very different approach and allows generating millions of .strict lines of code and discarding anything that is not needed or doesn't work pretty much immediatly.

  • Fast Feedback — formatting and type errors fail instantly, long before runtime.
  • Deterministic Builds — immutable trees + one canonical code style = no drift.
  • Lean Runtime — by the time code hits the Runtime, dead weight is already gone.

Happy coding with Strict — where there’s exactly one way to do it right.

Recent Posts
  • Architecture at a Glance
  • 1 · Strict.Language
  • 2 · Strict.Expressions
  • 3 · Strict.Validators
  • 4 · Strict.Runtime
  • 5 · Strict.TestRunner
  • 6 · Strict.Optimizers
    • Key Design Decisions
    • Why This Matters
Strict Programming Language
Docs
Getting StartedCoding StyleAPI Reference
Community
Stack OverflowProject ChatTwitter
More
HelpGitHubStar
Copyright © 2025 strict-lang