Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Jamie Balfour'sPersonal blog

Jamie Balfour'sPersonal blog

So many new improvements due to switching IDE. After 12 years of using Eclipse, I have finally moved to IntelliJ again. This has meant new things for ZPE, for example, little artefacts such as if statements I hadn't noticed were redundant due to code changes surrounding them were wasting resources. IntelliJ notices these and suggests how to improve the code. I have implemented a lot of changes due to this.

Also thanks to IntelliJ I have now started to host ZPE on a private GitHub repository. This has meant change tracking is even easier than it was before. It also means I don't rely on Dropbox Rewind anymore. Further to this, ZPE now has proper build numbers that automatically update each time I build ZPE. I really like this because it goes back to the way ZPE was back in the olden days with version 1.3 up to 1.5.

ZPE has had some major new features that don't just relate to performance too including the new unbound variable declaration, the new empty expression and the new compiler directives feature. Further to this, to make the development of other subset editors of ZPE (such as that found in the SQARL editor I have recently made) easier and faster, the new CodeEditorView component makes it easier to embed line numbering and syntax highlighting in any program. For those who haven't seen my SQARL editor, it simply parses SQARL into YASS which is passed to ZPE for parsing, compilation and passed through the runtime.

After learning a bit about how Ant works and how great the IntelliJ IDE is, I have finally got automatic build numbers being generated. Prior to this, I would estimate the build versions and as of recently, I have ignored build versions entirely. This changes now with a new Ant script being added to ZPE that will automatically increment the build version every time I compile it. This means every time I test the program (since it is built then too) it will increase by one. Build numbers are useful as it's often the case that users of early builds who try out the early access nightly version will be unable to update to a newer build in the same version because the updater cannot decern the version differences deterministically. This will change now! 

Apart from the minor performance improvements featured in ZPE 1.11.8, codenamed Phi, the next release brings about a long-requested feature. That feature is unbound variable assignment.

ZPE generally enforces variable declaration with a bound $ symbol or the let or var keywords. Languages like Python allow variables to be declared simply with their name. From the point of view of the compiler, I thought that due to my recent work on variables, mainly related to the use of unbound variables in assignment, I thought this would be easy. It was. It only took me five minutes and two lines to change ZPE to include this feature.

So now you can do this:

YASS
x = 10
print(x)

Oh, what does that look like? Python maybe?! Maybe that's why I didn't actually want this in YASS.

ZPE Online is the cloud service for ZPE that runs via my own website. Users rarely have to interact with it from my website and I intend to keep it that way. ZPE Online already allows users to save their code online - one of the most significant breakthroughs with ZPE since its inception. But cloud variables, which will be known as ZPE Online Variables on release, are only a short while away. In fact, they are partially implemented in ZPE as of now.

This is how they work:

  • A user creates a variable online (only the original creator can then change the value)
  • A user subscribes to the variable by selecting it from online (they are then periodically checked against the online version to check for changes)
  • A user then uses the variables, which for quick access, are read from their local machine rather than online. If a user runs a program which contains a reference to an online variable that they do not have, they will be asked if they wish to download the variable. 

ZPE will also contain a new security feature which will ensure that the user does not download a variable that could exploit their system. Further to this, cloud variables will only be able to store ZPE primitive types excluding records and objects.

ZPE 1.11.7 also intends to improve the performance of ZPE a bit further as well.

This is all planned for July's release.

A few months ago I had an idea that would improve start-up times for ZPE severalfold. I tried to implement it once before and it failed, resulting in me reverting back to a backup and leaving it alone for a while. Well, I have at last implemented this feature. 

This feature makes the performance of ZPE better, the start-up times lower, the memory footprint lower and the CPU usage lower. Development is a little more complicated due to the use of reflection rather than using the object-based code that was used before but I know what I am doing with this. ZPE now has reached the 50,000 lines of code mark, even after the latest purge I carried out that took out over 20,000 lines of code.

The June release of ZPE will be available at the end of next week, with many minor improvements and additions. Today really does mark a monumental achievement. 

After two release dates were cancelled, I'm finally able to release ZPE 1.11.4, aka OmegaZ, which will feature all of the previously discussed features such as union types and inline iteration etc. but will also include a major update to the record data type.

Previously, records looked like this:

YASS
record structure person { string forename = "" }

Now, with ZPE 1.11.4, they've been changed and the structure keyword is now optional. Speaking of syntactic sugar, there is now an optional is keyword:

YASS
record person { string forename = "" }
record person is { string forename = "" }

As well as this, record instances use the new keyword.

YASS
$x = new person()

And fields of the record are accessed using dot notation:

YASS
$x.forename = "John"
print($x.forename)

Finally, union types are accepted in ZPE 1.11.4. The March release known as OmegaZ will now include union return types:

function doubleNum(integer $x) : integer | real
  return $x * 2
end function
print(doubleNum(2))

It will also soon support union parameter and variable declarations which are expected in OmegaY also. This further expansion of ZPE's TYPO nudges TYPO to version 2.1. All of this new stuff has been added with almost no performance penalty at all. 

Since TYPO was introduced and then upgraded to TYPO v2, typing has become a big thing for YASS. The standard library uses types on all built-in functions and all of my own programs are moving to be typed. One of the new features that is coming to ZPE in the near future is forcing typing and disallowing the execution of programs that don't use strong typing. But before that, ZPE is looking to bring union types.

Union types are crucially important for return types on functions which may need to return two separate data types. Rather than using the very abstract mixed type, these functions would use the union type. Assume the following function which returns an integer (the index of the found item) or a Boolean false if the item is not found. Using types with this function currently means specifying a mixed type to allow both integer or Boolean return types:

function linearSearch(string searchTerm, list items) : mixed

This same program could be written with union types as shown below:

function linearSearch(string searchTerm, list items) : integer | boolean

This is a much less abstract and more concrete solution to the problem, forcing the return type to be one or the other. This is the first step in union types, as union types will also come to variable declaration, but this isn't planned to come any time soon.

One of the features that I most wanted to bring to ZPE this year was inline iteration. This has been one of the top features on my board of features for ZPE. 

Inline incrementation will be the headline feature of the next version of ZPE and will be available from the OmegaY version of ZPE (version 1.11.2+) and it brings an easy way to create ZPELists with very minimal effort. Not only that, it's actually very fast, taking advantage of ZPE's performance in the for...to loops that I spent tireless hours working on.

It's pretty lovely too:

YASS
print(from 0 to 1000 : function($x) { return $x * 2 })

I'm also seeking to improve file transfer performance as well as bring in remote SFTP-like features into the language too.

One of the most exciting features coming to ZPE is cloud variables. This will allow booleans, strings, integers, reals and much more to be stored and retrieved from a ZPE Online account. This will, however, only work while the user is logged into the cloud. 

This is intended as the headline feature of ZPE 1.11.1. 

There is a possibility that serialisation of objects will come later too. 

Powered by DASH 2.0