soma.cell

Native code builtins

18 builtins of Soma 3.2.4 in the category Native code, with their exact signatures, as soma describe --builtins --json prints them.

buffer

buffer(n: Int) -> Buf   [native] only

Array of n Ints, zeroed. Random access with buf_get / buf_set. Not available in interpreted handlers.

deterministic · replay: pure

buf_get

buf_get(b: Buf, i: Int) -> Int   [native] only

Read b[i].

deterministic · replay: pure

buf_set

buf_set(b: Buf, i: Int, v: Int) -> ()   [native] only

Write b[i] = v.

deterministic · replay: pure

buffer_f

buffer_f(n: Int) -> BufF   [native] only

Array of n Floats, zeroed (buf_get_f / buf_set_f).

deterministic · replay: pure

buf_get_f

buf_get_f(b: BufF, i: Int) -> Float   [native] only

Read b[i].

deterministic · replay: pure

buf_set_f

buf_set_f(b: BufF, i: Int, v: Float) -> ()   [native] only

Write b[i] = v.

deterministic · replay: pure

hashmap

hashmap() -> HMap   [native] only

Int → Int hash map (hm_get / hm_set / hm_inc / hm_len / hm_has).

deterministic · replay: pure

hm_get

hm_get(m: HMap, k: Int) -> Int   [native] only

Value at k, 0 when absent.

deterministic · replay: pure

hm_set

hm_set(m: HMap, k: Int, v: Int) -> ()   [native] only

m[k] = v.

deterministic · replay: pure

hm_inc

hm_inc(m: HMap, k: Int) -> ()   [native] only

m[k] += 1 (inserting 1).

deterministic · replay: pure

hm_len

hm_len(m: HMap) -> Int   [native] only

Number of keys.

deterministic · replay: pure

hm_has

hm_has(m: HMap, k: Int) -> Bool   [native] only

Whether k is present.

deterministic · replay: pure

strbuf

strbuf(capacity?: Int) -> SBuf   [native] only

Growable string builder (sb_push / sb_push_int / sb_push_char / sb_len / sb_finish).

deterministic · replay: pure

sb_push

sb_push(b: SBuf, s: String) -> ()   [native] only

Append a string.

deterministic · replay: pure

sb_push_int

sb_push_int(b: SBuf, n: Int) -> ()   [native] only

Append an Int's decimal digits.

deterministic · replay: pure

sb_push_char

sb_push_char(b: SBuf, c: Int) -> ()   [native] only

Append one character by code point.

deterministic · replay: pure

sb_len

sb_len(b: SBuf) -> Int   [native] only

Bytes so far.

deterministic · replay: pure

sb_finish

sb_finish(b: SBuf) -> String   [native] only

The built String.

deterministic · replay: pure