Skip to content

3.3.0

Choose a tag to compare

@DanielLMcGuire DanielLMcGuire released this 08 May 07:23
Immutable release. Only release title and notes can be modified.
63b3474
nix run github:DanielLMcGuire/Phasor/3.3.0

Commits: 3.2.0...3.3.0
AUR: paru -S phasor
VSCode: Phasor.phasor-programming-language
https://phasor.pages.dev/downloads?version=3.3.0


Caution

Use of "stdstr" module may cause memory leaks!

As always, this is prerelease software. Functionality is not fully checked, it may only be partial. DO NOT USE in production environments without having ran Phasor's embedded C++ leak tracer (available via cmake -DIS_TRACING_ALLOCATIONS=ON!), and review all non C++ code. Even then Phasor is not officially stable!

Use of phasor-web in this release could lead to arbitrary code execution if ENV is not locked down!

See zorvix.pages.dev/security-issue for info

Version 4.0.0 will release later this month as an officially stable version of Phasor, focusing on areas like scoping, enforced typing, better type inference, stability, and speed. (and also will fix the broken AUR package and VSCODE extension + some other touch-ups)

Added

  • phasor --command / -c flag runs a raw script string directly from the CLI without a file or stdin buffer.

  • stdmem stdlib module (memory.cpp) exposes free(name) to free a named variable from the VM at runtime.

  • stdrand stdlib module (random.cpp, core/random.cpp, core/random.hpp) exposes rand_seed(s1, s2), rand_next_range(min, max), and rand_next_float(). Uses a custom xorshift+ PRNG.

  • execFuncInt() and execFuncString() C ABI functions in PhasorRT.h call a named function from pre-compiled bytecode and return the result cast to an integer or string respectively via new dispatch channels in the VM.

  • Rust bindings (src/Rust/lib.rs) new safe Rust crate wrapping PhasorRT via libloading, covering all ABI functions with a typed PhasorError enum.

  • Zig bindings (src/Zig/phasorrt.zig, build.zig) simple Zig wrapper over PhasorRT with a full State struct and top-level compilePHS, compilePUL, and getVersion. Exposed as a Zig module via build.zig.

  • phasor.Runtime Python submodule cffi bindings for the PhasorRT library. Documented in phasor-py.3.

  • phasor_applescript_bindings macOS FFI plugin new applescript_run() function callable from Phasor scripts on macOS, using simple C bindings -> C FFI API (src/Bindings/macOS/AppleScript.h/.m) using Foundation/NSAppleScript.

  • Windows COM / Active Script interface (NativeRuntime_com.cpp/.hpp) implements IActiveScript and IActiveScriptParse as PhasorScriptEngine, registered with CLSID {c5318f33-2d87-4e95-95b7-2928cd57a5d7} and ProgID Phasor.

  • src/Extensions/powershell/Phasor/PhasorABI.cs PowerShell module ABI extracted from an inline Add-Type into a standalone C# file.

  • C++ Public Runtime Headers new headers (plus Phasor.hpp umbrella) including PhasorFFI.hpp, PhasorStdLib.hpp, PhasorVM.hpp, PhasorISA.hpp, and Value.hpp. Optionally includes the C ABI header when NEED_PHASOR_C_ABI is defined.

  • EMBEDDED CMake option strips the build to essentials; automatically implies IS_SANDBOXED, and skips the thirdparty subdirectory.

  • embedded CMake presets embedded-rel and embedded-dbg build presets.

  • USE_PCH CMake option (default ON) controls precompiled header support.

  • scripts/installer.wxs new MSI installer.

  • assets/LICENSE.rtf RTF license for use in both EXE and MSI installers.

  • MSVC debug map files /MAP added to CMAKE_EXE_LINKER_FLAGS_DEBUG and CMAKE_SHARED_LINKER_FLAGS_DEBUG.

  • Man pages for phasorrt-zig.3, phasorrt-rs.3, phasorstd_mem.3, and phasorstd_rand.3 added.

  • CI upgraded to GCC 16 on Linux in both release and nightly workflows.


Removed

  • -n / --nologo flag removed from phasorasm, phasordecomp, and phasornative; man pages updated accordingly.
  • OPS_ARE_INCLUDED include guard in Operations.cc.inl replaced by the CMAKE_PCH guard.
  • Inline VM constructor/destructor bodies moved out of VM.hpp into a new VM.cpp.

Changed

  • Version bumped to 3.3.0 across all files (CMakeLists.txt, flake.nix, .rc files, PowerShell module, VSCode extension, Python package, man pages).

  • Bytecode instruction format reduced from 5 operands to 3 (operand1, operand2, operand3). Affects the serializer, deserializer, Python Bytecode.py, and all related man page documentation.

  • std* stdlib wildcard now also registers stdmem and stdrand alongside existing modules.

  • PRINT and PRINT_R opcodes now flush stdout after printing (both stack and register variants).

  • CodeGenerator::generateExpression() gained a resultNeeded parameter. Postfix expressions in statement context pass resultNeeded=false, skipping the dead store of the pre-increment value.

  • Value::getType() reimplemented as static_cast<ValueType>(data.index()), now [[nodiscard]] noexcept.

  • BytecodeSerializer and BytecodeDeserializer use std::unordered_map instead of std::map for variable and function entry maps. calculateCRC32 made static in both.

  • phasor_main and pulsar_main executables are now only built when PROJECT_IS_TOP_LEVEL, allowing Phasor to be consumed as a CMake subdirectory.

  • InstallConfig.cmake now installs the entire include/ directory instead of only PhasorFFI.h and PhasorRT.h, on all platforms.

  • cmake/Version.cmake SHOULD_APPEND_HASH is now only set when there are commits since the tag, so clean tagged builds no longer get a hash suffix. git status now uses --porcelain -uno so untracked files don't mark the tree as dirty.

  • phasor_applescript_bindings macOS shared library added to the CMake build with Objective-C enabled and linked against Foundation.

  • NativeRuntime_com added to the DLL source list on Windows.

  • VSCode extension jitPath/jitArgs config keys renamed to mainExePath/mainExeArgs.

  • NSIS installer now registers phasor-help.exe in App Paths and registers the COM Phasor Script Engine (CLSID) for phasorrt.dll; uninstaller removes both.

  • CI macOS and Windows/Linux builds now pass -DNATIVE=ON and build Release instead of RelWithDebInfo.

  • Asset renames: Repl.icoassembler.ico, CppCompiler.icocompiler.ico, logo.pnglogo-large.png, ScriptingRuntime.icopulsar.ico, BinaryRuntime.icovm.ico.


Fixed bugs

  • cmake/Version.cmake hash suffix was appended to clean tagged builds; SHOULD_APPEND_HASH is now only set when commits exist since the tag.
  • git status --porcelain -uno untracked files no longer incorrectly mark the working tree as dirty.
  • Postfix expression statement no longer emits a dead STORE_VAR + POP pair when the result is unused.
  • IS_XSCARLETT typo corrected in CMakePresets.json and cmake/Preprocessor.cmake (was IS_XSCARLET).
  • MAN2PDF_any.py missing working directory cd /data before invoking the shell script, needed for the next one:
  • MAN2PDF_linux.sh find path corrected from /data to ./ for proper relative operation; also added a Done. completion message.
  • MAX_REGISTERS increased (Fix #8) across all platform tiers: PLATFORM_LEGACY_GAME 4→8, PLATFORM_DESKTOP_GAME/PLATFORM_MODERN_GAME 8→16, PLATFORM_DESKTOP_STANDARD 16→24.

Existing bugs

  • #9, floating point numbers might not work correctly
  • #12, Escape sequences longer than one char will not work properly

New bugs

  • free() not named correctly: free() was incorrectly named the placeholder name (stdmem()), not critical, for now use variable = null