About this project

Slate is a dynamically typed language using indentation for structure with a gradual type checker. It supports async/await on a real event loop, generators, modules, pattern matching, classes over prototypes, and algebraic data types. Designed for API servers, it handles HTTP (via llhttp), HTTP/2 (via nghttp2), TCP, TLS, file system operations, processes, regex, and JSON. The language compiles to JavaScript, enabling the same program to run under its interpreter, Node.js, QuickJS, or in browsers using the Lath framework. The `slate js` command outputs a single self-contained JavaScript file including runtime and framework, eliminating bundlers and node_modules. Gradual typing allows optional annotations; type declarations serve for both pattern matching and runtime checks. Features include postfix `match` expressions, generic types, and async functions returning promises. API servers use built-in router and handler systems. Scripts support shebang execution. Implementation uses a stack machine and tracing garbage collection (due to closure cycles), with an event loop built on libuv. Available for macOS Apple silicon via Homebrew; other platforms require source builds. Documentation includes language and library references. Notable omissions include literate programming support and some standard library modules for JavaScript backend. The `defer` statement is deliberately excluded due to garbage collection.