X Tutup
Skip to content

Latest commit

 

History

History
164 lines (145 loc) · 10.5 KB

File metadata and controls

164 lines (145 loc) · 10.5 KB

< Home

DeltaScript – Language Specification

Version Published Author Implementation
0.1.0 January 16, 2025 Jordan Bunke Link

DeltaScript is a lightweight scripting language skeleton that is designed to be easily extended for the specification and implementation of domain-specific languages.

The language is in active development. As it is already in production as the scripting language used by Stipple Effect, it became necessary to publish a specification for the language.

DeltaScript is technically platform-agnostic. It can be implemented as a compiled language, or an interpreted language that targets any other programming language. However, the official implementation (latest version linked above) is an interpreter that targets Java.

This specification aims to provide an exhaustive description of how the language is designed, including its syntax, semantics, execution, and extension possibilities. Parts of this document employ advanced mathematical concepts, alongside formal mathematical notation and language. However, thorough explanations and external resources linked from within should ensure that the content remains accessible to non-experts. A strong mathematics and/or computer science background is helpful, but not required.

For a more beginner-friendly overview of the language, please see the guides section of the documentation.

Contents

  • 1.1 – Notation and terminology
    • 1.1.1 – Extended Backus–Naur Form
    • 1.1.2 – Terminology
    • 1.1.3 – Notation
  • 1.2 – Grammars
    • 1.2.1 – Lexical grammar
    • 1.2.2 – Syntax grammar
  • 1.3 – Notes on syntax
  • 2.1 – Type system
  • 2.2 – Simple types
    • 2.2.1 – Built-in types
    • 2.2.2 – Primitive vs. composite types
  • 2.3 – Collection types
  • 2.4 – Functional types
    • 2.4.1 – Parsing complex types
  • 2.5 – Type conversion
    • 2.5.1 – Implicit type conversion
    • 2.5.2 – Explicit type conversion (casting)
  • 3.1 – Variables
  • 3.2 – Declarations
  • 3.3 – Function parameters
  • 3.4 – Variable scope
  • 4.1 – Precedence
  • 4.2 – Nested expressions
  • 4.3 – Literals
    • 4.3.1bool literals
    • 4.3.2char literals
    • 4.3.3color literals
    • 4.3.4int literals
    • 4.3.5float literals
    • 4.3.6string literals
    • 4.3.7 – Escape sequences
  • 4.4 – Variables as expressions
  • 4.5 – Operators
    • 4.5.1 – Unary operators
    • 4.5.2 – Binary operators
    • 4.5.3 – Ternary operator
    • 4.5.4 – Compound assignment operators
  • 4.6 – Cast expressions
  • 4.7 – Function calls
    • 4.7.1 – Global function calls
    • 4.7.2 – Helper function calls
    • 4.7.3 – Scoped function calls
  • 4.8 – Helper function references
  • 4.9 – Anonymous functions
  • 4.10 – Array and list elements
  • 4.11 – Explicit collections
  • 4.12 – Collection initializers
  • 5.1 – Imperative programming
  • 5.2 – Statements
  • 5.3 – Declarations
  • 5.4 – Assignments
  • 5.5 – Void function calls
  • 5.6 – Conditional statements
    • 5.6.1if statements
    • 5.6.2when statements
  • 5.7 – Loops
  • 5.8return statements
  • 6.1 – Functions
  • 6.2 – Type signatures
    • 6.2.1 – Value-returning functions
    • 6.2.2 – Void functions
  • 6.3 – Types of functions
    • 6.3.1 – Header functions
    • 6.3.2 – Helper functions
    • 6.3.3 – Anonymous functions
    • 6.3.4 – Global functions
    • 6.3.5 – Member functions
    • 6.3.6 – Extension functions
  • 6.4 – Function objects
  • 6.5 – Function semantics
    • 6.5.1 – Parameters and arguments
    • 6.5.2 – Return path completeness
  • 7.1 – General
  • 7.2 – Parsing
  • 7.3 – Semantic analysis
  • 7.4 – Runtime execution
  • 7.5 – Errors
    • 7.5.1 – Syntax errors
    • 7.5.2 – Semantic errors
    • 7.5.3 – Runtime errors
  • 8.1 – Extensions philosophy
  • 8.2 – Extensions
  • 8.3 – Types in extensions
    • 8.3.1 – New types
    • 8.3.2 – Extending built-in types
  • 8.4 – Namespaces
X Tutup