Strict Programming Language

Strict Programming Language

  • Games
  • Performance
  • VS Code
  • Docs
  • Blog
  • GitHub

›Documentation

Documentation

  • Overview
  • The VS Code Experience
  • Getting Started
  • Platforms
  • Built with Strict
  • Cheat Sheet

Language

  • Types
  • Members and Variables
  • Decimals and Exact Values
  • Methods
  • Tests
  • Statements and Expressions
  • If
  • For
  • Lists and Dictionaries
  • Errors
  • Keywords
  • Grammar

Rules

  • Coding Style
  • Code Validations
  • Naming

Source

  • Base Types
  • Architecture
  • Examples
  • Machine Learning
  • Benchmarks

More

  • Using APIs
  • Concurrency
  • Microservices

Cheat Sheet

Everything you need on one page to solve a kata in Strict. For the details, follow the links.

Setup

git clone https://github.com/strict-lang/Strict
Strict\Compiler\Bootstrap.cmd            # or: sh Strict/Compiler/bootstrap.sh, creates strict(.exe)
                                         # then put the Strict folder on your PATH
mkdir Kata && cd Kata                    # your project, can be anywhere
strict MyKata.strict                     # run the Run method on the Strict VM
strict test MyKata.strict                # run all tests
strict check .                           # validate the style rules

For the fastest introduction, open Writing Strict in VS Code: save a test, read its result and follow the values beside the implementation. See Getting Started for installation.

Editor and useful commands

ActionCommand or key
Follow a definitionF12
Details and testsHover over the name
Run the current fileCtrl+Shift+R
Inspect test values on executed linesstrict test MyKata.strict values
Native execution counts and timingstrict test MyKata.strict lines
Build for a C/C# hoststrict build MyKata.strict library

A type

The file Kata/MyKata.strict is the type MyKata. Members come first, then methods. Every method starts with tests, and its last line is the result.

has numbers
has logger
Doubled Numbers
    MyKata((1, 2)).Doubled is (2, 4)
    for numbers
        value * 2
Run
    logger.Log(MyKata((1, 2, 3)).Doubled to Text)

If a list is the only member, its elements can be passed directly: ReverseList(1, 2, 3). With more members, put the list in brackets: MyKata((1, 2)).

Members and variables

CodeMeaning
has numberMember, the name says the type
has start NumberMember with an explicit type
has Alpha = 1Member with an initial value, public because it is uppercase
has Width Number with value > 0Member with a constraint
has price Number with Step 0.01Exact decimal precision, half-to-even rounding
constant Max = 255Constant member
mutable ColorsMember that may change
constant zero = 0Variable computed from constants
let fraction = value % 1Variable that doesn't change
mutable count = 0Variable that changes
count = count + 1Reassignment of a mutable variable

See Members and Variables.

Methods

HeaderMeaning
Floor NumberNo parameters, no brackets
Log(text)No return type, the parameter name says its type
Clamp(minimum = 0, maximum = 1) NumberParameters with default values
+(other) NumberOperator method
to TextConversion, called as value to Text
from(text)Custom constructor, called as Type(text)

value is the instance. return is only needed to leave early. See Methods and Tests.

Expressions

3 + 4 * 2 is 11
7 % 4 is 3
2 ^ 3 is 8
"Your age is " + 18 is "Your age is 18"
5 to Text is "5"
"5" to Number is 5
3 is in (1, 2, 3)
"lo" is in "hello"
(1 is 1) and (2 is not 3)
value > 0 then value else 0

See Statements and Expressions.

If

if number % 15 is 0
    return "FizzBuzz"
else if number % 3 is 0
    return "Fizz"
if operation is
    "add" then first + second
    "subtract" then first - second
    else 0

See If.

For

value is the current element and index its position. What a method ending in for returns depends on its return type:

LoopResult
for numbers + value * 2 in a Numbers methodthe list (2, 4, 6)
for numbers + value in a Number methodthe sum
for numbers + * value in a Number methodthe product
for numbers + if value > 0 + valueonly the positive numbers
for texts + value in a Text methodall texts concatenated
for elements + value is other in a Boolean methodtrue if any iteration is true
for 100 to 9
for Range(2, 5)2, 3 and 4
for Range(0, 5).Reverse4 down to 0
Positives Numbers
    Kata((1, -2, 3)).Positives is (1, 3)
    for numbers
        if value > 0
            value

See For.

Lists and texts

(1, 2, 3).Length is 3
(1, 2, 3).Sum is 6
(1, 2, 3).First is 1
(1, 2, 3).Last is 3
(1, 2, 3) + 4 is (1, 2, 3, 4)
(1, 2, 3) - 3 is (1, 2)
(1, 2) * 3 is (3, 6)
(1, 2, 3).Reverse is (3, 2, 1)
(1, 2, 3).Index(2) is 1
"a,b".Split(",") is ("a", "b")
"hello".Substring(1, 3) is "ell"
"hello".IndexOf("ll") is 2
" hi ".Trim is "hi"

numbers(0) is the first element and numbers(-1) the last. See Lists and Dictionaries and Base Types.

Limits

120 characters per line, 13 lines per method, 4 parameters, 15 methods, 15 members, 5 nesting levels. Tabs only, no empty lines, no comments. See Coding Style.

Last updated on 10/17/2026 by Benjamin Nitschke
← Built with StrictTypes →
Docs
The VS Code ExperienceGetting StartedPlatformsBuilt with StrictLanguage GuideCheat SheetCoding Style
Source
Base TypesArchitectureExamplesQwen3 and Machine LearningC and C# Interop
More
BlogGitHubIssuesVS Code ExtensionWebsite SourceStar
Copyright © 2000-2026 Benjamin Nitschke