Packs
Packs keep Ax small while adding native capability.
Built-In Packs
| Pack | Operations | Effects |
|---|---|---|
std.io | io.println, io.print, io.eprintln, io.read_line | io.stdout, io.stderr, io.stdin |
std.fs | fs.read_text, fs.read_text_or, fs.read_text_limit, fs.read_text_range, fs.read_text_tail, fs.read_lines, fs.read_lines_json, fs.read_jsonl, fs.read_json, fs.read_json_or, fs.read_base64, fs.read_base64_range, fs.read_base64_tail, fs.write_text, fs.write_text_atomic, fs.write_json_atomic, fs.write_base64, fs.append_text, fs.append_jsonl, fs.exists, fs.remove, fs.remove_dir, fs.mkdir, fs.mkdir_all, fs.ensure_parent, fs.list, fs.list_json, fs.list_stat_json, fs.walk, fs.walk_json, fs.walk_stat_json, fs.find, fs.glob, fs.copy, fs.rename, fs.size, fs.stat_json, fs.cwd, fs.temp_dir, fs.is_file, fs.is_dir, fs.modified | fs.read, fs.write |
std.crypto | crypto.sha256_hex, crypto.sha256_json, crypto.sha256_verify_hex, crypto.hmac_sha256_hex, crypto.hmac_sha256_json, crypto.hmac_sha256_verify_hex, crypto.hmac_sha256_file_hex, crypto.hmac_sha256_file_json, crypto.hmac_sha256_file_verify_hex, crypto.hmac_sha256_file_range_hex, crypto.hmac_sha256_file_range_json, crypto.hmac_sha256_file_range_verify_hex, crypto.sha256_file_hex, crypto.sha256_file_json, crypto.sha256_file_verify_hex, crypto.sha256_file_range_hex, crypto.sha256_file_range_json, crypto.sha256_file_range_verify_hex, crypto.base64_encode, crypto.base64_decode, crypto.constant_time_eq, crypto.random_hex, crypto.random_base64url, crypto.uuid_v4 | crypto.hash, crypto.random; file hashing, signing, and verification also use fs.read; base64 and compare are pure; JSON digest helpers return compact provenance metadata |
std.env | env.get, env.has, env.set, env.get_or, env.snapshot_json, env.load_dotenv, env.load_dotenv_json | env.read, env.write; dotenv loading also uses fs.read |
std.process | process.exec, process.exec_limit, process.status, process.run_json, process.run_log_json, process.run_lines_json, process.run_log_lines_json | process.exec; log helpers merge stderr into bounded diagnostic output, and line helpers return JSON arrays |
std.cli | cli.argc, cli.arg, cli.has, cli.value, cli.value_or, cli.args_json, cli.parse_json | cli.read; parse helpers return compact argv, positional, flag, and option manifests |
std.json | json.escape, json.quote, json.pair, json.string_pair, json.object, json.array, json.array_push, json.string_array_push, json.set, json.string_set, json.remove, json.compact, json.valid, json.get, json.get_or, json.query, json.query_or, json.query_int, json.query_bool, json.query_kind, json.has, json.query_has, json.int, json.bool, json.contains, json.query_contains, json.kind, json.len, json.query_len, json.at, json.query_at, json.keys, json.keys_json, json.query_keys_json | pure; state, array append, key, and nested array helpers support JSON pipelines |
std.str | str.len, str.contains, str.index_of, str.count, str.starts_with, str.ends_with, str.trim, str.upper, str.lower, str.concat, str.repeat, str.replace, str.slice, str.split_json, str.lines_json | pure |
std.path | path.normalize, path.join, path.basename, path.dirname, path.extname, path.stem, path.is_absolute | pure |
std.time | time.now, time.now_ms, time.iso_utc, time.sleep_ms | time.now, time.sleep |
std.url | url.encode, url.decode, url.query_get, url.query_or, url.query_has, url.query_json, url.path, url.host, url.scheme | pure |
std.net.http | server blocks | net.listen, net.read, net.write |
std.net.http.client | http.get, http.post, http.get_json, http.post_json | net.read, net.write |
std.net.tcp | tcp blocks | net.listen, net.read, net.write |
Make A New Pack
For a fuller walkthrough, see Pack Authoring.
registry/
acme.telemetry/
pack.axpack
native.c
name = "acme.telemetry"
version = "1.0.0"
syntax = []
operations = ["telemetry.track"]
effects = ["telemetry.write"]
native = ["native.c"]
void ax_pack_acme_telemetry_track(void) {
/* native implementation */
}
Use A Pack
ax pack list --registry ./registry
ax pack find telemetry --registry ./registry
ax pack info acme.telemetry --registry ./registry
ax pack install acme.telemetry --registry ./registry
ax build app.ax -o app --registry ./registry