Strict Programming Language

Strict Programming Language

  • Games
  • Playground
  • SCrunch
  • Performance
  • Docs
  • VS Code
  • Projects
  • Blog
  • GitHub

›Rules

Documentation

  • Overview
  • The VS Code Experience
  • Getting Started
  • 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

More

  • Using APIs
  • Concurrency
  • Microservices

Code Validations

After parsing, Strict runs a set of validation rules over every type. In other languages these would be warnings or linter hints. In Strict they are errors: the code isn't accepted until every issue is fixed. This keeps all code clean and makes sure every feature is used in exactly one way.

Run all validations on a package folder:

strict check Examples

Every issue is printed as RuleName: target, followed by Validation issues: N. The exit code is the number of issues.

The validators are written in Strict, in the Validators package. ValidateCheck runs TypeValidator, Limits and Names on each file. The VS Code extension shows the issues in the editor.

Type rules

RuleMeaning
UnusedMemberMustBeRemovedA private (lowercase) member is never used in any method of the type. Remove it.
UseConstantHereA has member is computed from constants only, like has number = 17 + 4. Make it a constant.

Method rules

These come from UsageRules and are checked for every method:

RuleMeaning
UnusedMethodVariableMustBeRemovedA constant, let or mutable variable is declared but never used.
UnusedMethodParameterMustBeRemovedA parameter is never used in the method.
VariableDeclaredAsMutableButValueNeverChangedA mutable variable is never reassigned or changed, so it should be let or constant.
ParameterMustNotBeMutableReturnTheChangedValueA parameter is mutable. Parameters never change: change a mutable copy and return it.
VariableHidesMemberUseDifferentNameA variable has the same name as a member.
ParameterHidesMemberUseDifferentNameA parameter has the same name as a member.
IsTrueIsNotNeededA test line ends in is true although its value already is a Boolean call, like Parity(2).IsEven is true. Write Parity(2).IsEven. Checked by TestChecks.

Name rules

These come from Names, see Naming:

RuleMeaning
CannotUseKeywordsAsNameA member, variable or parameter is named like a keyword, for example has from Text or let constant = 1.
ListPrefixIsNotAllowedUseImplementationTypeNameInPluralA member or method is named List… or list…. Use the plural of the element type instead, like numbers.
ConstantNameMustNotBeATypeOrMethodNameA constant has the name of a type or of a method of its type, like constant Number = 3.

Limits and formatting

These come from Limits, see Coding Style:

RuleMeaning
CharacterCountMustBeWithinLimitA line is longer than 120 characters.
MethodLengthMustNotExceedTwelveA method body is longer than 12 lines, so the method is more than 13 lines with its header.
NestingMoreThanFiveLevelsIsNotAllowedCode is indented more than 5 levels deep.
ExtraWhitespacesFoundAtBeginningOfLineA line is indented with spaces instead of tabs.
MethodCountMustNotExceedLimitA type has more than 15 methods.
MemberCountShouldNotExceedLimitA type has more than 15 members, or more than 40 constants if it only has constants.

Rules applied while compiling

Some rules are part of compiling a type rather than check:

  • Every method needs at least one test, see Tests.
  • Every name must be known: a member, parameter, variable, value, index, outer, or a type of this package, the base types or a referenced package. Expressions/FileCheck and Expressions/ResolveCheck report names that can't be resolved.
  • Types must fit: assigning, comparing or passing incompatible types is an error.
  • Constants are folded, and Validators/ConstantCollapser reduces constant subexpressions like "5" to Number to their value.

Feedback while editing

VS Code shows diagnostics on the affected source line, with quick fixes for formatting, unused values and naming issues. Checks also catch an incompatible return value or constructor argument (ReturnTypeMismatch for one element returned where a list is declared), an ambiguous name that is both a method and a type (AmbiguousName: write outer.Size.Width for the type or value.Size.Width for the method), a constant read through an instance instead of its type name (ConstantNeedsTypeName), a missing constant (ConstantNotFound), a dropped value and a method whose tested behavior already exists in a used type. MethodAlreadyExists points you toward the existing implementation.

Use Alt+Enter for a fix, Fix All for routine changes and F12 to read the existing method's tests. Line-value feedback lets you check the behavior after a change, alongside the static rules.

Last updated on 10/17/2026 by Benjamin Nitschke
← Coding StyleNaming →
Strict Programming Language
Docs
The VS Code ExperienceGetting StartedBuilt with StrictLanguage GuideCheat SheetCoding Style
Source
Base TypesArchitectureExamplesQwen3 and Machine LearningC and C# Interop
More
BlogGitHubIssuesVS Code ExtensionWebsite SourceStar
Copyright © 2026 strict-lang