Pre-release of the PXP project developing an extended dialect of the PHP language

The first test release of the implementation of the PXP programming language has been published, extending PHP with support for new syntax constructs and extended runtime library capabilities. The code written in PXP is translated into regular PHP scripts that are executed using the regular PHP interpreter. Since PXP only complements PHP, it is compatible with all existing PHP code. Of the features of PXP, extensions to the PHP type system are noted for better data representation and the use of static analysis, as well as the delivery of an extended class library to simplify writing safe code.

The first version is presented as an initial experimental prototype, not yet suitable for widespread use and testing an implementation written in PHP and using the PHP-Parser parser (the first prototypes were tried to be developed in Rust, but then they abandoned this idea). Of the extended features available in the first version, only support for multiline closures is noted: $name = "Ryan"; $hello = fn(): void { echo "Hello, {$name}!"; }; $hello();

The following discussion covers the inclusion in PXP of features such as shorthand and block variants of the "match" expression, the "return" conditional operator, type aliases, generics, variadic types, immutable variables, pattern matching, and operator overloading.

Source: opennet.ru

Add a comment