The site sections are under development.

The materials may be incomplete or contain errors. The site content will be synchronized with the implementation in the next release, while the current version (0.6.0) is intended for syntax prototyping and for creating the playground.

About the project

TrustLang is a programming language that is transpiled to C++ and built by an external compiler. The key properties of the model:

  • Rule-based grammar, not keyword-based — a simple single-pass parser and extensibility; the usual keyword-based notation is implemented by macros (Syntax, Macros).
  • Safe memory model without a garbage collector — RAII, strong/weak references, prohibition of strong cyclic references, stack protection (Safety and quality).
  • C/C++ — first-class integration — native types/functions/classes and templates, embed inserts, linking; taken into account in every context (Types).
  • Flexible typing and type inference — static and dynamic, automatic inference (Types).
  • Contracts and verification — pre/postconditions and assertions are checked by an SMT solver (Z3) (Verification).
  • Script-like launch — a file with the shebang #!.../trust --run runs directly, like a Python script, but with full compilation: transpilation to C++, build and launch of the binary happen automatically, no interpreter is needed.

Syntax

Concept and rules of the TrustLang programming language syntax

Data types

Description of the type system, the principles of automatic inference and conversion between types

Expressions and statements

Operators, expressions and control-flow constructs of TrustLang

Guarantees and safety

Overview of TrustLang features responsible for code safety and quality

Playground

Status and plans