V / vulcan documentation

Venus

Your first Venus interface

Venus is Vulcan's UI layer. An application is a .v program; its view is a value, its state lives in signals, and Vega executes it in the browser through WebAssembly.

A counter

Create app.v in a directory under n1/vulcan so the versioned Venus kit resolves:

import using * from "ui:venus@v0"

let $count = 0

fn counter_view(): unk {
  return col({ gap: 16, pad: 24 }) {
    text_p(`Count: {$count}`, { role: "title" })
    btn("Add one", on(() => { $count += 1 }))
  }
}

app_with(() => counter_view(), "", (ev: unk) => { return None })

The dollar prefix reads and writes a signal. An event handler updates that signal; the next view reflects its value. The application behavior is Vulcan, not a JavaScript component.

Build for the browser

node n1/vulcan/venus/bin/venus.mjs build n1/vulcan/my-app/app.v --out /tmp/my-venus-site

Replace the input path with your file. The output is a static bundle. Keep its application image, runtime modules and WebAssembly files together, and serve them over HTTP or HTTPS with the correct content types.

Host capabilities

Use host.mjs only for integration with the outside world, such as browser APIs or HTTP requests. State transitions, components and application behavior stay in .v files. A static Venus UI does not require a Node.js application server.

This site is Venus

The interactive documentation you are reading is a Venus application. The same Markdown corpus also produces readable HTML for direct links, search engines and readers who disable JavaScript.