Learn by building

YASS examples for real ideas.

Start with a small program, understand the shape of it, and then make it your own. These examples are here to show how YASS reads and what ZPE can do with it.

ƒ
The basics

Give an idea a name

Functions keep a useful piece of behaviour together and make it easy to use again.

function greet($name)
  return "Hello " + $name
end function

print(greet("Jamie"))
Hello Jamie
{ }
Data and records

Describe the things you use

Records provide a clear way to group related values and construct named data.

record pupil
  forename = ""
  surname = ""
  age = 0
end record

$pupil = new pupil(surname = "Smith", age = 35)
print($pupil)
{forename:"", surname:"Smith", age:35}
</>
Web pages

Keep the page close to the code

YASS Web Pages combine a normal page structure with a small amount of dynamic application code.

<?ywp
$page_title = "Welcome"
$name = "Jamie"
render("/templates/base.ywp")
ywp?>

<h1>Hello <?ywp print($name) ywp?></h1>
Hello Jamie
↻
Algorithms

Make repetition readable

YASS gives common programming tasks a direct shape without hiding what the program is doing.

$numbers = [1, 2, 3, 4, 5]
$total = 0

for ($number in $numbers)
  $total = $total + $number
end for

print($total)
15
Keep going

These are starting points, not limits.

Use the same language for automation, websites, native applications, data processing and the projects you have not thought of yet.

Get ZPE →