Repository navigation
PaskalCPP v0.2.0
PaskalCPP 0.2.0 -- Libraries in the box
PaskalCPP is a minimal, Pascal and Oberon inspired systems programming language that compiles to C++23 and mixes freely with C++ in the same source file, so every C and C++ library is available with no bindings. The compiler writes a C++23 header and source for each module and builds them with the bundled Zig toolchain (clang): one pcpp command turns a .pcpp file into a native binary.
This release fills the box. 0.1.0 brought raylib in with one import; now thirteen C and C++ libraries do, each rebuilt from its official release for both targets. Beside them comes PaskalCPP's own standard library, nine new units: paths and files, maths, the console, data built into the binary, streams over memory, files and zip archives, C stdio on those streams, and loaders for raylib and SFML that read straight from a zip. Twenty-nine examples, up from one, show them working on Windows and Linux.
Highlights
- Vendor libraries, one
importaway -- raylib 6.2, SDL 3.4.18, SFML 3.1.0, GLFW 3.5.1, Box2D 3.2.0, miniaudio 0.11.25, cgltf 1.15, zlib 1.3.2 with minizip, pl_mpeg, rlImGui, SDL_gp and fifteen stb libraries, built as static libraries for x86_64-windows-gnu and x86_64-linux-gnu.import raylib;sets up the include path, library path and link libraries, and the program calls raylib's own API. A Linux build finds libX11, libGL and the headers zig lacks in the bundledlinux64folder, so a vendor import builds the same way on both targets. - A standard library --
SysUtils(ResolvePath,ExeDir,FileExists,Delay,FormatStr),Math(clamping, easing, a perceived-volume curve, seedable random numbers, 2D geometry),Console(colours, cursor control, text measured in terminal columns) andResData, all in PaskalCPP syntax and documented name by name. - Streams and zip archives --
CustomIOgives streams behind a table of callbacks, in the style of SDL3: over memory, files, folders and zip archives (ZIP64, deflated, password-protected), whose deflated entries seek without starting over. - C libraries read from a zip --
HookIOregisters a stream under a prefixio://<n>, and from then on C'sfopenof that path opens it, in the program or inside any C library linked into it.HookABI, which HookIO is built on, hooks C ABI functions at link time and at run time. - raylib and SFML extensions --
raylib_extgives every raylib loader an IO form, makes a zip raylib's file system and plays MPEG-1 video;sfml_extadds a DPI-scaling window with a letterbox frame, zip streams, video, a mixer, message boxes and a built-in default font to SFML 3. - Data built into the binary --
@addresdata "key" "path";builds a file into the exe, dll or lib on both targets, andResData.FindResData("key")reads it back at run time. On Linux,@exeiconis built in the same way, and the raylib and SFML windows show the program's icon on both targets. - Imported names without the unit name -- a name is read bare (
Area) when exactly one imported unit exports it; when two do, the bare use is an error and the name is qualified (shapes.Area), so import order never decides. The editor offers imported names in completion. - Documentation for all of it -- new Standard library and Vendor libraries pages; the Standard library page is generated from each unit's own
///doc comments every time the docs are built.
New
pcpp --clean [<folder>] [--dry-run]-- clears a pcpp output folder (the current folder when none is given) after checking that the folder is pcpp's own;--dry-runlists what would go.- String consts as format strings --
println(KFormat, ...)andFormatStr(KFormat, ...)take a string const as the format, checked when the program is built like a literal; format mistakes are reported in PaskalCPP's words. - The debugger shows a module's consts under
Globals:, andpreads them. - The editor's terminal copies and pastes as VS Code's does: Ctrl+C with a selection, Ctrl+Shift+C, Ctrl+V, Ctrl+Shift+V and a right-click Copy / Paste menu.
- Shared example assets -- the examples read their textures, sounds, fonts and videos from one password-protected
bin\assets.zip, built on first use frombin\res\assets.
Changed
- Breaking: the optimize levels are
debug,safe,fastandsmall, zig 0.17's own names (wererelease_safe,release_fast,release_small). An old name in@optimizeor-optis an error whose hint names the new one; the editor reads a level saved under an old name as its new one. - Breaking: a module-level
#line (#include,#define) followscpp header;/cpp source;like the rest of the mixed C++: in the module's source by default, so a unit's own#includestays private to it, and in its header aftercpp header;, where every importer sees it. - Release builds (
safe,fast,small) carry no debug info: no.pdbon Windows, no DWARF on Linux. Onlydebugbuilds keep it, for the debugger. - The bundled Zig toolchain is zig 0.17.0.
- Zig's global cache no longer ships pre-filled: the first build for each target compiles the C and C++ runtime libraries once (a few minutes), and later builds take seconds. The FAQ has the details.
- A constant float expression (
-1.0,1.0 + 0.5) is folded, so one whose value fits converts tofloat32with no cast. - A unit name is a unit only before
.: a vendor unit named like its library's C type (stb_vorbis) no longer hides that type (ptr to stb_vorbis). - The test runner (
testbed.exe) and its sources are not part of this release; they return once the test suite is self-contained.
Fixed
- A
forloop whose iterator is a C or C++ variable stopped the build with an internal error; it now builds. - A missing
#includeended the build with only "Build failed with exit code 1"; it is now clang's "file not found" at the.pcppline of the#include. - A quoted
#include "x.h"of a header beside the.pcppwas not found, since the generated C++ is built in the output folder. It now finds the header beside the.pcpp, as in a C++ file, and an imported unit's quoted includes find the headers beside the unit. - A string holding
\0lost everything after it:"a\0b"is now all three characters (len3) as a const, an assignment, a parameter, a return or a comparison.
Removed
- The
stb_image_resize2andstb_sprintfunits, and thestb\ImageResizeexample: upstream moved both headers to its deprecated folder, and PaskalCPP ships only what the current upstream holds. bin\warmup.cmd: the first build fills zig's cache by itself.
Tooling
pcpp.exe-- the compiler.-rbuild and run,-ddebug,-ttarget,-optoptimize level (debug,safe,fast,small),-ooutput folder,--cleanclear an output folder,-hhelp;--passes the rest of the command line to the program.- The PaskalCPP Editor (
pcpp editor [files]) -- an Electron application whose editing surface is Monaco, with build, run and debug; File > Show Examples opens the bundled examples. - A language server (
pcpp --lsp) -- the Language Server Protocol server the editor runs, and any LSP client can. - A debugger for the x86_64-windows-gnu target -- the console debugger (
pcpp <file> -d) and the debug adapter (pcpp --dap) the editor runs, both on one engine. Every@breakpointstatement in the source is a breakpoint.
Quick start
Build and run a program:
pcpp hello.pcpp -r
Compiles hello.pcpp to a native executable with the bundled toolchain and runs it.
Start the editor:
pcpp editor
Opens the PaskalCPP Editor. Name files to open them in it (pcpp editor hello.pcpp), or start it directly with bin\res\editor\editor.exe.
Run an example:
pcpp res\examples\raylib\BasicWindow.pcpp -r
From the bin folder: builds the raylib example and opens its window. Add -t x86_64-linux-gnu to build it for Linux and run it through WSL.
Release contents (PaskalCPP-0.2.0-x86_64-windows.zip)
The zip unzips at the repository root: unzipped into a clone of the repo, every file lands where the repo's own layout puts it.
| Path | Description |
|---|---|
bin/pcpp.exe |
Compiler, editor launcher, language server and debugger |
bin/res/runtime/ |
PaskalCPP C++ runtime |
bin/res/libs/std/ |
Standard library and vendor units |
bin/res/libs/vendor/ |
Vendor libraries, static, for both targets |
bin/res/editor/ |
The PaskalCPP Editor |
bin/res/tests/ |
Compliance test suite (.pcpp sources) |
bin/res/examples/ |
Examples |
bin/res/assets/ |
The examples' shared assets |
bin/res/zig/ |
Bundled Zig/Clang toolchain (zig 0.17.0) |
docs/html/ |
Documentation (offline HTML) |
media/ |
Logo and branding |
README.md |
Project overview |
LICENSE, NOTICE.md, RUNTIME-EXCEPTION.md, TRADEMARK.md |
License (MPL-2.0), notices, runtime exception, trademark |
CONTRIBUTING.md, CODE_OF_CONDUCT.md |
How to contribute, code of conduct |
Documentation: open docs/html/index.html for the full documentation offline, or read it online at paskalcpp.org/docs; start with the tour, then the Standard library and Vendor libraries.
License: free and open source under the Mozilla Public License 2.0. The runtime and standard library files PaskalCPP builds into your programs carry an additional permission: see RUNTIME-EXCEPTION.md.
Requirements: Windows x64. Linux targets run through WSL. Building the compiler from source requires Delphi (RAD Studio) and this release unzipped into the repo folder.
File Integrity
Release files are signed with minisign to verify their authenticity and integrity.
Public key:
RWSLGfwSOWByrazkUwTzwlJ3rozKvaSnr3KT2aS/hSPDSLzUTPgj/m2X
To verify a downloaded file:
minisign -Vm <filename> -P RWSLGfwSOWByrazkUwTzwlJ3rozKvaSnr3KT2aS/hSPDSLzUTPgj/m2X
A successful verification confirms that the file was signed by the project and has not been modified since it was signed.