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

ZPE Programming Environment has been my main project for over 11 years now, and it's so solid, so fast, and so feature-rich. As a result, I want a new programming language project and that new language is Zpeedy Script. 

Zpeedy Script was first conceptualised in June and had been sitting for months with little work done until a few days ago. It uses the ZPE core, ensuring it runs fast, requires minimal development, and is well integrated with the YASS programming language. Zpeedy Script is incredibly descriptive, and code reads almost like a sentence. In my opinion, this will make it a bit more difficult for seasoned programmers to learn, but I've got plans to allow YASS to be included as well, and since YASS reads like many other languages, it should be really easy to mix the languages. 

Below is an example of Zpeedy Script:

// Zpeedy Script language showcase
display "Zpeedy Script showcase"

// Public routines, parameters, calls and returned values
routine displayGreeting takes person
  display person

routine double takes number
  give back number * 2

routine add takes firstNumber, secondNumber
  give back firstNumber + secondNumber

call displayGreeting with "Jamie"
set doubledByRoutine to call double with 10
set totalFromRoutine to call add with 10, 20
display doubledByRoutine
display totalFromRoutine

// Values, variables, lists and arithmetic
set name to "Jamie"
set enabled to true
set missingValue to nothing
set unknownValue to unknown
set startingNumber to 5
set doubledNumber to startingNumber times 2
set increasedNumber to doubledNumber plus 3
set calculatedNumber to increasedNumber minus 1
set animals to ["Dog", "Cat", "Fox"]

display name
display enabled
display missingValue
display unknownValue
display calculatedNumber
display animals

// Indentation-based conditions
if calculatedNumber is greater than 20 then
  display "The result is greater than twenty"
alternatively if calculatedNumber is at least 12 then
  display "The result is at least twelve"
alternatively if calculatedNumber is not 12 then
  display "The result is not twelve"
otherwise
  display "The result is twelve"

// Cached value selection
set colour to "amber"
set instruction to choice based on colour
  "red" gives "Stop"
  "amber" gives "Wait"
  "green" gives "Go"
  otherwise gives "Unknown colour"
display instruction

// Statement selection
when colour
  is "red" then
    display "Stop"
  is "amber" then
    display "Wait"
  is "green" then
    display "Go"
  otherwise
    display "Unknown colour"

// Boolean value selection
when enabled
  is true then
    display "The program is enabled"
  is false then
    display "The program is disabled"

// Iterate over every list value
for every animal in animals
  display animal

// Conditional loop
set counter to 0
loop while counter is less than 3
  display counter
  set counter to counter plus 1

// Fixed repetition
repeat 2 times
  display "Repeated"

// An indefinite loop can be stopped explicitly
repeat forever
  display "The forever loop ran once"
  stop loop

// Protected execution with an error-message handler
attempt
  display "The attempted operation succeeded"
otherwise on error message
  display message

display "Showcase complete"

Powered by DASH 2.0