Appendix

The Standard Library & CLI

Forty-eight builtins, four subcommands, eight flags, three faces. This is all of Sure; there is deliberately not more.

Anything

BuiltinDoes
print(x)prints Int, Float, Bool, or String, with a newline
len(x)length of a String (bytes), array, or map
str(x)Int, Float, or Bool as a String

Strings

BuiltinDoes
slice(s, start, end)byte range, end exclusive, clamped
find(s, needle)first index, or -1
split(s, sep)[String] of the pieces
join(parts, sep)the pieces, reassembled
contains / starts_with / ends_withBool questions
trim(s)without surrounding whitespace
upper(s) / lower(s)ASCII case
replace(s, old, new)all occurrences
byte_at(s, i)one byte as Int, bounds-checked
chr(n)one byte as String
to_int(s) / to_float(s)parsed, or zero

Numbers

BuiltinDoes
to_float(n)Int, widened
trunc / round / floor / ceilFloat to Int, four opinions
sqrt(f)the square root
abs(x) / min(a, b) / max(a, b)Int or Float, matching

Arrays

BuiltinDoes
push(xs, v)appends
pop(xs)removes and returns the last (aborts if empty)
sort(xs)in place; [Int], [Float], or [String]

Maps

BuiltinDoes
has(m, key)Bool
delete(m, key)removes, if present
keys(m)[K], in the map's order, not yours

Channels

BuiltinDoes
channel() / channel(cap)a new channel, typed by its declaration
send(c, v)delivers; waits for room, or for a receiver
recv(c)waits for a value; aborts on closed-and-empty
close(c)no more values are coming

The world

BuiltinDoes
args()[String]; index 0 is the program
getenv(name)the variable, or ""
read_line()one line of stdin, or "" at end
time_ms()milliseconds since the epoch
read_file(path)the bytes, or "" if it isn't there
write_file(path, data)Bool, honestly earned
file_exists(path)Bool
tcp_listen(port)a listener, or -1
tcp_accept(fd)waits for a connection
tcp_recv(fd)up to 64 KB, as a String
tcp_send(fd, data)sends it all; returns bytes sent
tcp_close(fd)done

The CLI

CommandDoes
sure build file.sure [-o OUT]compiles. prints 👍.
sure run file.surecompiles and runs; prints only your program's output
sure expand file.surethe post-macro source, plainly
sure blame file.sure f.xwhere x was freed, and the reasoning
sure doctorchecks python, the C compiler, the key, the cache; compiles a test program; tells you you're fine
sure versionsure 0.3.1 (fearless-concurrency)
FlagDoes
--creativity FLOATmemory-layout creativity; 0.7 is suitable for production
--fresh-eyesre-runs inference; the first remediation
--prompt FILEstanding guidance for the compiler
--model NAMEthe model
--api-key KEYthe memory-safety service key (default: SURE_API_KEY)
--emit-irwrites the LLVM IR beside the output
--verbosecompile time and per-function confidence
--reassureadds reassurance

The three faces

FaceMeans
👍everything is fine. this is the whole message.
🫤an error. the indented line below it is precise.
🤔a warning. look at the line. it knows what it did.