TurtlScript is a statically typed programming language written in Go. It has type inference, optional type annotations, an interpreter with native JIT compilation and an interactive REPL, and an ahead-of-time compiler that builds standalone executables.
I started this project to learn how interpreters work, following Thorsten Ball's Writing an Interpreter in Go and adding a few features of my own.
A few years later, I returned to it with coding agents. The goal is to build a usable, performant language. It remains a personal project that I work on for fun.
TurtlScript supports signed 64-bit integers, UTF-8 strings, booleans, null, constants, functions, lexical closures, and recursion. The interpreter and compiler use the same parser and type checker.
The language is under active development. Collections, floating-point numbers, iteration, and modules are planned.
Use Go 1.27.2 or newer to build the command and try both execution modes:
go build -o turtls .
./turtls examples/functions.turtls
./turtls build -o functions examples/functions.turtls
./functionsRun ./turtls without arguments to start the REPL. Compiled programs run without Go or TurtlScript.
The interpreter compiles hot scalar functions to native code on supported amd64 and arm64 platforms. Other code continues through the interpreter. Use ./turtls -no-jit or ./turtls -no-jit file.turtls to disable it. See JIT compilation for supported code and platforms.
- Getting started
- Ahead-of-time compilation
- JIT compilation
- Language guide
- Types and constants
- Development and benchmarks
- Roadmap
The documentation index also links to the recorded performance reports.