Repository navigation
Zeno 0.2.0
Zeno 0.2 adds two things: a Zeno program can be a web page, and Zeno
has installers.
Installing
Windows: download zeno-0.2.0-windows-setup.exe below and run it.
It is not signed, so Windows warns the first time: "More info", then
"Run anyway".
macOS and Linux:
curl -fsSL https://github.com/partham20/zeno-lang/releases/download/v0.2.0/install.sh | shBoth put zeno on the PATH and offer to install a C compiler and git
if the machine has none.
docs/install.md
says what they do. The archives further down are for installing by
hand.
With a package manager. There is a package for apt, pacman, snap
and flatpak, installed from its file:
sudo apt install ./zeno_0.2.0_amd64.deb # Debian, Ubuntu, Raspberry Pi OS
sudo pacman -U zeno-bin-0.2.0-1-x86_64.pkg.tar.zst # Arch
sudo snap install --classic --dangerous zeno_0.2.0_amd64.snap
flatpak install --user zeno-0.2.0-x86_64.flatpakThe .deb is also there for arm64, armhf (every Raspberry Pi with
a 32-bit system) and i386, the snap for arm64 and armhf, and the
flatpak for aarch64. apt installs a C compiler and git along with
Zeno if the machine has none.
Homebrew, on macOS and Linux:
brew tap partham20/zeno-lang https://github.com/partham20/zeno-lang
brew install partham20/zeno-lang/zenoFor winget there are three files in
packaging/winget,
which are what Microsoft's collection of packages takes.
docs/packages.md
says what each package is, and what is still to be done before
apt install zeno and the rest work with one word.
A program in a web page
import web
let count = web.element("#count")
var presses = 0
function pressed() {
presses += 1
count.text = f"{presses} presses"
}
web.element("#press").on("click", pressed)
zeno build --web counter.zeno writes counter.web.html, one file
that a browser opens from the disk or from a web server. It holds the
page (counter.html beside the program, or an empty page that shows
what the program prints), the program, and Zeno itself built for
WebAssembly, so the browser checks and runs the program as zeno run
does.
zeno run and zeno test run the same program on a simulated page
that prints each change somebody would see, so what a page does can be
tested without a browser.
docs/web.md
walks through it. examples/todo.zeno is a list of things to do, and
examples/sketch.zeno a sheet to draw on with the mouse.
zeno playground writes playground.html: a page in which Zeno
programs are written and run in a browser, with nothing installed
(docs/playground.md).
Nothing that ran under 0.1 changes.
What the web module has
web.element("#count"),web.elements("li"),web.create("li", "Buy milk")web.after(500 ms, tick),web.every(1 s, tick)andweb.on_key(pressed)web.save,web.loadandweb.forget: text kept between visitsweb.fetch(address, done)andweb.post(address, text, done): the
network.doneis called with the status and the text of the answer- An
Elementhastextandvalue, andon,fire,append,
remove,clear,get,set,add_class,remove_class,
has_class,show,hide,set_styleandget_style - On a
<canvas>:draw_rect,draw_circle,draw_line,draw_text
anderase - A function given to
onmay take anEvent, which haskind,
target,x,yandkey
If todo.html is beside todo.zeno, zeno run and zeno test read
it, so asking for an element the page does not have is an error on a
desk as it is in a browser.
import json reads and writes JSON, in a page and everywhere else
zeno run goes: json.parse(text) gives the value the text
describes, and json.write(value) the text of a value. It is how a
page reads what a server answers.
web.after and web.every give a Timer, and timer.stop() calls
off what it was waiting to do.
What it does not have yet: images and curves on a canvas. A built
page carries the whole of Zeno, 0.4 MB, runs at the speed of zeno run, and needs a browser from 2023 or later.
Smaller things
minandmaxtake quantities in one unit:max(readings)of a
list[V]is in volts.zeno test --only "empty"runs the tests with that text in their
name.- In an editor, resting the mouse on a field (
p.x) says its type. - For
let x: str = first([1])the mistake is said atx.
The licence
Zeno is under the MIT licence from this version: use it, change it and
pass it on, and keep the notice. The file LICENSE is in every
archive, in what the installers install, and in every package.
The archives
| Machine | File |
|---|---|
| Linux, x86-64: most PCs and servers | zeno-0.2.0-linux-x86_64.tar.gz |
| Linux, ARM64: a Raspberry Pi 3, 4 or 5 with a 64-bit system, ARM servers | zeno-0.2.0-linux-arm64.tar.gz |
| Linux, 32-bit ARMv7: a Raspberry Pi 2 or later with a 32-bit system | zeno-0.2.0-linux-armv7.tar.gz |
| Linux, 32-bit ARMv6: a Raspberry Pi 1 or Zero | zeno-0.2.0-linux-armv6.tar.gz |
| Linux, 32-bit x86 | zeno-0.2.0-linux-x86.tar.gz |
| macOS, Apple silicon | zeno-0.2.0-macos-arm64.tar.gz |
| macOS, Intel | zeno-0.2.0-macos-x86_64.tar.gz |
| Windows, x86-64 | zeno-0.2.0-windows-x86_64.zip |
| Windows, 32-bit x86 | zeno-0.2.0-windows-x86.zip |
| Windows, ARM64 | zeno-0.2.0-windows-arm64.zip |
Unpack it and put zeno (zeno.exe on Windows) somewhere on your
PATH. To build web pages, put zeno.wasm from the same folder
beside it. The folder also holds the docs, the examples and the editor
setup.
tar -xzf zeno-0.2.0-linux-x86_64.tar.gz
cd zeno-0.2.0-linux-x86_64
./zeno --version
./zeno build --web examples/todo.zeno # then open todo.web.htmlOn macOS, a program downloaded with a browser is held back because
Apple has not signed it. xattr -d com.apple.quarantine zeno lets it
run.
zeno build hands the C it writes to a C compiler, so it needs one:
cc, gcc or clang, whichever it finds first, or the one CC
names. On Windows it no longer needs set CC=gcc.
zeno build --llvm needs clang. zeno fetch needs git. zeno build --web and everything else need nothing.
What was checked
As for 0.1.0, every build but the Windows one for ARM64 was run before
it was released, and each one that was run also built the page of
examples/todo.zeno. The whole test suite, 492 tests, passes on
Linux x86-64.
The pages themselves were tried in one browser, Chromium: clicks,
keys, timers, a form, text in Tamil, a program in several files with
a package, an error in a function that a timer called, drawing with
the mouse, a colour kept between visits, the network from a page on
a web server, and the playground. Other browsers have not been
tried.
The setup program for Windows was installed, run and uninstalled on a
Windows machine before it was released, and install.sh the same on
Linux and on macOS. The step of the setup program that installs a C
compiler and Git with winget was not run by any test.