Repository navigation
Paskal v0.1.0 #8
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 -- Write Pascal-style code, use any C and C++ library.
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 is the first public release.
Highlights
:=for assignment and=for equality,;after every statement, each construct closed by its ownend, names declared before they are used.#includea header and call it: no import, binding or wrapper layer. A C++ type (std::string,std::vector<int>) can be the type of a PaskalCPP variable, and C++ declarations (a struct, a function, a template) stand at module level.cpp header;/cpp source;,cppstart ... cppend;andcpp("...")cover the corner cases.module exe,module dll,module libandmodule unit(imported by other modules); every kind may haveinitializeandfinalizesections.init/done,virtual/override, interfaces, embeds, properties and declared operators, held on the heap byown,refandweakowners.guard/except/finallycatchesraise/raisecode, hardware faults (an access through nil, an integer division by zero, a stack overflow) and C++ exceptions thrown by mixed C++ or a C++ library. A nil access is caught at every optimize level, release builds included..pcppfile, line and column.@define/@undef/@ifdef/@ifndef/@elseif/@else/@endif, with predefined symbols per file:PASKALCPP,BUILD_EXE/BUILD_DLL/BUILD_LIB/BUILD_UNIT,TARGET_WINDOWS,TARGET_LINUX,TARGET_X86_64,TARGET_64BITand the whole target triple.test "name"blocks after the module'send., run in test mode, with twelve asserts (testAssert,testAssertTrue,testAssertFalse,testAssertNil,testAssertNotNil,testFail,testAssertEqualInt,testAssertEqualUInt,testAssertEqualFloat,testAssertEqualStr,testAssertEqualBool,testAssertEqualPtr).println("value = {}", x)with C++23std::format; every argument prints by its PaskalCPP type.@targetorpcpp -tpicks x86_64-windows-gnu or x86_64-linux-gnu;pcpp <file> -rruns a Linux build through WSL.Tooling
pcpp.exe-- the compiler.-rbuild and run,-ddebug,-ttarget,-optoptimize level (debug,release_safe,release_fast,release_small),-ooutput 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.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.testbed.exe-- the compiler's own test runner (testbed.exe -all,testbed.exe -h).warmup.cmd-- fills zig's cache for every target and optimize level, so a first build does not wait for zig to compile libc and libc++.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.Release contents (
PaskalCPP-0.1.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/warmup.cmdbin/res/runtime/bin/res/libs/std/bin/res/libs/vendor/bin/res/editor/bin/res/tests/.pcppsources)bin/res/examples/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.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 Paskal v0.1.0.
All reactions