Packs

Packs keep Ax small while adding native capability.

Built-In Packs

PackOperationsEffects
std.ioio.println, io.print, io.eprintln, io.read_lineio.stdout, io.stderr, io.stdin
std.fsfs.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.modifiedfs.read, fs.write
std.cryptocrypto.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_v4crypto.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.envenv.get, env.has, env.set, env.get_or, env.snapshot_json, env.load_dotenv, env.load_dotenv_jsonenv.read, env.write; dotenv loading also uses fs.read
std.processprocess.exec, process.exec_limit, process.status, process.run_json, process.run_log_json, process.run_lines_json, process.run_log_lines_jsonprocess.exec; log helpers merge stderr into bounded diagnostic output, and line helpers return JSON arrays
std.clicli.argc, cli.arg, cli.has, cli.value, cli.value_or, cli.args_json, cli.parse_jsoncli.read; parse helpers return compact argv, positional, flag, and option manifests
std.jsonjson.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_jsonpure; state, array append, key, and nested array helpers support JSON pipelines
std.strstr.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_jsonpure
std.pathpath.normalize, path.join, path.basename, path.dirname, path.extname, path.stem, path.is_absolutepure
std.timetime.now, time.now_ms, time.iso_utc, time.sleep_mstime.now, time.sleep
std.urlurl.encode, url.decode, url.query_get, url.query_or, url.query_has, url.query_json, url.path, url.host, url.schemepure
std.net.httpserver blocksnet.listen, net.read, net.write
std.net.http.clienthttp.get, http.post, http.get_json, http.post_jsonnet.read, net.write
std.net.tcptcp blocksnet.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