ZPE Programming Environment

From HandWiki
Short description: Scripting language
YASS
ZPE logo.png
ParadigmImperative, functional, object-oriented, procedural
Designed byJamie Balfour
DeveloperJamie Balfour
First appeared2015; 9 years ago (2015)[1]
Stable release
1.11.10 [2] / October 9, 2023; 9 months ago (2023-10-09)
Typing disciplineDynamic, static, weak, strong, gradual[3]
Implementation languageJava, YASS
OSUnix-like, Windows, macOS
Filename extensions.zpe, .zen, .yex, .zhtml, .zhtm, .ywp
Influenced by
C, PHP, Java, JavaScript, VB.NET, C#.NET, SML, Python[3]

ZPE Programming Environment (or simply ZPE) formally the Zenith Parsing Engine is a general-purpose compiler, parser and runtime environment for the YASS language designed for educational use as well as for its general use. The language it interprets, YASS, is an interpreted, high-level, general-purpose programming language. YASS is largely built upon making the language easy to read and use, with optional support for syntaxes such as curly-bracket syntax. YASS supports dynamic typing or static typing, as well as strong typing and weak typing.

It was started in 2015 as a planned university project but later was changed to be a replacement for another programming language developing at the time known as BlackRabbit Script, also built by Jamie Balfour. ZPE and YASS were designed to help with the automation of scripts by clearing up the inconsistent syntaxes of other scripting languages.[3] The Zenith Parsing Engine (formerly ZenithParser) powers the underlying parsers including the CSV, JSON and XML parsers.

YASS

The language interpreted by the ZPE runtime is known as YASS or Yet Another Simple Syntax.[4] Several languages influenced the YASS syntax including C, PHP, Java, JavaScript, VB.NET, C#.NET, SML and Python[3] which has remained largely the same since about version 1.5. ZPE/YASS can be used for general purpose programming, support client and server communications and can be used for server side scripting. Some websites are already using ZPE alongside other languages such as PHP.[5]

The ZPE Programming Environment itself is written in Java making it cross-platform. A side effect of this is that certain plugins and built-in objects are completely written in Java.

Whilst ZPE is closed source, the standard library is open-source and written in YASS itself.

Features

ZPE features many built-in functions including functions that simplify mathematical problems such as the greater_than_all function, the to_binary, to_octal and to_hexadecimal functions as well as many functions to simplify processing of arrays such as list_process, list_find_duplicates and list_auto_populate. ZPE also features a parser known as the Zenith Parser Engine which forms the foundation of the whole language processor and performs both lexical analysis and compiler optimisation on textual input.

On the original subsite dedicated to ZPE, there is a documentation section that documents all language constructs, internal functions and the syntax of the language.[4]

ZPE was originally built as a planned university project that never came to fruition and in the end and was eventually used as the replacement for the BlackRabbit Script language that Balfour was developing at the time. ZPE originally had no mathematical parser which meant that functions were used for addition, subtraction, division and multiplication. An example of this early syntax:

$x = 10
$y = 15

$z = add($x, $y)

print($z)

In late 2015, still in version 1.3.x of ZPE, the Real Math Mode (RMM) parser was added. Syntax changed so that it looked a lot more like other languages:

$x = 10
$y = 15

$z = $x + $y

print($z)

To improve performance, the Real Math Mode parser was replaced by the Logical And Mathematical Parser (LAMP) in 2016 and then the Logical And Mathematical Evaluator (LAME) in 2019.[6]

ZPE and YASS also supports a mix of strong typing and weak typing in the same script:

$x = 10
declare y as number = 10

print($x)
print(y)

ZPE Native

In August 2022, using the GraalVM compiler, an AArch64 build was compiled. This offered performance much better than the JRE version alone. ZPE Native can improve performance considerably but is not cross-platform and is only available on current platforms at present (this includes an EXE for Windows and a Linux compatible binary as well as the AArch build).

YASS Unfold

YASS Unfold is a syntax analyser that can be used to transform syntax to descriptions. YASS Unfold works based on the AST generated from the code to generate descriptions of code. [7]

Libraries

ZPE/YASS rely on libraries being developed to extend functionality. The main reason behind this is to reduce the size of the main runtime package. Certain libraries are written in the YASS language itself and then compiled. They are then distributed via the ZULE network which was added in 2018.[6]

Other libraries are written in native Java. For example, the zpe_mysql library is used to add MySQL functionalities to the language through the use of a library which itself is around 6 times the size of the original runtime.

References

  1. "ZPE Programming Environment information". ZPE Information. //www.jamiebalfour.scot/projects/zpe/about/. 
  2. "ZPE Changelog". ZPE Changelog. //www.jamiebalfour.scot/projects/zpe/documentation/other/changelog/. 
  3. 3.0 3.1 3.2 3.3 "What is ZPE?". ZPE Documentation. //www.jamiebalfour.scot/projects/zpe/documentation/getting-started/what-is-zpe. 
  4. 4.0 4.1 "ZPE Programming Environment documentation". ZPE Documentation. //www.jamiebalfour.scot/projects/zpe/documentation/. 
  5. "About this website". About this website. //www.ifra.org.uk/about/site/. 
  6. 6.0 6.1 "ZPE Changelog : ZPE Programming Environment Documentation :: jamiebalfour.scot". ZPE Documentation. //www.jamiebalfour.scot/projects/zpe/documentation/other/changelog/. 
  7. "Jamie Balfour's Blog: YASS Unfold". ZPE Information. //www.jamiebalfour.scot/blog/posts/yass-unfold.