# Langoost > Langoost is a statically-typed scripting language that compiles to bytecode and runs on a fast stack-based virtual machine. Built for backend scripting — like PHP, but a long-running process serves every request with no cold start, and a batteries-included standard library is built in. - Status: Open source · in active development - File extension: .goost - Toolchain binary: langoost - Full text for LLMs: https://langoost.dev/llms-full.txt ## Documentation - [What is Langoost?](https://langoost.dev/docs/introduction.md): 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. - [Install & run](https://langoost.dev/docs/installation.md): How to build Langoost from source with Go and run your first .goost script, start the REPL, or launch the persistent execution server. - [Language tour](https://langoost.dev/docs/language-tour.md): A fast tour of Langoost syntax — variables, types, functions, control flow, arrays, objects, template strings, classes, and error handling, with runnable examples. - [Types & values](https://langoost.dev/docs/types.md): 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. - [Functions](https://langoost.dev/docs/functions.md): Functions in Langoost — declarations, optional type annotations, anonymous functions and closures, variadic parameters, the spread operator, recursion, and hoisting. - [Value methods](https://langoost.dev/docs/methods.md): Built-in methods you can call directly on Langoost values — string methods, array methods, and numeric methods on int, float, and bool. - [Classes & types](https://langoost.dev/docs/classes.md): Object-oriented Langoost — class declarations, methods, single inheritance with extends and super, named type declarations, and object construction. - [Control flow](https://langoost.dev/docs/control-flow.md): Conditionals and loops in Langoost — if / else if / else, while, for..in over arrays and ranges, and the break and continue loop-control keywords. - [Arrays](https://langoost.dev/docs/arrays.md): 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. - [Error handling](https://langoost.dev/docs/error-handling.md): Handling errors in Langoost with try, catch, throw, and defer, plus the runtime.error and runtime.panic helpers. - [Modules & imports](https://langoost.dev/docs/modules.md): Importing standard-library and local modules in Langoost — namespace imports, named imports, sub-module access, and module resolution order. - [HTTP server](https://langoost.dev/docs/http-server.md): 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. - [Concurrency](https://langoost.dev/docs/concurrency.md): Concurrency in Langoost with the thread module — spawning goroutines, async futures, channels, mutexes, and sharing state across isolated VMs. - [Web libraries](https://langoost.dev/docs/web-libraries.md): Pure-Langoost libraries for serving HTTP with Request/Response types, WebSockets, and Server-Sent Events. - [Standard library overview](https://langoost.dev/docs/stdlib.md): Index of the Langoost standard library — text, data, encoding, math, collections, time, filesystem, OS, networking, crypto, data stores, and concurrency modules. - [strings](https://langoost.dev/docs/stdlib/strings.md): String utilities — search, slice, split, join, replace, trim, case, padding, classification, formatting, and a string builder. - [regex](https://langoost.dev/docs/stdlib/regex.md): Regular expressions in Langoost — match, find, findAll, replace, split, capture groups, and pattern validation. - [types](https://langoost.dev/docs/stdlib/types.md): Runtime type checks and conversions for int, float, bool, char, string, and null/void. - [json](https://langoost.dev/docs/stdlib/json.md): Parse, query, edit, merge, and pretty-print JSON, plus streaming parse of arrays and NDJSON. - [yaml](https://langoost.dev/docs/stdlib/yaml.md): Parse and serialize YAML, and convert between YAML and JSON. - [xml](https://langoost.dev/docs/stdlib/xml.md): Validate, pretty-print, query, and convert XML to JSON or an object tree. - [url](https://langoost.dev/docs/stdlib/url.md): Parse and build URLs and query strings, with percent-encoding helpers. - [encode](https://langoost.dev/docs/stdlib/encode.md): Encoding helpers — base64, hex, CSV, binary integers/floats, and JSON/XML, organized into submodules. - [serialize](https://langoost.dev/docs/stdlib/serialize.md): Binary serialization with msgpack and a simplified protobuf, to and from JSON strings. - [compress](https://langoost.dev/docs/stdlib/compress.md): Compress and decompress data with gzip, zlib, lz4, and brotli. All I/O is base64. - [math](https://langoost.dev/docs/stdlib/math.md): Math utilities — basic arithmetic, trig, logarithms, random, constants, bitwise ops, clamping, and interpolation. - [collections](https://langoost.dev/docs/stdlib/collections.md): Data structures — stack, queue, set, ordered map, heap, trie, ring buffer, list, tuple, and array helpers. - [time](https://langoost.dev/docs/stdlib/time.md): Time and dates — clock, date components, timers/sleep, durations, and formatting, organized into submodules. - [date](https://langoost.dev/docs/stdlib/date.md): Convenience date API over Unix timestamps — now, parse, format, component extraction, and arithmetic. - [timer](https://langoost.dev/docs/stdlib/timer.md): Async timers — setTimeout, setInterval, and clear, with callback functions. - [io](https://langoost.dev/docs/stdlib/io.md): Filesystem access — read/write/append files, directories, streaming for large files, and path helpers. - [os](https://langoost.dev/docs/stdlib/os.md): Operating-system access — environment, process info, signals, permissions, syscall info, and args. - [exec](https://langoost.dev/docs/stdlib/exec.md): Run shell commands and programs, read exit codes, and access env and the working directory. - [signal](https://langoost.dev/docs/stdlib/signal.md): Register POSIX signal handlers (SIGINT, SIGTERM, etc.) with callback functions. - [terminal](https://langoost.dev/docs/stdlib/terminal.md): Terminal/TUI control — raw mode, key reading, size, and ANSI colors, cursor, and screen sequences. - [runtime](https://langoost.dev/docs/stdlib/runtime.md): Runtime introspection and a process-global shared key-value store, plus reflect, error, panic, and env helpers. - [memory](https://langoost.dev/docs/stdlib/memory.md): Byte buffers, string interning pools, and allocator/GC introspection. - [logging](https://langoost.dev/docs/stdlib/logging.md): Leveled logging — debug, info, warn, error, fatal — with a global debug toggle. - [net](https://langoost.dev/docs/stdlib/net.md): Networking — TCP, UDP, TLS, DNS, and an HTTP client, using integer connection handles. - [http](https://langoost.dev/docs/stdlib/http.md): HTTP client — get, post, put, patch, delete, head, status, and a generic request with custom headers. - [crypto](https://langoost.dev/docs/stdlib/crypto.md): Cryptography — hashing, HMAC, AES, RSA, Ed25519, secure random, certificates, and TLS info. - [redis](https://langoost.dev/docs/stdlib/redis.md): Redis client — connect and run key/value, list, hash, and pub/sub commands over integer handles. - [sql](https://langoost.dev/docs/stdlib/sql.md): SQL databases — open SQLite, Postgres, or MySQL and run exec, query, queryOne, queryValue, and transactions. - [mongo](https://langoost.dev/docs/stdlib/mongo.md): MongoDB client for Langoost — connect and run insertOne, insertMany, find, findOne, updateOne, deleteOne, and count over an integer handle. - [CLI reference](https://langoost.dev/docs/cli.md): The langoost command-line interface — run scripts, start the REPL, launch the persistent HTTP server, disassemble bytecode, and print the version. - [Architecture](https://langoost.dev/docs/architecture.md): 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. ## Examples - [Hello, world](https://langoost.dev/examples/hello-world.md): The smallest Langoost program — declare a variable and print a greeting with string concatenation. - [FizzBuzz](https://langoost.dev/examples/fizzbuzz.md): FizzBuzz in Langoost using for..in with range and if / else if / else. - [Prime numbers](https://langoost.dev/examples/primes.md): Find prime numbers in Langoost — a recursive-free isPrime check, a while loop, and the immutable append pattern for building an array. - [HTTP server](https://langoost.dev/examples/http-server.md): A small JSON HTTP server in Langoost using http.serve and a handler that routes on method and path and returns string responses with status prefixes. - [HTTP client](https://langoost.dev/examples/http-client.md): Make HTTP requests in Langoost — GET, POST, and a generic request with custom headers using the http module. - [Concurrency](https://langoost.dev/examples/concurrency.md): Background work in Langoost with the thread module — spawn a goroutine, pass messages over a channel, and await an async future. - [JSON data](https://langoost.dev/examples/json-data.md): Build and manipulate JSON in Langoost using inline json literals and the json module — get, set, merge, and pretty-print. ## More - [FAQ](https://langoost.dev/faq): Frequently asked questions about Langoost.