Polyscript is a Rust-like toy language with static typing, reference counting, and an LLVM AOT compiler.
NOTE: The documentation for this language is incomplete.
The language specification is divided into several parts:
- Syntax and Basics: Variables, primitive types, operators, and basic syntax.
- Control Flow:
if-else
expressions,for
andwhile
loops. - Compound Types: Defining
struct
andenum
types. - Functions and Closures: Defining and calling functions, differentiating functions from closures.
- Generics: Writing code that works with multiple types.
- Implementations and Traits: Defining behavior on types and describing types via shared behavior.
- Modules: Code organization using
import
andexport
. - Standard Library: Extra features provided by the native standard library.
- Memory Model: A deep dive into Polyscript's stack, heap, and reference counting system.
- Compiler Internals: An explanation of the compiler's architecture and compilation pipeline.
After compiling the compiler into an executable ./polyscriptcc
, running ./polyscriptcc --help
will give further instructions as to how to compile a Polyscript program. The native standard library is provided here.