ZPE Programming Environment

Last updated
YASS
ZPE logo.png
ZPE logo
Paradigm Imperative, functional, object-oriented, procedural
Designed by Jamie Balfour
Developer Jamie Balfour
First appeared2015;9 years ago (2015) [1]
Stable release
1.11.10 [2] / October 9, 2023;5 months ago (2023-10-09)
Typing discipline Dynamic, static, weak, strong, gradual [3]
Implementation language Java, YASS
Platform Cross-platform
OS Unix-like, Windows, macOS
Filename extensions .yas .yex
Website https://www.jamiebalfour.scot/projects/zpe/
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.

Contents

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+$yprint($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=10declareyasnumber=10print($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.

Related Research Articles

OCaml is a general-purpose, high-level, multi-paradigm programming language which extends the Caml dialect of ML with object-oriented features. OCaml was created in 1996 by Xavier Leroy, Jérôme Vouillon, Damien Doligez, Didier Rémy, Ascánder Suárez, and others.

<span class="mw-page-title-main">Abstract syntax tree</span> Tree representation of the abstract syntactic structure of source code

An abstract syntax tree (AST) is a data structure used in computer science to represent the structure of a program or code snippet. It is a tree representation of the abstract syntactic structure of text written in a formal language. Each node of the tree denotes a construct occurring in the text. It is sometimes called just a syntax tree.

Bytecode is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

In computer-based language recognition, ANTLR, or ANother Tool for Language Recognition, is a parser generator that uses a LL(*) algorithm for parsing. ANTLR is the successor to the Purdue Compiler Construction Tool Set (PCCTS), first developed in 1989, and is under active development. Its maintainer is Professor Terence Parr of the University of San Francisco.

JScript .NET is a .NET programming language developed by Microsoft.

In computer programming, operators are constructs defined within programming languages which behave generally like functions, but which differ syntactically or semantically.

<span class="mw-page-title-main">Factor (programming language)</span> Stack-oriented programming language

Factor is a stack-oriented programming language created by Slava Pestov. Factor is dynamically typed and has automatic memory management, as well as powerful metaprogramming features. The language has a single implementation featuring a self-hosted optimizing compiler and an interactive development environment. The Factor distribution includes a large standard library.

<span class="mw-page-title-main">Syntax (programming languages)</span> Set of rules defining correctly structured programs

In computer science, the syntax of a computer language is the rules that define the combinations of symbols that are considered to be correctly structured statements or expressions in that language. This applies both to programming languages, where the document represents source code, and to markup languages, where the document represents data.

<span class="mw-page-title-main">Racket (programming language)</span> Lisp dialect

Racket is a general-purpose, multi-paradigm programming language and a multi-platform distribution that includes the Racket language, compiler, large standard library, integrated development environment (IDE), development tools, and a set of additional languages including Typed Racket, Swindle, FrTime, Lazy Racket, R5RS & R6RS Scheme, Scribble, Datalog, Racklog, ALGOL 60 and several teaching languages.

A foreign function interface (FFI) is a mechanism by which a program written in one programming language can call routines or make use of services written or compiled in another one. An FFI is often used in contexts where calls are made into binary dynamic-link library.

Haxe is a high-level cross-platform programming language and compiler that can produce applications and source code for many different computing platforms from one code-base. It is free and open-source software, released under the MIT License. The compiler, written in OCaml, is released under the GNU General Public License (GPL) version 2.

V8 is a JavaScript and WebAssembly engine developed by Google for its Chrome browser. V8 is free and open-source software that is part of the Chromium project and also used separately in non-browser contexts, notably the Node.js runtime system.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">Elm (programming language)</span> Functional programming language

Elm is a domain-specific programming language for declaratively creating web browser-based graphical user interfaces. Elm is purely functional, and is developed with emphasis on usability, performance, and robustness. It advertises "no runtime exceptions in practice", made possible by the Elm compiler's static type checking.

Idris is a purely-functional programming language with dependent types, optional lazy evaluation, and features such as a totality checker. Idris may be used as a proof assistant, but is designed to be a general-purpose programming language similar to Haskell.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

References

  1. "ZPE Programming Environment information". ZPE Information. Retrieved 2019-02-02.
  2. "ZPE Changelog". ZPE Changelog. Retrieved 2023-10-09.
  3. 1 2 3 4 "What is ZPE?". ZPE Documentation. Retrieved 2019-02-02.
  4. 1 2 "ZPE Programming Environment documentation". ZPE Documentation. Retrieved 2019-02-02.
  5. "About this website". About this website. Retrieved 2020-07-24.
  6. 1 2 "ZPE Changelog : ZPE Programming Environment Documentation :: jamiebalfour.scot". ZPE Documentation. Retrieved 2019-03-10.
  7. "Jamie Balfour's Blog: YASS Unfold". ZPE Information. Retrieved 2023-10-06.