Modules
Scripts can be split across multiple files. Exports are explicit — nothing is public unless marked. Host-registered types are always globally available and never need importing.
Exporting
Section titled “Exporting”Use export before any top-level declaration:
export class Sword { public damage: float = 15.0 public speed: float = 1.2
public func attack(target: Entity) { target.takeDamage(damage) }}
export func createSword(damage: float) -> Sword { return Sword(damage: damage)}
// Not exported — internal to this filefunc validateDamage(d: float) -> bool { return d > 0}Importing
Section titled “Importing”Named imports
Section titled “Named imports”Import specific names from a file. Path is relative, no extension:
import { Sword, createSword } from "weapons/sword"
let s = createSword(damage: 20.0)s.attack(enemy)Wildcard imports
Section titled “Wildcard imports”Import everything under a namespace:
import * as weapons from "weapons/sword"
let s = weapons::createSword(damage: 20.0)let blade: weapons::Sword = sUse :: for namespace access on wildcard imports — valid in both expression and type positions:
import * as weapons from "weapons/sword"
// Expression positionlet s = weapons::createSword(damage: 20.0)
// Type annotation positionlet blade: weapons::Sword = s
func equip(item: weapons::Sword) -> weapons::Sword { ... }- Named exports only — no default exports
- Host types are global —
Player,World, and anything the host registered are always available without importing - No circular imports — files can’t import each other
- Explicit beats implicit — if it’s not exported, it doesn’t exist outside the file
- Automatic resolution — import paths resolve relative to the importing file’s directory, with
.writappended automatically