Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.37 KB

File metadata and controls

29 lines (22 loc) · 1.37 KB

1.2 Features

Pilang combines a small C implementation with language features expected from a general-purpose scripting language.

Language Features

  • Dynamic values: numbers, strings, booleans, nil, lists, maps, ranges, slices, objects, and tensors.
  • Mutable let variables, const bindings, expressions, assignment operators, and assignment expressions.
  • Control flow with if, elif, else, while, for, break, continue, and return.
  • First-class functions, anonymous functions, arrow functions, closures, recursion, and higher-order helpers.
  • Object-oriented programming with objects, classes, constructors, methods, inheritance, and magic methods.
  • Modules for organizing code and importing built-in or user-defined functionality.
  • Operator support for arithmetic, comparison, logic, assignment, special operations, and overloadable behavior.

Runtime And Library Features

  • C-based interpreter and VM.
  • Garbage-collected object memory.
  • Command-line execution of .pi files.
  • Built-in modules for collections, drawing, files, functional helpers, I/O, language constants, math, OS integration, plotting, statistics, strings, system information, tensors, time, and types.
  • WebAssembly/browser build support in addition to the native executable.
  • VS Code syntax extension files under editors/vscode.

Example

values = [1, 2, 3, 4];
println(values);