The next version of ZPE, version 1.12.12, will introduce the new ZPE Performance Enhanced Cache (ZPEC). ZPEC will improve the performance of applications run through the -r ZAC by precompiling the application's bytecodes into a small file. The cached version will be stored in the ZPE folder as an unoptimised compiled program to make it as similar as the code it is based on.
The next time the program is run, ZPE will perform a cache lookup and, if the file exists, run it. If a cache miss occurs, it will compile and store the file in the cache and then run it.
It then performs some hashing to decide if the compiled program needs to be updated.
ZPE nightly was introduced so that when a change to any version of ZPE was made, the download would automatically be the latest version. Ultimately, nightly was supposed to be the latest, but it was not necessarily the most stable version of ZPE. Alas, the plan to deliver this didn't really work as it relied on my laptop being on.
The good news is that now, ZPE nightly is the most up-to-date commit on my GitHub. Once I commit to GitHub, the nightly will always be the ZPE that's on there. This means you can try out the latest and greatest ZPE anytime. You can head to my Download Center to download the newest version right away.
My website's function information on ZPE isn't always up to date with the internal function information from ZPE.
Well, from now on, the function information string will be automatically updated to align with ZPE. This is a big update that should hopefully make it easier in the future for me to update ZPE.
The latest version of ZPE brings many changes that improve its performance while adding new and additional features to make the language even easier to work with.
Let's start with that, then. ZPE introduces function tooltips that allow you to hover over a function within the code and read a quick overview of that function, its parameters, and its return type(s).
The latest version also adds support for $-unbound parameters within function definitions, changes the way objects are passed across (they are always by reference, never copied), and changes the underlying ZPE class to the ZPEMain class and the ZPE class, separating logic from the startup features.
There's also a new internal object for Pairs and the function
keyword that has been used for declaring a function type is now separate and is fn
.
When I chilled out today, I realised that building multiple return values into ZPE would be easier than I thought.
That's because the new tuple syntax already works with that. So, without further ado, the latest version of YASS, YASS 24.10, supports the new multiple return values syntax:
function multiReturn() return 1, 3, 5 end function ($x, $y, $z) = multiReturn()
YASS 24.10 may be one of the final updates to the YASS language for a while. That's because its syntax is pretty perfect now.
I'm excited by what multiple return values brings to the YASS language.
Last week, I came across a potential means to add AI support to ZPE. This AI support could lead to better error reporting, code generation in the editor, syntax checking, or perhaps even for use within code.
I wanted to use this post to state that this is potentially on the cards.
ZPE 1.12.9 is one of the most significant updates to ZPE since it started. It completes the major project of making all internal data types as instances of ZPEType, rather than relying on lower-level and abstract data types. This update is so significant because it now means higher performance due to less casting, better safety and ensuring that non-ZPEType values can no longer be injected into the program.
Further to this, new syntax features include the use of colon terminated conditions and for parameters:
while $x < 100:
print($x)
end while
Tuples are another feature of ZPE 1.12.9; they are different from class instances and objects entirely in that they are defined once but follow such a structure throughout their lifetime:
$x = (string, number, number)
$x = ("Hello world", 13, 7)
The new REQUIRE_EXPLICIT_VARIABLE_DECLARATION property and the requires_explicit_declaration directive both enforce that the user defines variables before they are used. This is a significant feature, which might become the default option in ZPE later on.
Finally, ZPE's editor has undergone a bit of overhaul. The icon is scaled down to look much smarter and suitable in internal windows and alert popups, whilst on macOS the logo used around the application is the logo found on the Dock. The scrollbars have been enhanced, too. And toggling dark mode now retains the position you were at when you toggled it. The final significant thing is that the console now runs in a separate process and can be stopped in between running a program, meaning if an infinite loop starts in the code, it will not affect the main editor. This will also come to my SQARL editor, which has also received a considerable number of improvements, including an icon at last.
ZPE 1.12.9 is now available to download from the usual place.
For an extremely long time, ZPE has relied on native Object types for return values. I never wanted to keep this because it meant a lot of type casting, type inference, potential bugs, a lack of security regarding what was passed around ZPE, and also a lot of type checking. This slowed down ZPE and meant it didn't feel particularly stable.
As of version 1.12.9, ZPE is now fully locked down to the ZPEType return type, which includes ZPEStrings, ZPENumbers, ZPEBooleans, ZPEObjects, ZPEFunctions, ZPERecords, ZPETuples, ZPELists, ZPEArrays, ZPEMaps, and ZPEOrderedMaps. This reduces ZPE's flexibility, making the Core much more stable.
As I say, this is one of the biggest updates to ZPE in a long time and it paves the way to further updates that will strengthen this.
What's really cool about this update, nothing has changed in the compiler so no scripts that have been compiled need to be changed, and in fact, nothing needs to be changed in any existing scripts.
ZPE 1.12.9 features a few major changes and improvements, but one stands out more than the others: the introduction of explicit variable declaration.
Explicit variable declaration means that variables must be declared before they are used, either in an assignment or for anything else. For example, if a variable $x isn't defined first, the compiler will detect this and throw an error.
$x = 15
will throw an error, whereas
number $x = 0
$x = 15
will not.
In addition, ZPE gets closer to having all underlying data types as ZPETypes. This will enforce the fact that things like plugins can only return types that ZPE itself controls, which will lead to better type safety. As of ZPE 1.12.9, we now have the ZPENumber data type underneath. It took me a whopping 8 hours to bring it to ZPE, and the implementation isn't complete yet. Further, I aim to improve the way the ZPEString is managed so that fewer checks need to be done with them as well.
ZPE 1.12.7 brought many of the biggest updates to ZPE in a long time including bundling a YASS-based standard library that is compiled on start up, changing the way imports work and breakpoints.
Now ZPE 1.12.8 is just about ready for launch and it brings many big new features and changes.
The new features of ZPE 1.12.8 are:
- Namespaces have finally been added to ZPE
- Much better error handling
- The new -h bytes will list all byte codes available in ZPE and their representation, great for development
- New Javadoc based documentation is being added, a considerable amount has already been added to ZPE 1.12.8.
- Return types on functions can now be stated with
->
as well as:
- Several new exceptions have been added to ZPE (this version is known as the 'exception version' as a result)
- Short anonymous functions () => {} now support typed parameters.
- Static functions and static function calls are now available too (they will soon support namespaces too)
The big changes in ZPE 1.12.8 are:
- The cache values file is now stored in the ZPE folder, rather than where ZPE is executed. It makes much more sense this way.
- ZPE introduced a new ZPERandomizer engine in July
- Log files have been changed so they no longer take up too much space on disk and they rotate more efficiently
- ZPE Online files are now compiled when they download to ZPE
- The JSON parser now supports the null value
- Regexps have been improved to reduce the time they require to compile and test
- The main introduction is more detailed than ever before, making it easier to find out about a ZAC than before
- std_out prints to the same line
match
statements now only support one else statement and it must be the last condition of the statement
There have been several bug fixes too:
- ZPE no longer keeps asking to install the standard library if you said no
- Shell return values are now ZPEStrings making them comply with the ZPE data type list
- The --man option stated that all functions return an object on all instances due to a bug, this has been fixed.
- The rate and voice parameters in the speak command were not optional and this has now been fixed (as has the manual heading)
There are two breaking changes which include the new syntax of the match statement has now changed and the copyof keyword has been dropped. Both of these lead to YASS 24.7. Make sure you read the changelog to understand what it is that has changed.