Overview
This release expands Ard's app-building story with userland Go FFI support and a rewritten JavaScript backend. It also fixes multi-branch else if checking so conditional chains preserve every branch correctly.
New Features
Project Go FFI for user applications
Go-targeted Ard projects can now provide project-local FFI companion files and bind Ard extern fn declarations to them. The compiler copies ffi.go and ffi/*.go into the generated Go workspace, then emits direct static calls to those functions.
extern fn hostname() Str!Str = "Hostname"
package main
import "os"
func Hostname() (string, error) {
return os.Hostname()
}This keeps host APIs behind an explicit project-owned whitelist while letting Ard programs call into practical Go capabilities.
Typed Go extern bindings
Go-targeted projects can now bind extern type declarations to concrete Go type expressions. This lets Ard keep host values opaque while allowing project FFI functions to use precise Go signatures instead of any.
extern type Terminal = "*vaxis.Vaxis"
extern fn open() Terminal!Str = "Open"
extern fn close(term: Terminal) Void!Str = "Close"
The generated Go imports package aliases used in these bindings from the project's FFI companion imports, so Ard code can stay concise while Go remains responsible for external package imports.
Improvements
JavaScript backend rebuilt around AIR
The JavaScript target has been rewritten around AIR, aligning it with the compiler's backend boundary and improving consistency with other targets. This is an internal architecture change, but it should make JavaScript output more maintainable and easier to evolve.
More representative benchmark coverage
The benchmark suite now includes additional workloads such as base64 processing, binary trees, DNA frequency counting, JSON serde, LRU cache behavior, and numeric kernels. These programs help track backend behavior on more realistic workloads.
Bug Fixes
Correct else if chains
Ard now preserves all conditions in multi-branch else if chains. Previously, later else if branches could be collapsed incorrectly, causing a later condition's body to run as a broad fallback.
if key == "q" {
// quit
} else if key == "up" {
// move up
} else if key == "r" {
// reset
} else {
// fallback
}
Each branch is now checked and lowered distinctly.
Release: v0.17.0
Commit: 47121ec