โœ… 839 Tests Passing 59 Stdlib Modules Python 3.10+ โš ๏ธ Pre-stable โ€” v1.1 targets Q2 2026

The game-first
scripting language

InScript is a statically-typed scripting language with built-in game modules โ€” physics, audio, ECS, pathfinding, networking โ€” designed as a readable, safe GDScript alternative.

โšก Get Started ๐Ÿ“– Syntax Tour โญ GitHub
839
Tests Passing
59
Stdlib Modules
100+
Bugs Fixed
8.0
Audit Score / 10
  platformer.ins โ€” real example shipped with InScript
// Physics, input, collision โ€” all from the standard library
import "physics2d" as P
import "input"    as I
import "camera2d" as Cam

struct Player {
    pos: Vec2  vel: Vec2  health: int = 3

    fn update(dt: float) {
        let move = I.axis_x() * 180.0
        self.vel.x = move
        if I.just_pressed("jump") && self.on_ground() {
            self.vel.y = -400.0
        }
        self.pos += P.step(self, dt)
        Cam.follow(self.pos)
    }
}

// Result type for safe error handling
fn load_level(path: string) -> Result {
    let data = try { read_file(path) } catch e { return Err(e) }
    return Ok(parse_tilemap(data))
}
What InScript gives you
A complete scripting language for 2D games โ€” honest about what exists today.
๐Ÿงฑ

Structs + Inheritance

Full OOP with single/multi-inheritance, interfaces, mixins, operator overloading, priv/pub fields, and static members.

โœ… Complete
๐ŸŽฏ

Pattern Matching

Match on values, ADT enum variants, Result Ok/Err, with guards, binding, and match-as-expression.

โœ… Complete
โšก

Bytecode VM

Register-based VM with 60+ opcodes, closures, generators, and source-mapped error reporting. VM and interpreter are feature-identical.

โœ… Complete
๐Ÿ”’

Type System

Optional type annotations, inference, typed function parameters, and a static analyzer that warns on type mismatches, missing returns, and exhaustive matches.

โœ… Complete
๐ŸŒฟ

Generators

First-class generators via fn* / yield. Works in both the tree-walk interpreter and the bytecode VM path.

โœ… Complete
๐ŸŽฎ

2D Game Stdlib

Physics, input, camera, audio, tilemap, particles, pathfinding (A*), ECS, FSM, networking โ€” 59 modules total, all accessible via import.

โœ… Complete
๐Ÿ–ฅ๏ธ

Enhanced REPL

30+ commands including .doc module live docs, .vm mode toggle, .bytecode disassembly, and a built-in tutorial.

โœ… Complete
๐Ÿ“

LSP + VS Code

Language Server Protocol server (pygls-based) with completions, hover, and diagnostics. VS Code extension with syntax highlighting and snippets.

โœ… Complete
๐Ÿ”ง

Formatter + Debugger

Code formatter (inscript fmt) and DAP debugger for VS Code step-through debugging are the top priorities for v1.1.

๐Ÿ”œ v1.1
๐ŸŒ

Web Playground

Browser-based InScript playground using Pyodide. Write and run InScript directly in your browser with no install needed.

๐Ÿ”œ v1.1
๐Ÿ”ท

Union Types

First-class union types (type Shape = Circle | Rect), enforced generics, and null-safe types (int?) planned for v1.2.

v1.2
๐Ÿš€

C Extension (Speed)

Native C extension for hot paths targeting 5โ€“15ร— speedup over the current Python-based VM. Current fib(20) โ‰ˆ 200ms, target โ‰ˆ 15ms.

v1.3
How it works
Source โ†’ AST โ†’ Bytecode VM or tree-walk interpreter.
input.ins source
โ†’
Lexertokens
โ†’
ParserAST
โ†’
Analyzerwarnings
โ†’
Bytecode
Compiler60+ opcodes
โ†’
Register VM.ibc files

The VM and tree-walk interpreter are feature-identical โ€” switch modes with .vm in the REPL.

Syntax Tour
Inspired by Rust + Swift, designed for readability.
  Variables & Types
let x: int   = 42
let name     = "Ada"   // inferred
const PI     = 3.14159

// Destructuring
let [a, b, c] = [1, 2, 3]

// Null coalescing + optional chain
let name = user?.profile?.name ?? "Guest"

// Pipe operator
5 |> double |> add_one  // = 11
  Functions & Closures
fn greet(name: string = "World") -> string {
    return f"Hello {name}!"
}

// Named args, variadics
fn sum(*args) { return args.reduce(fn(a,b){return a+b}) }

// Closures capture by reference
fn counter() {
    let n = 0
    return fn() { n += 1; return n }
}
  Structs + OOP
struct Animal {
    name: string
    priv energy: float = 100.0
    fn speak() { print(self.name) }
}

struct Dog extends Animal {
    fn speak() {
        super.speak()
        print("Woof!")
    }
    fn +(other) { // operator overload
        return Dog{ name: self.name ++ "&" ++ other.name }
    }
}
  Error Handling
// Result type โ€” no exceptions by default
fn divide(a: float, b: float) -> Result {
    if b == 0.0 { return Err("div by zero") }
    return Ok(a / b)
}

// try-catch as expression
let safe = try { risky_fn() } catch e { 0 }

// Typed catch, finally
try { load() }
catch e: string { log(e) }
finally          { cleanup() }
  Pattern Matching
enum Shape { Circle(r: float)  Rect(w: float, h: float) }

let area = match shape {
    case Shape.Circle(r) { 3.14159 * r * r }
    case Shape.Rect(w, h) { w * h }
    case _ { 0.0 }
}

// Match guards
match score {
    case n if n >= 90 { print("A") }
    case n if n >= 70 { print("B") }
    case _ { print("C") }
}
  Generators + Collections
// Generator function
fn* fibonacci() {
    let a=0; let b=1
    while true { yield a; [a,b] = [b, a+b] }
}

// Array + dict comprehensions
let evens = [x for x in 1..=20 if x%2==0]
let inv  = {v: k for k,v in entries(myDict)}

// Rich array methods
scores.filter(fn(x){return x>60})
      .sorted()
      .take(10)
59 Standard Library Modules
All accessible via import "module" as M. All have .doc module documentation in the REPL.
math

sin/cos/tan, log, sqrt, floor/ceil, INF, NAN, constants

string

split, join, regex replace, case, pad, format, template

array

map/filter/reduce, sort, flatten, chunk, zip, group_by

json

encode/decode with pretty-print and error reporting

io

read/write files, append, exists, list_dir, watch

random

int/float/choice/shuffle, seed, weighted random

datetime

now, format, parse, diff, timezones, Duration type

collections

Set, Queue, Deque, PriorityQueue, RingBuffer, counter

regex

match, find_all, replace, named groups, compile

crypto

sha256, sha512, hmac, md5, bcrypt, random_bytes

uuid

v4, v1, short IDs, namespace UUIDs, validation

path

join, split, exists, dirname, basename, glob

fs

mkdir, rm, copy, move, permissions, stat

http

get/post/put/delete, headers, JSON body, timeout

database

SQLite: connect, query, insert, transaction, ORM-style

physics2d

AABB, circle, step, resolve, raycasting, gravity

tilemap

load, render, collision layer, pathfinding grid

camera2d

follow, shake, zoom, pan, parallax, bounds

input

key_down/up/pressed, mouse, gamepad, axis mapping

audio

play/stop, volume, music, spatial audio, effects

particle

emitter, burst, gradient color, physics-driven

ecs

World, spawn/despawn, component query, system schedule

fsm

StateMachine, transitions, enter/exit hooks, history

pathfind

A* on grid, diagonal, weighted tiles, smooth path

events

emit/on/off, once, wildcards, async events

net_game

GameServer/Client, UDP, sync vars, lobby, lag comp

save

save/load game state, slots, versioning, encryption

localize

i18n strings, plurals, date/number formatting, RTL

vec

v2/v3/v4, dot, cross, normalize, lerp, mat4 planned

tween

linear, ease-in/out, spring, chain, parallel tweens

+ 29 more

iter, template, format, color, image, atlas, animation, signal, pool, grid, bench, thread, debug, process, log, compress, url, base64, yaml, toml, csv, xml, ssl, hash, net, argparse, shader, input, scene

Install
Requires Python 3.10+ and pygame 2.x. No other dependencies.
  Install from source
# Requirements: Python 3.10+, pygame 2.x
pip install pygame pygls

# Clone and run
git clone https://github.com/authorss81/inscript
cd inscript/inscript_package

# Start the REPL
python inscript.py --repl

# Run a game example
python inscript.py examples/platformer.ins

# Check version
python inscript.py --version   # InScript 1.0.12

# Run all tests
python test_comprehensive.py   # 335/335 โœ…
  REPL quick start
> python inscript.py --repl

InScript v1.0.12 โ€” type .help for commands

>> let x = [1,2,3,4,5].filter(fn(n){return n%2==0})
>> print(x)
[2, 4]

>> .doc math         // live docs for any module
>> .vm               // switch to bytecode VM
>> .bytecode         // show disassembly
>> .tutorial         // interactive tutorial
Roadmap
Honest milestone tracking. No phantom features.
v1.0.0โ€“v1.0.12

Core Language Complete

โœ… Released March 2026
Included

59 Stdlib Modules

โœ… All working
Included

Bytecode VM

โœ… Feature parity
Included

LSP + VS Code Ext

โœ… Published
Included

839 Tests Passing

โœ… All green
v1.2.0 โ€” Q3 2026

Union Types + Generics

๐Ÿ“‹ Planned
v1.3.0 โ€” Q4 2026

C Extension 5โ€“15ร—

๐Ÿ“‹ Planned
v2.0.0 โ€” 2027

WASM + Package Hub

๐Ÿ“‹ Long term

Full details: ROADMAP.md

Honest Status
We think every language should tell you exactly where it stands.

โœ… What works today

โ€ข Full language (types, OOP, closures, generators, matching)
โ€ข 59 stdlib modules, all tested
โ€ข Bytecode VM with full feature parity
โ€ข LSP + VS Code extension
โ€ข Enhanced REPL with 30+ commands
โ€ข 839 tests passing (270+145+32+54+335+3)
โ€ข 6 game examples shipping with the repo
โ€ข Windows, macOS, Linux

โš ๏ธ What's missing

โ€ข inscript fmt code formatter
โ€ข Debugger (step-through in VS Code)
โ€ข pip install inscript not live yet
โ€ข Docs site URLs still 404
โ€ข No web playground yet
โ€ข async/await is synchronous only
โ€ข Generics are annotation-only (not enforced)
โ€ข ~40ร— slower than Python (C ext planned v1.3)