Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

pascak

pascak is a Pascal-style scripting language with the power of Python, developed to run on any device that has a Pascak virtual machine (PVM). ///Note: 100% hobby; 100% written by deepseek (free version); device used 100% realme2 pro; compiler used freepascal on termux; not tested on any OS (windows, linux, etc.)

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

Pascak VM

Pascal-style scripting language with Python's expressiveness. Runs on any device with the Pascak VM (Termux, Linux, Windows, macOS).

What is Pascak?

Full-stack scripting language implemented in FreePascal. Single static binary (~3 MB) — no runtime dependencies beyond standard C libraries.

Design goals:

  • Fast startup — ~2 ms cold start (bytecode cache)
  • Batteries included — HTTP/1.1 + HTTP/2, WebSocket, TLS, SQLite, crypto, FFI, timers, async
  • Modern language — destructuring, optional chaining (?.), null-coalescing (??), enums, coroutines
  • Two GUIs — browser-based (HTML + WS RPC) and native (SDL2, 48 API)
  • Cross-platform — Termux, Linux, Windows, macOS

Quick Start

pascal
begin
  var greeting := "Hello";
  var name := "World";
  println(f"{greeting}, {name}!");
end.

Save as hello.pas, then run pascak hello.pas.

Installation

Termux (Android)

pascal
pkg install fpc git
git clone https://github.com/baddcoin/pascak
cd pascak
fpc -Mobjfpc -Sh pascak_noASTnet.pas
cp pascak_noASTnet $PREFIX/bin/pascak

Linux / macOS (FPC 3.2+)

pascal
git clone https://github.com/baddcoin/pascak
cd pascak
fpc -Mobjfpc -Sh pascak_noASTnet.pas
sudo cp pascak_noASTnet /usr/local/bin/pascak

Features at a Glance

Category Features
Language Destructuring (obj/array/nested/rest), ?. optional chaining, ?? null-coalescing, enums, lambdas, F-strings, ternary, list comprehension, class inheritance, try/catch/finally
Async Coroutines (yield), timers, worker pool, event loop
Network HTTP/1.1, HTTP/2 (multiplexing, retry, flow control, rate limit), WebSocket, TLS
Data SQLite, JSON, dict, array, regex, base64, crypto (SHA/AES/HMAC/PBKDF2)
GUI Browser (HTTP + WS RPC), Native SDL2 (window, drawing, keyboard, audio)
Dev Tools LSP (hover, completion, definition), linter, formatter, test runner, REPL, hot-reload
Security Sandbox, exec policy, rlimit, env sanitize

Examples

Full collection in examples/ (30+ files):

pascal
pascak examples/http_server.pas
pascak examples/todo_gui.pas
pascak examples/hello_gui2.pas
pascak examples/parallel_fetch.pas
pascak examples/lang_v110.pas

Documentation

File Content
docs/tutorial.md 31+ chapters, zero to full-stack app
docs/pascak_api.md Complete API reference
docs/cookbook.md 14 production recipes
CHANGELOG.md Version history (v0.4.0 to v1.8.0 chain)

Dev Workflow

Hot-reload with browser auto-reload:

pascal
tools/pascak_dev.sh 'src/,app.pas' app.pas --hot

Edit app.pas → browser auto-reload → fresh code live. Graceful shutdown, no dropped WS connections.

LSP

pascal
pascak --lsp

Works with VSCode, Neovim, and other LSP clients. Signature help, hover types, go-to-definition.

REPL

pascal
pascak --repl

Project Status

  • Core VM (95%+)
  • Standard library (98%+)
  • Network stack (HTTP/1, HTTP/2, WS, TLS) (99%+)
  • Browser GUI (HTTP + HTTPS)
  • Native GUI (SDL2, 48 API)
  • Language features (JS-modern parity: destructuring, optional chaining, null-coalescing, enum)
  • Dev tools (LSP, linter, formatter, test runner, hot-reload)
  • Embedding (subprocess + in-process)
  • Cross-platform (Termux, Linux, Windows, macOS)

See CHANGELOG.md for detailed milestone history.

Contributing

Bug reports, feature requests, and PRs welcome. See docs/cookbook.md for recipe contribution guidelines.

License

MIT - same as FreePascal ecosystem.