Learn Langoost
Everything about the language as it takes shape — from a first
Hello, world to structured concurrency. Start with the tour,
then dive into the topics below.
Get started
What is Langoost?
Langoost is a statically-typed scripting language that compiles to bytecode and runs on a fast stack-based VM. Built for backend scripting — like PHP, but with no per-request cold start.
Read →Install & run
How to build Langoost from source with Go and run your first .goost script, start the REPL, or launch the persistent execution server.
Read →Language
Language tour
A fast tour of Langoost syntax — variables, types, functions, control flow, arrays, objects, template strings, classes, and error handling, with runnable examples.
Read →Types & values
Langoost's value types — int, float, bool, string, array, object, void/nil, any, and the json/yaml/xml data types — plus number literals, template strings, and conversion.
Read →Functions
Functions in Langoost — declarations, optional type annotations, anonymous functions and closures, variadic parameters, the spread operator, recursion, and hoisting.
Read →Value methods
Built-in methods you can call directly on Langoost values — string methods, array methods, and numeric methods on int, float, and bool.
Read →Classes & types
Object-oriented Langoost — class declarations, methods, single inheritance with extends and super, named type declarations, and object construction.
Read →Control flow
Conditionals and loops in Langoost — if / else if / else, while, for..in over arrays and ranges, and the break and continue loop-control keywords.
Read →Arrays
Working with arrays in Langoost — literals, indexing, negative indices, the append built-in, and the full set of array methods like map, filter, reduce, push, and sort.
Read →Error handling
Handling errors in Langoost with try, catch, throw, and defer, plus the runtime.error and runtime.panic helpers.
Read →Modules & imports
Importing standard-library and local modules in Langoost — namespace imports, named imports, sub-module access, and module resolution order.
Read →Backend
HTTP server
Build an HTTP API in Langoost with http.serve and a handler function that receives method, path, query, and body, and returns a string response.
Read →Concurrency
Concurrency in Langoost with the thread module — spawning goroutines, async futures, channels, mutexes, and sharing state across isolated VMs.
Read →Web libraries
Pure-Langoost libraries for serving HTTP with Request/Response types, WebSockets, and Server-Sent Events.
Read →Standard library
Standard library overview
Index of the Langoost standard library — text, data, encoding, math, collections, time, filesystem, OS, networking, crypto, data stores, and concurrency modules.
Read →strings
String utilities — search, slice, split, join, replace, trim, case, padding, classification, formatting, and a string builder.
Read →regex
Regular expressions in Langoost — match, find, findAll, replace, split, capture groups, and pattern validation.
Read →types
Runtime type checks and conversions for int, float, bool, char, string, and null/void.
Read →json
Parse, query, edit, merge, and pretty-print JSON, plus streaming parse of arrays and NDJSON.
Read →yaml
Parse and serialize YAML, and convert between YAML and JSON.
Read →xml
Validate, pretty-print, query, and convert XML to JSON or an object tree.
Read →url
Parse and build URLs and query strings, with percent-encoding helpers.
Read →encode
Encoding helpers — base64, hex, CSV, binary integers/floats, and JSON/XML, organized into submodules.
Read →serialize
Binary serialization with msgpack and a simplified protobuf, to and from JSON strings.
Read →compress
Compress and decompress data with gzip, zlib, lz4, and brotli. All I/O is base64.
Read →math
Math utilities — basic arithmetic, trig, logarithms, random, constants, bitwise ops, clamping, and interpolation.
Read →collections
Data structures — stack, queue, set, ordered map, heap, trie, ring buffer, list, tuple, and array helpers.
Read →time
Time and dates — clock, date components, timers/sleep, durations, and formatting, organized into submodules.
Read →date
Convenience date API over Unix timestamps — now, parse, format, component extraction, and arithmetic.
Read →timer
Async timers — setTimeout, setInterval, and clear, with callback functions.
Read →io
Filesystem access — read/write/append files, directories, streaming for large files, and path helpers.
Read →os
Operating-system access — environment, process info, signals, permissions, syscall info, and args.
Read →exec
Run shell commands and programs, read exit codes, and access env and the working directory.
Read →signal
Register POSIX signal handlers (SIGINT, SIGTERM, etc.) with callback functions.
Read →terminal
Terminal/TUI control — raw mode, key reading, size, and ANSI colors, cursor, and screen sequences.
Read →runtime
Runtime introspection and a process-global shared key-value store, plus reflect, error, panic, and env helpers.
Read →memory
Byte buffers, string interning pools, and allocator/GC introspection.
Read →logging
Leveled logging — debug, info, warn, error, fatal — with a global debug toggle.
Read →net
Networking — TCP, UDP, TLS, DNS, and an HTTP client, using integer connection handles.
Read →http
HTTP client — get, post, put, patch, delete, head, status, and a generic request with custom headers.
Read →crypto
Cryptography — hashing, HMAC, AES, RSA, Ed25519, secure random, certificates, and TLS info.
Read →redis
Redis client — connect and run key/value, list, hash, and pub/sub commands over integer handles.
Read →sql
SQL databases — open SQLite, Postgres, or MySQL and run exec, query, queryOne, queryValue, and transactions.
Read →mongo
MongoDB client for Langoost — connect and run insertOne, insertMany, find, findOne, updateOne, deleteOne, and count over an integer handle.
Read →Reference
CLI reference
The langoost command-line interface — run scripts, start the REPL, launch the persistent HTTP server, disassemble bytecode, and print the version.
Read →Architecture
How Langoost works under the hood — the lexer/parser/compiler/VM pipeline, the 4-byte bytecode format, the stack model, the module cache, and per-request VM isolation.
Read →