Chester is a statically-typed functional language that compiles to TypeScript, featuring an advanced effect system and seamless JavaScript/TypeScript interoperability.
Warning
Chester is under active development. The language design and implementation are not stable.
- TypeScript Backend - Compiles to readable TypeScript code
- Effect System - Track and manage side effects with CPS transformation
- JS/TS Interop - Import npm packages with automatic type extraction
- Multi-Platform - Runs on JVM, JavaScript, and Native
- Developer Tools - REPL, LSP server, IntelliJ plugin, web REPL
sbt cliJVM/assembly# Start REPL
java -jar modules/cli/jvm/target/scala-3.7.4/cli-assembly-*.jar
# Run a file
java -jar modules/cli/jvm/target/scala-3.7.4/cli-assembly-*.jar hello.chester
# Compile to TypeScript
java -jar modules/cli/jvm/target/scala-3.7.4/cli-assembly-*.jar ts src/ --output distFor detailed setup, see Getting Started in the documentation.
📚 Full documentation is available in the docs/ directory:
- Getting Started - Build and run your first program
- CLI Usage - Command-line interface guide
- Language Guide - Syntax and features
- Development Docs - Internals and architecture
cd docs
./dev.sh build
# or serve locally:
./dev.sh serveThe marketing site lives in site/ and uses the latest Next.js and React stack.
cd site
pnpm install
pnpm dev # start the dev server
pnpm build # production buildYou can also run the same commands from sbt:
sbt "site/pnpmDev" # dev server
sbt "site/pnpmBuild" # production buildThe browser REPL reuses the CLI. Build the Scala.js bundle and copy it into site/public/scala:
sbt webRepl/copyWebReplThen run the site (pnpm dev) and open /repl. If the bundle is missing, the page will show an error with the command to build it.
To run the site tests (including the REPL mock), build the bundle first and then:
cd site
pnpm testchester/
├── modules/ # Source code
│ ├── cli/ # Command-line interface
│ ├── core/ # Parser, type checker, backends
│ ├── lsp/ # Language Server Protocol
│ ├── utils/ # Shared utilities
│ ├── web-repl/ # Browser REPL (Scala.js)
│ └── intellij-plugin/ # IntelliJ integration
├── site/ # Next.js website
├── docs/ # Documentation (mdbook)
├── vendor/ # Vendored dependencies
└── build.sbt # Build configuration
See Module Structure for details.
module example;
import "chalk"; // Import npm packages
def greet(name: String): IO Unit = {
let message = chalk.green("Hello, " ++ name ++ "!");
println(message)
};
def main: IO Unit = greet("World");
Compile to TypeScript:
chester ts example.chester --output dist- Language: Scala 3.7.4
- Build Tool: sbt
- Platforms: JVM, JavaScript (Scala.js), Native (Scala Native)
# Compile all modules
sbt compile
# Run tests
sbt test
# Build CLI
sbt cliJVM/assembly
# Build native binary (faster startup)
sbt cliNative/nativeLink- Previous Version: https://github.com/chester-lang/chester2025draft (IDE plugins are for the previous version)
- Website Domain: https://the-lingo.org/ (subject to change)
See LICENSE.md