A unique programming language with its own syntax, a built-in HTTP server, and everything you need to build real web applications. No npm. No packages. Just code.
let page = readFile("index.html");
httpListen(3000, (req) => {
if (req.path is "/") {
return page;
}
return "404";
});
Everything you need, nothing you don't.
No more print() — use show(). No == — use is. unless instead of if not. PT has its own identity that reads like English.
Register-based bytecode with computed goto dispatch. 168x faster than v1.
Single binary. No packages, no npm, no build step. Just ./pt server.pt.
One line to start a web server. httpListen(3000, handler) and you're live. Route matching, request/response objects included.
httpGet, httpPost, httpPut, httpDelete built-in. Call any API without external libraries.
Read and write files with readFile() and writeFile(). Check existence with fileExists().
Powerful match expressions with => syntax for clean, readable branching. Wildcards, guards, destructuring.
Full OOP with classes, inheritance, this, super, static methods, constructors, and method overriding. Encapsulation done right.
sqliteOpen, sqliteQuery, sqliteExec — database access without any drivers. Zero configuration.
hash(), base64Encode(), base64Decode(), uuid() built-in. No external deps.
spawn() runs functions in background threads. sleep() for timing. Non-blocking by design.
Functions capture their enclosing scope. Lexical scoping with mutable state. First-class functions.
See how PT compares to other languages.
let name = "World";
unless name is "" {
show("Hello, " + name + "!");
}
let nums = [1, 2, 3, 4, 5];
let big = nums.filter((x) => x > 3);
show(big); // [4, 5]
name = "World"
if name != "":
print(f"Hello, {name}!")
nums = [1, 2, 3, 4, 5]
big = [x for x in nums if x > 3]
print(big) # [4, 5]
Install PT and build your own web server in 10 lines.
git clone the repo and make
Write your routes with httpListen
./pt server.pt — live at localhost:3000
let page = readFile("index.html");
httpListen(3000, (req) => {
if (req.path is "/") {
return page;
}
if (req.path is "/api/hello") {
return "{message: Hello!}";
}
return {status: 404, body: "Not Found"};
});
Start building in seconds. Pick a template and start coding.
Markdown posts, tags, RSS feed
View Source →JSON API, categories, priorities
View Source →Routes, middleware, error handling
View Source →Rooms, usernames, message history
View Source →Charts, tables, user management
View Source →PT includes a bytecode VM with optimizations. Here's how it compares:
Full benchmarks: bench/COMPARISON.md