picture
zsx / basic
program
fun main() { imu picture: </> ::= <img src="picture.jpg" width="480" height="270" />; #render picture; }
This program displays an image on screen. The <img/> element is self-closing, and holds attributes but no children. src names the image file, and width and height set its size in pixels.
An attribute reads one of two ways. A literal sits in quotes, like src="picture.jpg". A value from your code sits in braces, like width={size}, and zsx fills it in.
#render picture; turns the markup into draw commands and shows it in a window.
A relative
srcresolves against the program’s folder, sopicture.jpgsits beside the source. A fullhttp(s)://URL loads straight from the web.