Repository navigation
PaskalCPP v0.3.0 #11
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.3.0 -- Projects, and a fuller 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 is about building something bigger than one file. Projects give a program its own folder, its own output and its assets packed into one password-protected file, with the editor and the command line working the same way. Fourteen more libraries join the box, among them language models through llama.cpp, a JIT compiler, a user interface toolkit, SQLite and Lua, each with standard library units that load straight from a zip. Fifty-nine examples, up from twenty-nine, show it all on Windows and Linux.
Highlights
pcpp init MyProject exemakes a project folder:project.toml,src\MyProject.pcpp,assets\andpack.cmd.pcpp build MyProject -rbuilds it into its own output folder, andpcpp pack MyProjectzipsassets\intoMyProject.datbeside the program. A single file still needs no project file: nothing changes for a build with noproject.toml.pcpp initgenerates a random pack password intoproject.toml. In a project buildProjectPassword()returns it at run time, handed to the program scrambled so the password is never plain text in the exe:CreateZipFileIO("$P:MyProject.dat", "sprites/ship.png", ProjectPassword()).project.tomlopens as a project: its root badged in the explorer, Build / Run / Debug go throughpcpp build, File > New Project... makes one, and Build > Pack (Ctrl+Alt+B) packs it.import llama_ext;runs a GGUF model with llama.cpp b11971 in a few lines, on any vendor's GPU through Vulkan or on the CPU: chats with the model's own template, text streamed as it is written, sampling options and stop strings, output held to a grammar or a JSON schema, embeddings, and a model loaded from a zip entry.importaway on both targets.mir_extto use it with no C++ in the program: MIR text, C compiled at run time, the binary form from a string, a file or a zip, functions built in code, linking and calls.raven_raylib, with raylib textures shown in Raven widgets.raylib_extopens a raylib window at a virtual resolution sized for the monitor's DPI and letterboxed on resize, with pixel-perfect integer scaling and a window zoom;rlimgui_extruns Dear ImGui inside it.mojoal_ext(sounds),sqlite_ext(a database),tmxlite_ext(Tiled maps) andldtk_ext(LDtk projects) load from a path, any IO source or a zip entry.New
StrUtils--Trim,TrimLeft,TrimRight,SplitString,TryStrToIntandStrToIntDef, with Delphi's names and rules.Diagnostics-- aStopwatchwith Delphi'sTStopwatchnames on a monotonic clock.SysUtilsfiles and folders --FileSize,RenameFile,ForceDirectories,ReadAllText,WriteAllText,ExtractFileName,ChangeFileExt,TempDirandHalt.CustomIOwrites zips --ZipDirectoryContentszips a folder (with a password when given),GetZipEntryInforeads an entry's size and CRC-32, andIOCopycopies one stream into another.Console.ReadLnreads a line of input;MathgainsCosineSimilarity.$R:names the project root in a project build's paths (@addmodulepath "$R:units";).pcpp --project-info <folder>prints a project as one JSON line, for editors and tools.testbed.exeships again, now that the test suite is self-contained: it builds and runs every.pcpptest on both targets at every optimize level and checks the result, so you can change the language, add tests beside the official ones and run the whole suite.Changed
bin/res/tests) is organized into one folder per area (decl\,expr\,std\, ...), each test run on both targets at all four optimize levels.Fixed
@addsourcefileis now reported at the@addsourcefileline that added the file.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. Projects:pcpp init <name> <exe|dll|lib>,pcpp build [<folder>],pcpp pack [<folder>].pcpp editor [files]) -- an Electron application whose editing surface is Monaco, with build, run, debug and projects; File > Show Examples opens the bundled examples.pcpp --lsp) -- the Language Server Protocol server the editor runs, and any LSP client can.testbed.exe-- the test runner, run from thebinfolder:testbed -all(every test in every target and optimize level), a test id or a glob (testbed "type.*"),-t/-optto pick cells,-failedfor the last run's failures,-listto list the tests,-hhelp.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.Start a project:
Makes the project folder
MyProject, then builds it into its own output folder and runs it. Put files inMyProject\assetsandpcpp pack MyProjectzips them intoMyProject.datfor the program to read.Release contents (
PaskalCPP-0.3.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/testbed.exebin/assets.zipbin/res/runtime/bin/res/libs/std/bin/res/libs/vendor/bin/res/editor/bin/res/tools/pcpp packbuildsbin/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 Projects, 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. A language model runs on the GPU when a Vulkan driver is installed, else on the CPU. 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.3.0.
All reactions