macOS · Cocoa + WebKit

Speak

A tiny English-like scripting language for macOS. Statements read like sentences, network calls and real native windows are built in, and any script compiles straight to a distributable .app in a .dmg.

$curl -fsSL https://luispeak.pages.dev/install.sh | bash

Running scripts

Every Speak file is a plain list of statements, one per line, run top to bottom.

speak myscript.spk

Compiling to .dmg

The script's source is embedded directly into a compiled binary — no .spk file needed at runtime.

speakc myscript.spk MyAppName

This produces MyAppName.dmg: a real disk image containing MyAppName.app, plus an Applications shortcut for drag-to-install.

Variables

set x to "hello"
show x

set <name> to <expr> stores a value. Variables can hold strings, numbers, or the response of a network call.

Networking

get "https://example.com" into response
show the status of response
show the body of response

send "https://example.com" with body "..." into response

get performs an HTTP GET. send performs an HTTP POST with the given body and a Content-Type: application/json header. Both store a response object with two readable fields: the status of <var> and the body of <var>.

Output

show "some text"
show x
show the status of response

show prints to the terminal (stdout).

Conditionals

if the status of response is 200
    show "ok"
otherwise
    show "failed"
end

if <expr> is <value> compares as strings. end always closes the block. Blocks can nest.

Windows

Windows are numbered (window 1, window 2, …). Most statements default to window 1 if no number is given.

open window 1 titled "My App"
open a window titled "My App"       -- same as "open window 1"

Text windows

write "some text" in the window     -- window 1
write "some text" in window 2
add "some text" to window 2         -- "add" is an alias of "write"
add the body of response to window 1
clear window 1

Browser windows

load html from "example.com" and put into window 1
load html from "https://example.com" into window 2

Real page load via WKWebView — CSS, JS, and images all render normally.

Widgets

add a search bar to window 1        -- Google search, replaces window 1's content
add a refresh button to window 1    -- reloads the loaded page
add a command line to window 2      -- a live REPL: typed lines run as Speak statements

The command line widget feeds whatever you type (and press Return on) straight back into the interpreter — so show 2 or get "url" into r typed into a running app's command line actually executes.

Window management

resize window 1 to 800x600
close window 1

Closing any window ends the whole script/app — like quitting.

Full example

open window 1 titled "Browser"
add a search bar to window 1
add a refresh button to window 1
load html from "example.com" and put into window 1

open window 2 titled "Console"
add a command line to window 2
add "Type a command above and press Return." to window 2

Grammar reference

StatementMeaning
set X to "V"assign
show Xprint
get "url" into RHTTP GET
send "url" with body "B" into RHTTP POST
if E is V / otherwise / endconditional
open window N titled "T"create/show a window
write "T" in window N / add "T" to window Nappend text
clear window Nwipe text
load html from "url" and put into window Nreal webpage
add a search bar to window NGoogle search box
add a refresh button to window Nreload button
add a command line to window Nlive REPL input
resize window N to WxHresize
close window Nclose (ends script)
Speak requires macOS (Cocoa/WebKit) and the Xcode Command Line Tools — run xcode-select --install first if you don't have them.