Scripting Language.

About

What is Pitruck?

Pitruck is a dynamically-typed, interpreted scripting language implemented in Rust. It features a lightweight, C-style syntax with modern conveniences like optional chaining, null-coalescing, pattern matching, template strings, and first-class functions.

A major feature of Pitruck is its built-in HTTP server capabilities, allowing scripts to be instantly served as web endpoints with zero external dependencies. Version 1.6 introduces native HTTPS support for both outbound requests and inbound server mode, a persistent server store for cross-request state, permission controls for serve mode, and a program cache for faster repeated request handling.

Features

The usage cases of Pitruck

Modern syntax

Optional chaining, null-coalescing, ternaries, pattern matching, template strings with interpolation, and fat-arrow lambdas.

Built-in web server

Run pitruck --serve to expose a script or a whole directory as HTTP/HTTPS endpoints — no framework required.

Permission controls

Script mode is default-allow, serve mode is default-deny. Flags like --deny-net and --allow-all govern file, write, and network access.

Batteries included

Seven bundled libraries — color, math, struct, system, time, std, and trucky, a reactive web UI framework.

Module system

The bring keyword loads external .pr files across a predictable, layered search path.

Fast by design

Reference-counted values, hashed variable resolution, and a compiled-program cache keyed on file modification time.

Get Started

Try Pitruck

Clone the repository, read the technical reference, and run your first script.