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

Namespaces are finally here with ZPE 1.12.8! They are essential for organising libraries and structures throughout programs. Look at the code below to see how they work:

YASS
structure HTMLBuilder

  namespace jsmith/packages

  /*
  * Functions go here
  * ...
  */

end structure

$builder = new jsmith/packages/HTMLBuilder()
  

I usually come up with codenames for the next version of ZPE quite far in advance, and this year is no exception. 

For version 1.13, the following codenames have been decided:

  1. Petergate
  2. Micklegate
  3. Davygate
  4. Castlegate
  5. Monkgate
  6. Goodramgate
  7. Fossgate
  8. Colliergate
  9. Gillygate
  10. Walmgate
  11. Coppergate
  12. Stonegate

The inspiration for these codenames came from the City of York, where I recently had a short break.

ZPE 1.12.7 is now available to download. This version brings sweeping changes to the way that libraries are imported into YASS code and the ZRE; it introduces bubbling, brings breakpoints to ZPE, fixes an issue with permission levels not being read correctly, and, perhaps most importantly, adds unescaped string literals to the YASS language.

All of these features makes ZPE 1.12.7 one of the most jam-packed releases of ZPE to date.

I have been seeking to add breakpoints to ZPE for the last seven years, and I have finally succeeded. 

They work using the new bubbling technique I have developed. In ZPE, bubbles are exceptions; a breakpoint is a simple bubble. Bubbles go all the way to the top of the runtime and are handled by the parent. Complex bubbles work entirely differently, and although they are also bubbles, they can be handled by different parts of the program. 

A breakpoint is added to YASS code by writing #breakpoint# where the code should break. In the GUI mode, it will display a variable watch window:

Another prominent feature brought to ZPE this year is bubbling. ZPE will introduce bubbling with version 1.12.7. It is used for interrupts such as exit requests, errors, and breakpoints. These are called bubbles since they are up to the program's top. So, for example, an exit request no longer exits ZPE; it handles a bubble instead to decide what to do with it (and, of course, that might be to exit, or it might be to close the active thread).

Bubbling is a huge feature that changes many of the underlying implementations of ZPE.

One of the significant updates coming to ZPE 1.12.7 is a major change to how ZPE handles library imports. This post is designed to outline this change so I can reference it from the changelog and GitHub commit. 

Before this version, ZPE would read in library imports from a yex file in the libraries folder. This hasn't changed. The library files themselves need not be recompiled. However, the way they are imported has changed. In the older version of ZPE, a library was imported as a variable with all the structures and classes being defined within them:

import stdLib
print($stdLib->bubble_sort([2, 7, 1, 6]))

In ZPE 1.12.7, this changes. Now, instead of adding the bubble_sort function to the $stdLib object, the bubble_sort is put into the top level of the runtime (i.e. added to the global function), so instead you would call bubble_sort:

import stdLib
print(bubble_sort([2, 7, 1, 6]))

ZPE 1.12.7 also allows doing this in the old manner by using the new import as syntax:

import stdLib as stdLib
lib = new stdLib()
print(lib->bubble_sort([2, 7, 1, 6]))

This new change will make some difference to the way in which libraries are used and will improve ZPE performance and memory footprints.

I recently started working on the YASS to Python transcompiler. It's worked well over the last few weeks, and I've decided it needs a proper name. 

Without further ado, let me introduce ZenPy. 

ZPETypes were first introduced to ZPE a few years back when the move to 'everything as a function or object' concept evolved. This paradigm shift made it impossible for ZPE to encounter data types such as BufferedImages as it had previously, restricting such data only to ZPE structures (and, indeed, ZPEObject instances). This tidied up the core of ZPE, improved performance, and caused fewer crashes.

Now, I embark upon perhaps the most exciting yet ambitious project in ZPE's history: shifting away from generic values to ZPETypes for all return values. This is not going to be a quick job either, and it could take several days of development. But it's necessary to make ZPE feel more solid and improve performance even further. 

ZPE is close to its 100,000th download as of this year, so it is time for this change to come around. I seek to have it done by the end of the summer.

ZPE plugins are now available to download from my website straight from my Download Center. All plugins are open-source and can be compiled, modified, forked, etc., from my GitHub.

Currently, the only existing plugins are the libZPE-MySQL, libZPE-MQTT, and libZPE-Serial plugins, which were three of my original plugins. libZPE-Windows, libZPE-Mac, and libZPE-Linux are all underway now, too. 

As you'll notice, if you are interested in making plugins for ZPE, they must follow the naming convention of libZPE at the start. 

The plugin system, known as the ZIP System, is now working. It's replaced the older plugin manager with a more efficient and reliable system. I recreated the ZPE MySQL plugin yesterday and got it working again. Part of my plans for this include removing some of the features in ZPE, including the MQTT features and potentially the GUI features in ZPE, and moving them to a plugin.

However, there is currently a drawback to these: instead of working like libraries, these simply add the built-in library functions to the general function list. That means you do not have to call libmysql->mysql_connect but instead just write mysql_connect. I am not entirely sure this is how I feel that these plugins should be accessed.

However, it now means that creating ZPE plugins is now possible again. 

Powered by DASH 2.0