Repository navigation
PaskalCPP v0.2.0 #9
jarroddavis68
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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
pcppcommand turns a.pcppfile 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
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.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.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.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_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.@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.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.///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.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.Globals:, andpreads them.bin\assets.zip, built on first use frombin\res\assets.Changed
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.#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.safe,fast,small) carry no debug info: no.pdbon Windows, no DWARF on Linux. Onlydebugbuilds keep it, for the debugger.-1.0,1.0 + 0.5) is folded, so one whose value fits converts tofloat32with no cast..: a vendor unit named like its library's C type (stb_vorbis) no longer hides that type (ptr to stb_vorbis).testbed.exe) and its sources are not part of this release; they return once the test suite is self-contained.Fixed
forloop whose iterator is a C or C++ variable stopped the build with an internal error; it now builds.#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.#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.\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
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.pcpp editor [files]) -- an Electron application whose editing surface is Monaco, with build, run and debug; File > Show Examples opens the bundled examples.pcpp --lsp) -- the Language Server Protocol server the editor runs, and any LSP client can.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:
Compiles
hello.pcppto a native executable with the bundled toolchain and runs it.Start the editor:
Opens the PaskalCPP Editor. Name files to open them in it (
pcpp editor hello.pcpp), or start it directly withbin\res\editor\editor.exe.Run an example:
From the
binfolder: builds the raylib example and opens its window. Add-t x86_64-linux-gnuto 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.
bin/pcpp.exebin/res/runtime/bin/res/libs/std/bin/res/libs/vendor/bin/res/editor/bin/res/tests/.pcppsources)bin/res/examples/bin/res/assets/bin/res/zig/docs/html/media/README.mdLICENSE,NOTICE.md,RUNTIME-EXCEPTION.md,TRADEMARK.mdCONTRIBUTING.md,CODE_OF_CONDUCT.mdDocumentation: open
docs/html/index.htmlfor 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/m2XTo verify a downloaded file:
A successful verification confirms that the file was signed by the project and has not been modified since it was signed.
This discussion was created from the release PaskalCPP v0.2.0.
All reactions