FAQ

Frequently asked questions

Short answers about Langoost — the language, its design, and where it stands.

What is Langoost?

Langoost is a statically-typed scripting language that compiles to bytecode and runs on a fast, stack-based virtual machine. It is designed for backend scripting — similar to PHP, but a single long-running process handles every request with no per-request cold start.

What file extension does Langoost use?

Langoost source files use the .goost extension.

How is Langoost different from PHP?

Like PHP, Langoost is aimed at backend request handling. Unlike a typical PHP setup, Langoost runs as a persistent process: compiled modules are cached and reused across requests, so there is no cold start. Each request still executes in its own isolated VM with a private stack, so requests never share mutable state.

Is Langoost statically typed?

Langoost has type annotations in TypeScript style — let x: int = 1, fn add(a: int, b: int): int. Annotations are currently optional and serve as documentation and editor hints; static enforcement is being added incrementally. Values themselves are strongly typed at runtime.

What types does Langoost have?

The value types are int, float, bool, string, array, object, void (nil), and any, plus the data types json, yaml, and xml. Arrays are written with a [] suffix on the element type, e.g. int[]. Number literals support decimal, hex (0xFF), binary (0b1010), octal (0o755), and underscores.

Does Langoost support classes and objects?

Yes. Langoost has object literals ({key: value}, which double as maps), named type declarations (type User = {...}), and classes with methods and single inheritance via extends and super. Instances are created with ClassName{...}; there are no constructors, so fields are set in the literal.

How does error handling work in Langoost?

Langoost uses try / catch / throw / finally for recoverable errors and defer for cleanup that always runs (in LIFO order) when a function returns. A finally block runs on every exit path, including a re-throw from catch. You can throw any value, including an object carrying structured detail. The runtime module adds runtime.error and runtime.panic helpers.

Does Langoost support interfaces or generics?

Langoost has runtime-checked interfaces: declare one with interface Name { fn method() }, test a value with x is Name (returns a bool), and assert with x as Name (returns the value or throws an InterfaceMismatch error). The check walks a class's parent chain. Generics are deferred for now, since without static type checking they would be cosmetic.

Which databases and data stores can Langoost talk to?

The standard library includes a sql module (SQLite, PostgreSQL, and MySQL), a redis client (key/value, lists, hashes, pub/sub), and a mongo client (insert, find, update, delete, count). It also has http and net clients and filesystem watching via io.watch.

Does Langoost have a standard library?

Yes — a large one ships in the box: strings, math, date, time, io, net, http, exec, json, yaml, xml, compress, crypto, encode, serialize, collections, types, os, runtime, thread, logging, and memory. Import any of them with import modulename.

How does Langoost handle concurrency?

Concurrency lives in the thread module and is VM-based: each spawned function runs in its own isolated VM with a copy of the current globals. It provides goroutines, async futures, typed channels, mutexes, semaphores, atomics, and worker pools. Shared state is explicit, via the runtime.core key-value store.

How do I run a Langoost program?

Build the langoost binary from source with Go (go build -o langoost .), then run a script with ./langoost run script.goost. There is also a REPL (./langoost repl), a persistent HTTP server mode (./langoost server), and a bytecode disassembler (./langoost disasm).

Can I download a prebuilt Langoost binary?

Not yet. Langoost is in active development; today you build it from source with the Go toolchain. Prebuilt binaries are planned for a later release.

What is Langoost implemented in?

Langoost is a bytecode-compiled interpreter written in Go. Source flows through a lexer, parser, compiler, and stack-based VM. Instructions are fixed-width 4-byte words (8-bit opcode, 24-bit operand).

Didn’t find your answer? Read the documentation or the language tour.