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 you already know about some of the new features of ZPE 1.5.3, including the new free to use parser that can be part of any project. But there's also another change coming.

ZPE 1.5.3 is a bit of a minor update in terms of features, but it brings in a sweeping change. 

I'm talking about a change that brings a change to something from version 1.3.2. One of the first features added to ZPE way back when it kicked off again in 2015 was associative arrays - almost identical to PHP's associative arrays. They were different to lists in the sense that they mapped values. Well, whilst version 1.5.3 is not a huge update, the update brings a huge change to associative arrays.

You declare an associative array as below:

ZenLang
$assoc = {50 => 10, 10 => 50}

But now, the same associative array is written very similarly to a mix between that and defining a list:

ZenLang
$assoc = [50 => 10, 10 => 50]

The update's purpose is to inline both associative arrays and lists and to free up the curly brace.

Also, I am changing the accessor symbol from => to -> for objects.

zpe
1.5
1.5.3
new
associative
arrays
changes
features
custom

It's no shock that a very useful bunch of libraries are now available for ZPE written in ZenLang. Because I have recently added jget to ZPE (a method of accessing my own repository of ZPE extensions easily, allowing easy downloads of these extensions) I have decided to give it a proper name.

Much like the way PEAR and PECL exist for PHP, ZPE will get ZULE or ZPE User Libraries and Extensions. This will be hosted on my website for now and accessible through the jget ZAC in ZPE for now. I will add the ZULE ZAC to ZPE soon however, but jget will exist for a different purpose. 

I'm now open to receiving both compiled and uncompiled scripts for ZPE to add to this repository. 

As part of the major restructuring of the internals of my ZPE project, I rewrote the whole parser. Before I explain what's changed with it, let me explain how ZPE works (and still does).

The basic layout of ZPE

The previous image shows precisely how everything interacts. The second step is the most crucial, at least I see it that way. I say this because this is how my latest project functions. The project was known as Project Diamond originally, and I have no idea why I chose to name it that. This project looked at a new way of making the ZPE parser flexible and as a result ended up with me rewriting the whole ZPE parser (it's not that big though, only about 100 odd lines). Because of this rewrite it can be used to parse any language with minimal effort. Simply including the parser and requesting it does an action (such as eat a word) or return something (such as the current symbol or the current word) is all that is needed to write a programming language using it. 

As a result of this, I wrote JBSON, which is my JSON parser. It works using my ZenithParser which is now fully open to use. It's very easy to use and I will share the source code of JBSON. Whilst JBSON is actually part of the ZPE package, it can be used completely separately and the whole ZPE package is not that heavy. However, as I am restructuring ZPE's internals I may make it a public library that's not a part of ZPE. The main motivation behind doing this was the Google's JSON was too big for ZPE, adding it doubled the size of the distributable JAR file.

json
parser
java
lightweight
easy
to
jbson

Back in the days of version 1.3 it was always my intention to make it possible to add custom compiler syntax to ZPE. I did this originally in a very simple way that made it easy for me to develop but harder for others to develop. Today, version 1.5.2 brings this feature back. It improves it considerably and makes it fully possible to write your own syntax. I've even decided to make it possible to overwrite the built in keywords including things like if and while. 

How does this work?

It's not the easiest of things to explain but I will try. Firstly, when ZPE is launched it will search through all of it's plugin directories. A new directory called 'keywords' has been added to version 1.5.2. This directory contains all of the user's custom keyword plugins. The manager then adds these to the compiler based on the name value given to the keyword plugin.

The next stage is for the compiler to compile the word. The plugin handles the compilation job and can access the owning ZPE's public functions (including the new ExternalMethods object) before returning an AST.

Within the interpreter the plugin's traverse method is called. It is then the plugins job to traverse when the plugin is given an AST back (the same AST given previously) and to run it as code. It's pretty easy to do and it's designed to be easier than doing it the way the internal compiler does it.

Below is a plugin called 'jack'. It simply takes the next word and stores it as a value.

Java
import jamiebalfour.zpe.core.AST;
import jamiebalfour.zpe.core.ZenithEngine;
public class ZenithCustomModule implements jamiebalfour.zpe.core.ZenithCustomModule {

	@Override
	public String GetName() {
		return "jack";
	}

	@Override
	public AST CompileToAST(ZenithEngine z) {
		
		AST a = new AST();
		z.ExternalMethods.EatSymbol();
		a.value = z.ExternalMethods.GetCurrentCompilerWord();
		
		return a;
	}

	@Override
	public void Traverse(ZenithEngine z, AST node) {
		
		System.out.println(node.value);
		
	}

}

Below is a sample of the ZenLang code that runs this:

ZenLang
function main()
	jack x
	$a = 0
end function

ZPE CAST or ZPE Client And Server Technology is the way in which Remote ZPE (rZPE) works. It is currently based on a point to point communication protocol through a single port. A server initiates and a client sends a request for a connection. It is currently based on a multithreaded server that opens a ZPE command line to the client. This allows remote testing and more importantly remote access to a system. It currently does not encrypt the connection, but I am working on bringing this in the near future. 

The ZPE commands that do this will soon be removed, in favour of the -n ZAC that was added in version 1.5.1. I will be redesigning the message consoles too so that when a server is connected to a client, the client opens a server and sends a request to the server it has connected to open a client and connect back, reducing the number of jobs needed by the users of each client and server.

All of this is planned for the next version of ZPE, version 1.5.2.

Also, the CLI version number put at the top of the zpe command in every version to date has been incorrect and only outputted the version number of the ZPE application. It has now been updated so that it displays the correct information, showing what version ZLC (Zenith Language Compiler) is in. As of 1.5.2 this is version 1.6. Also, the ZenEXecutable specification has changed, thus all compiled programs need to be recompiled. 

ZPE 1.5.0 brought a ton of new features that make it better than it ever was. But version 1.5.1 has brought about even more. Now version 1.5.1 which recently was released to beta users has been improved further. It's main focus has been on improving the back-end compiler, and it seriously has. The compiler now follows a different path to the interpreter, something planned for a long time. This update changed ZenEx and how it works compared with before and will mean that you will need to recompile any applications written in ZenLang.

On top of this it has received some Java-based TLC. Users who develop Java applications will have a much easier time accessing what they need, when they need it. Everything is now packaged up in to a bunch of very neat little packages and classes, rather than all residing within the ZPE package. For instance, you can now find GUI based stuff in:

jamiebalfour.zpe.GUI

And the core is now found in:

jamiebalfour.zpe.Core

Easier by a long shot.

Also, the public methods class called PublicMethods is now found at:

jamiebalfour.zpe.Core.PublicMethods

This was added in version 1.5.1 and it adds many new methods that are there for developers to take advantage of. One such example now opens all internal functions to Java developers, no longer limiting them in to using ZenLang to access these (prior to this the plan was to use the public Execute function to get a result). 

zpe
engine
zenith
update
2017
1.5.1B
1.5

Yesterday I tried out ZPE Remote with a friend across the Internet. It works well and he was able to execute commands on my MacBook Pro over the Internet. 

Most crucially, ZPE Remote also restricted access to certain built in methods using permission levels that would not be possible to bypass in the interpreter. I will continue to test this with people, allowing them try out certain features of ZPE Remote and let me know where it could be improved. 

ZPE 1.5.2 is now available to download from my website. It is a huge update that brings so much (and removes so much). ZPE 1.5.2 is known by its code name Pelegosto.

Let's start with what's being removed:

  • string_concatenate - added in version 1.3.0, deprecated in version 1.5.0 and now removed in version 1.5.2
  • open_remote_client - added in version 1.5.0, deprecated in version 1.5.1 and now removed in version 1.5.2.
  • open_remote_server - added in version 1.5.0, deprecated in version 1.5.1 and now removed in version 1.5.2.

Now for what's new:

  • Serialisation and deserialisation of objects and structures: objects and structures can now be saved to disk and retrieved later. This feature is a particular favourite of mine.
  • Custom keywords: finally you can customise the compiler with your own keywords and how they are interpreted. This feature is in its early days, but it works as expected.
  • Constructors for structures: now you can instantiate a structure with a set of parameters. This feature was requested by one of the original testers of ZPE, wondering why it was you couldn't do this. Well, now I've done it.
  • General improvements that fix a few bugs
  • Performance improvements, particularly with mathematics
  • The jget ZAC, based on cURL. This ZAC is designed to download a file from the central repository of ZPE tools and features. For instance running zpe -jget stdLib.zex will download the compiled standard library (now over 400 lines long). 

ZPE 1.5.3 is already underway and it's main focuses are on better structures and ZPEObjects as well as a much better compiler. So far in ZPE 1.5.3 the new -l argument for the compiler. This allows you to compile an application into a library, meaning the main function will not be included for efficiency.

zpe
engine
zenith
update
2017
1.5.2
launch

I consistently release a new version of ZPE each year. This year version 1.5 has been released.

In 2015 version 1.3 was released which brought the most changes to ZPE since it began in 2014. Version 1.3 added so much including the very basic compiler that version 1.2 started. Over 50 functions were added in this version. This version added if statements, for loops, while loops, functions, structures (although they didn't work properly until 1.4), RMM (Real Math Mode), plugins, libraries, lists, associative arrays, constants, variables, incrementing and decrementing, built-in converters (and for a while one example did even exist that converted ZPE code to Java), image functions and of course, my favourite feature of ZPE, anonymous/lambda functions.

In 2016 version 1.4 was released and it brought a huge shake-up of changes, but its main focus was consistency between internal functions and imported ones. It also brought structures that are similar to those used in other languages such as function(){ } instead of function() end function. As well as this it brought the LAMP interpreter, lazy evaluation, function chaining, the object type, a better hashing of variables and functions, the internal manual for information on built-in functions. Version 1.4 also brought support for many other new things, including octal and hexadecimal without the need for a function.

In 2017 version 1.5 was first released. This version currently adds one major new feature, Remote ZPE. Remote ZPE allows a system running ZPE to act as either a client to another ZPE installation or to act as a server that other ZPE Clients can utilise. The purpose of this is for smaller, much less capable machines such as the Raspberry Pi to be able to quickly take advantage of the processing power of a more capable machine. This was developed because I use ZPE remotely on my Raspberry Pi through SSH to do things, but what I'd really like is ZPE to work on my MacBook and send the result to my Pi (so it goes like this Mac connect to Pi through SSH which then uses ZPE Remote to do processing on Mac which returns the result to Pi which shows on my Mac, this way I can process scripts stored on my Pi and utilise them on my Pi).

The future of ZPE 1.5 however is very clear. 2017 will bring the following major features to ZPE:

  • JSON parsing (already done and available in all versions of ZPE) (1.5.0)
  • Remote ZPE: Client and Server (already done and available in all versions of ZPE) (1.5.1)
  • Multi-threading: Currently this project is underway and it's easy to test with ZPE version 1.5.1 (currently beta users only) using the following:
    $v = threaded function() { for ($i = 0; $i < 100000; $i++) print($i) end for }. It's easy to do and I'm sure it makes sense.
  • Interfaces for objects: allowing programmers to define interfaces
  • GUI builder: a way to develop graphical interfaces in applications (not sure if I will include this by default in all installations and might just include it as a library)
  • Conversion methods: New built-in methods to make conversion plugins easier to write
  • Plugins will gain access to internal functions: A method of accessing built-in functions from plugin functions
  • Typo: The new Typo typing system will finally come to version 1.5.x (finished in 1.6.7)
  • Includes: Inclusion techniques to include non compiled code in the non compiled version of the code. Much like the C and PHP include methods. (1.5.1)
  • Include imported functions: The import function will be changed to be a part of the compiler and will change the way it is run. 
  • Ordered associative arrays: associative arrays currently store just one key and do not follow an order, this will allow associative arrays to be ordered (1.6.8)
  • ZPE JSON: Improve JSON parsing and drop the use of GSON (the JSON functions will all work identically to how they work with GSON, it's just the wrapper functions on the top that will change).
  • Improved compiler: the compiler currently flows within the compiler-interpreter cycle whereby the compiler generates the input for the interpreter. This is fine for simply using the -i tool, but when running applications it means that one more step still needs to be run - transform the AST to something meaningful. With the latest update, I aim to change this and put the compiler in a different place. The basics of the compiler will remain the same, but one more step will be added when compiling to a compiled program. This will improve the speed of the ZPE Runtime when applied to a compiled application (it will have no effect on the interpreter). (1.7.1)
  • Power to the objects: objects, and, as a side-effect structures will be getting more powerful. It will soon be possible to declare a function within an object using lambda functions. As well as this objects will be getting more support in the LAMP parser. (1.6.3)
  • Passing parameters by reference: just as it says. I aim to have this feature in version 1.5.3. This would mean functions like list_dequeue would no longer need to be reassigned to the variable. (1.7.1)

I am highlighting in green the features as they get added and highlighting in orange features that are partially added, so keep an eye on this post for updates.

There are several more but they will be put here once I have decided whether or not they are feasible or not.

This is a very tall order, and Typo and the conversion functions are currently at the bottom of the stack and although they have been suggested for this version and were originally planned for version 1.4, I still may need to delay them to version 1.6.

Also, with the release of version 1.5, support for any version 1.4 iterations of the software has now ended, I encourage you to upgrade to the latest version of ZPE.

zpe
engine
zenith
update
2017
major

Since I started ZPE a year and a half ago it's come a very long way. From time to time I've put development in the background of my life, but I've begun working solid on it again. Now in January 2017 there are a whopping 155 built in functionalities plus a standard library designed to supplement the core functionalities with additional ones including sorting functions and much more.

When I launched ZPE publicly for the first time in July 2015 there were just 30 odd functions in the core. I was struggling to get even to 50 after months of development but suggestions kept flowing in from friends and people who used it. 6 functions have since been removed in favour of compiler based changes (the add, subtract, divide, multiply, modulo and concatenate functions, because all of them have since been replaced by a compiler change called LAMP).

The result of all of this is a much more efficient parser and interpreter but also a much more functional one. Who wants to write their code full of add functions rather than write a simple plus sign for instance? Adding LAMP was one of the biggest changes, and the latest update to it was made in November and it made a huge change that improved it overall. 

I continue to develop ZPE as a major project of my own, but I also use it for things now, and for that it's awesome. I know people do download it but feedback has since become less frequent. 

zpe
engine
zenith
update
january
2017
major
1.5.0.1
Powered by DASH 2.0