Skip to content

Releases: NotAPenguin0/pscript

v0.3

06 Jul 09:42
Compare
Choose a tag to compare

This release brings performance improvements across the board. On average, the interpreter is now 2x faster than before. The major breaking change is that a context no longer has its own unique address space, so ps::pointer is now a real pointer instead of some virtual address.

v0.2

05 Jul 22:49
Compare
Choose a tag to compare

This second release of pscript brings a couple new language features and tools.

Major features

Range-for

This new type of loop comes in two flavours: one that uses range expressions and one that iterates over an iterable type.

for (let i : 0..10) { } // iterate over 0..10
for (let i : [1, 2, 3]) { } // iterate over the elements of a list

Variadics

Added variadic arguments for functions. This allows passing any number of parameters to a function without using lists. Their syntax is similar to C++.

fn printf(fmt: str, args...) -> void {
    std.io.print(fmt.format(args...));
}

printf("Hello {}, it is clear that {} + {} = {}", "there", 2, 3, 2.0 + 3.0);

Delete

Added a delete statement to delete a variable from its current scope. The variable's memory will be cleaned up and it can be redeclared as if it never existed.

let x = 10;
delete x;
let x = 20;

Tools

Two new tools were added to the repository.

  • A command-line tool for running scripts, which also allows for an interactive mode similar to Python's command line environment. The binary is simply named pscript.
  • A benchmarking tool which will run all scripts inside the benchmarks/ folder and time them.

Building these tools can be disabled by setting the PSCRIPT_BUILD_COMMAND_LINE and PSCRIPT_BUILD_BENCHMARKS cmake variables to OFF.

Bugfixes and minor additions

  • Added literal f suffix for creating floats.
  • Fix compilation on Linux.
  • Add continuous integration (GitHub Actions)
  • Added std.io.printf() using variadics feature to simplify syntax for formatted printing

v0.1

25 Jun 11:16
Compare
Choose a tag to compare

This release contains an initial version of pscript. While the language syntax is (mostly) complete and the interpreter implements most functionality, a lot of things are still lacking. Future releases will focus on performance and a more extensive standard library, as well as better tooling (such as a command-line interpreter and a debugger).