You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Track the remaining builtin work for the Zig compiler using modern Roc API shapes.
The old Rust compiler builtin files were used as a capabilities checklist only. This issue should not be read as a request to port old ability-era APIs directly.
Use List(U8), Try(ok, err), and open error rows like Try(a, [OutOfRange, ..]).
Use => for effectful function variants.
Use structural constraints like where [a.is_eq : a, a -> Bool], not old implements constraints.
Prefer module-specific numeric functions such as F64.sqrt or I32.count_one_bits over old generic Num.* shapes unless a generic modern mechanism is deliberately designed.
A row is done when the builtin is declared in Builtin.roc, implemented or lowered, supported by the relevant backend/interpreter path, and covered by focused tests.
Recent Zulip discussion added a few guiding points for this tracker:
Do not automatically re-add every old helper; demand, ergonomics, and performance still matter.
Effectful collection variants are not an immediate priority. Track pure and Try-returning helpers first; put effectful collection variants in the deferred section.
Iter is now part of the builtin direction, so some old List-centric helpers should be expressed as Iter/from_iter/collect APIs instead.
Dict should remain an insertion-ordered hash map; key hashing/equality should mostly be auto-derived, with a modern public hash contract still needing design.
Existing Compiler Wiring Gaps
These are not new public API proposals; they are gaps in wiring for builtin machinery that is already present or partially present.
T.from_numeral : Num.Numeral -> Try(T, [InvalidNumeral(Str), ..]) for every numeric T
Already declared in Builtin.roc and mapped to .num_from_numeral.
The interpreter has support.
The dev backend currently panics for .num_from_numeral.
The wasm backend expects this to be resolved before backend codegen.
Finish dev backend support or earlier lowering for .num_pow, .num_sqrt, .num_log, .num_round, .num_floor, .num_ceiling.
These low-level ops exist in LowLevel.zig.
The interpreter has handlers.
The dev backend currently panics for them.
Wasm supports sqrt, floor, ceiling, and round; pow and log are expected to be resolved earlier.
Finish dev backend support for .compare.
Exercism migration ran into missing Num.compare-style functionality.
The low-level .compare op exists and the interpreter/wasm paths have support, but the dev backend currently panics for it.
Implementation note: backend builtin wrappers should not invent their own reference-counting behavior. They should follow explicit ownership/LIR information produced earlier in the pipeline.
Rows written as T.foo : ... mean the same-shaped function should be added to each concrete module in the listed type group, for example U8.foo, I8.foo, and so on.
Numeric Comparison
T.compare : T, T -> [LT, EQ, GT] for T in IntT
Dec.compare : Dec, Dec -> [LT, EQ, GT]
Decide whether F32.compare and F64.compare should exist, and if so define the NaN ordering semantics before exposing them.
Integer Predicates And Bit Counts
Runtime helpers already exist for is_multiple_of, leading zero count, trailing zero count, and one bit count.
Runtime helpers already export round, floor, and ceiling for F32, F64, and Dec to every integer type. The public API should probably name the destination type explicitly, matching the existing to_i64_try / to_u64_wrap pattern.
For each source S in FracT and destination D in IntT:
Runtime helpers already exist for F32 and F64 bit conversion. Dec needs a final API decision because the old names were decimal-specific (with_decimal_point / without_decimal_point) and the new API should be explicit about whether this is raw representation or scaled decimal coefficient.
F32.to_bits : F32 -> U32
F32.from_bits : U32 -> F32
F64.to_bits : F64 -> U64
F64.from_bits : U64 -> F64
Decide and implement raw Dec representation helpers:
Candidate raw-bit shape:
Dec.to_bits : Dec -> U128
Dec.from_bits : U128 -> Dec
Candidate scaled-coefficient shape:
Dec.without_decimal_point : Dec -> I128
Dec.with_decimal_point : I128 -> Dec
Number Parsing
Whole-string parsing via T.from_str : Str -> Try(T, [BadNumStr, ..]) already exists for all numeric types. Prefix parsing and byte parsing are tracked by #7010 and should be modernized away from the old generic Num.parse spelling.
Candidate modern shape:
T.parse_utf8 : List(U8) -> Try({ output : T, rest : List(U8) }, [OutOfRange, NotANumber, ..]) for every numeric T - see Implement builtin number parsing #7010
Current Str already has UTF-8 conversion, splitting, trimming, ASCII case conversion, prefix/suffix helpers, repeat, capacity reservation, and inspect support.
Str.capacity : Str -> U64
Str.from_utf16 : List(U16) -> Try(Str, [BadUtf16({ problem : Str.Utf16Problem, index : U64 }), ..])
Str.from_utf16_lossy : List(U16) -> Str
Str.from_utf32 : List(U32) -> Try(Str, [BadUtf32({ problem : Str.Utf32Problem, index : U64 }), ..])
Str.from_utf32_lossy : List(U32) -> Str
Str.replace_each : Str, Str, Str -> Str
Str.replace_first : Str, Str, Str -> Str
Str.replace_last : Str, Str, Str -> Str
Str.split_first : Str, Str -> Try({ before : Str, after : Str }, [NotFound, ..])
Str.split_last : Str, Str -> Try({ before : Str, after : Str }, [NotFound, ..])
Str.iter_utf8 : Str -> Iter(U8)
Str.fold_utf8 : Str, state, (state, U8 -> state) -> state
Not tracking old Str.to_u64 / Str.to_i64 / Str.to_f64 style functions here. The modern API already has T.from_str on numeric modules, plus the parsing work in #7010.
Iter Builtins
Current Iter has custom, iter, next, map, keep_if, drop_if, fold, take_first, drop_first, take_last, and drop_last. Recent discussion says Iter should be the shared direction for allocation-free traversal, and collection types should expose iter / from_iter where appropriate.
Current Dict is list-backed in Builtin.roc with a TODO to use hashing. Recent discussion says Dict should remain an insertion-ordered hash map. The old Hash ability/module should not be ported directly; the new compiler needs a modern hash/equality contract, with most key types deriving hashing/equality automatically.
Public API candidates once the representation exists:
Effectful iterators / streams. Recent iterator discussion suggested these should probably be a separate Stream design and are not high priority.
String literal dispatch via a future from_quote-style static dispatch hook. This is a language/API design topic, not part of current builtin parity.
Builtin import behavior such as import roc.Str. Recent discussion did not settle on changing default builtin imports.
Interpreter behavior for erroneous builtin calls. That is a compiler error-staging/correctness issue, not a missing public builtin API.
Intentionally Not Tracked From The Old Compiler
These existed in the old compiler builtins but should not be added to this checklist without a fresh design:
Old Inspect.roc module. Current direction is automatic string conversion/inspection via to_str and Str.inspect, not a public ability-era inspector module.
Old Hash.roc ability and Hasher API. Dict/Set still need hash-backed implementation work, but the public hash contract should be designed for modern structural dispatch.
Old Str.to_u64 / Str.to_i64 / Str.to_f64 parsing functions. Numeric modules already provide T.from_str; prefix parsing belongs with Implement builtin number parsing #7010.
Old List.walk* names where current List.fold* or Iter APIs already cover the same behavior.
Str.subscript or string slicing in core builtins. Recent subscript discussion called out string indexing as a Unicode footgun; use dedicated text/unicode APIs instead.
Goal
Track the remaining builtin work for the Zig compiler using modern Roc API shapes.
The old Rust compiler builtin files were used as a capabilities checklist only. This issue should not be read as a request to port old ability-era APIs directly.
Current source of truth:
src/build/roc/Builtin.rocsrc/builtins/main.zig,src/builtins/num.zig,src/builtins/dec.zig,src/builtins/list.zig,src/builtins/str.zigsrc/base/LowLevel.zigsrc/canonicalize/BuiltinLowLevel.zigsrc/backend/dev/LirCodeGen.zigsrc/backend/wasm/WasmCodeGen.zigsrc/eval/interpreter.zigModern syntax guidelines for this checklist:
List(U8),Try(ok, err), and open error rows likeTry(a, [OutOfRange, ..]).=>for effectful function variants.where [a.is_eq : a, a -> Bool], not oldimplementsconstraints.F64.sqrtorI32.count_one_bitsover old genericNum.*shapes unless a generic modern mechanism is deliberately designed.A row is done when the builtin is declared in
Builtin.roc, implemented or lowered, supported by the relevant backend/interpreter path, and covered by focused tests.Recent Zulip discussion added a few guiding points for this tracker:
Try-returning helpers first; put effectful collection variants in the deferred section.Iteris now part of the builtin direction, so some old List-centric helpers should be expressed asIter/from_iter/collectAPIs instead.Dictshould remain an insertion-ordered hash map; key hashing/equality should mostly be auto-derived, with a modern public hash contract still needing design.Existing Compiler Wiring Gaps
These are not new public API proposals; they are gaps in wiring for builtin machinery that is already present or partially present.
T.from_numeral : Num.Numeral -> Try(T, [InvalidNumeral(Str), ..])for every numericTBuiltin.rocand mapped to.num_from_numeral..num_from_numeral..num_pow,.num_sqrt,.num_log,.num_round,.num_floor,.num_ceiling.LowLevel.zig.sqrt,floor,ceiling, andround;powandlogare expected to be resolved earlier..compare.Num.compare-style functionality..compareop exists and the interpreter/wasm paths have support, but the dev backend currently panics for it.Implementation note: backend builtin wrappers should not invent their own reference-counting behavior. They should follow explicit ownership/LIR information produced earlier in the pipeline.
Numeric Builtins
Shorthand used below:
IntT:U8,I8,U16,I16,U32,I32,U64,I64,U128,I128SignedIntT:I8,I16,I32,I64,I128FracT:F32,F64,DecFloatT:F32,F64Rows written as
T.foo : ...mean the same-shaped function should be added to each concrete module in the listed type group, for exampleU8.foo,I8.foo, and so on.Numeric Comparison
T.compare : T, T -> [LT, EQ, GT]forT in IntTDec.compare : Dec, Dec -> [LT, EQ, GT]F32.compareandF64.compareshould exist, and if so define the NaN ordering semantics before exposing them.Integer Predicates And Bit Counts
Runtime helpers already exist for
is_multiple_of, leading zero count, trailing zero count, and one bit count.T.is_even : T -> BoolforT in IntTT.is_odd : T -> BoolforT in IntTT.is_multiple_of : T, T -> BoolforT in IntTT.count_leading_zero_bits : T -> U8forT in IntT- see AddNum.countLeadingZerosandNum.countTrailingZerosbuiltins. #4173T.count_trailing_zero_bits : T -> U8forT in IntT- see AddNum.countLeadingZerosandNum.countTrailingZerosbuiltins. #4173T.count_one_bits : T -> U8forT in IntTInteger Arithmetic Variants
T.plus_saturatedalready exists for integer types andDec. Runtime helpers also exist for subtract and multiply saturation.T.minus_saturated : T, T -> TforT in IntTT.times_saturated : T, T -> TforT in IntTDec.minus_saturated : Dec, Dec -> DecDec.times_saturated : Dec, Dec -> DecT.times_try : T, T -> Try(T, [Overflow, ..])forT in FracT- modern module-specific spelling of oldNum.mul_checked; integer variants already exist.T.div_ceil_by : T, T -> TforT in IntTT.div_ceil_checked : T, T -> Try(T, [DivByZero, Overflow, ..])forT in SignedIntTT.div_ceil_checked : T, T -> Try(T, [DivByZero, ..])for unsignedT in IntTPower
Runtime helpers exist for integer and fractional power, but checked integer power is tracked separately.
T.pow : T, T -> TforT in IntTT.pow_checked : T, T -> Try(T, [Overflow, Underflow, ..])for signedT in SignedIntT- see addpowCheckedandpowIntCheckedto the builtins #5503T.pow_checked : T, T -> Try(T, [Overflow, ..])for unsignedT in IntT- see addpowCheckedandpowIntCheckedto the builtins #5503T.pow : T, T -> TforT in FracTFractional Constants And Classification
Use module-specific constants and predicates rather than old top-level
Num.nan_f32/Num.infinity_f64style names.F32.nan : F32F64.nan : F64F32.infinity : F32F64.infinity : F64T.e : TforT in FracTT.pi : TforT in FracTT.tau : TforT in FracTT.is_nan : T -> BoolforT in FloatTT.is_infinite : T -> BoolforT in FloatTT.is_finite : T -> BoolforT in FloatTFractional Math
Dec.sqrthas its own issue because the implementation needs decimal-specific care.T.sqrt : T -> TforT in FloatTDec.sqrt : Dec -> Dec- see AddsqrttoDec#5831T.sqrt_checked : T -> Try(T, [SqrtOfNegative, ..])forT in FracTFracT- see UpdateNum.logbuiltin to support more implementations #5107T.ln : T -> TT.log2 : T -> TT.log10 : T -> TT.log_base : T, T -> TT.ln_checked : T -> Try(T, [LogNeedsPositive, ..])T.sin : T -> TforT in FracTT.cos : T -> TforT in FracTT.tan : T -> TforT in FracTT.asin : T -> TforT in FracTT.acos : T -> TforT in FracTT.atan : T -> TforT in FracTF32.approx_eq : F32, F32, F32 -> BoolF64.approx_eq : F64, F64, F64 -> BoolDec.approx_eq : Dec, Dec, Dec -> BoolFractional Rounding To Integers
Runtime helpers already export
round,floor, andceilingforF32,F64, andDecto every integer type. The public API should probably name the destination type explicitly, matching the existingto_i64_try/to_u64_wrappattern.For each source
S in FracTand destinationD in IntT:S.round_to_<D> : S -> DS.floor_to_<D> : S -> DS.ceiling_to_<D> : S -> DExamples:
Raw Bit Conversions
Runtime helpers already exist for
F32andF64bit conversion.Decneeds a final API decision because the old names were decimal-specific (with_decimal_point/without_decimal_point) and the new API should be explicit about whether this is raw representation or scaled decimal coefficient.F32.to_bits : F32 -> U32F32.from_bits : U32 -> F32F64.to_bits : F64 -> U64F64.from_bits : U64 -> F64Decrepresentation helpers:Dec.to_bits : Dec -> U128Dec.from_bits : U128 -> DecDec.without_decimal_point : Dec -> I128Dec.with_decimal_point : I128 -> DecNumber Parsing
Whole-string parsing via
T.from_str : Str -> Try(T, [BadNumStr, ..])already exists for all numeric types. Prefix parsing and byte parsing are tracked by #7010 and should be modernized away from the old genericNum.parsespelling.Candidate modern shape:
T.parse_utf8 : List(U8) -> Try({ output : T, rest : List(U8) }, [OutOfRange, NotANumber, ..])for every numericT- see Implement builtin number parsing #7010T.parse : Str -> Try({ output : T, rest : Str }, [OutOfRange, NotANumber, ..])for every numericT- see Implement builtin number parsing #7010Str Builtins
Current
Stralready has UTF-8 conversion, splitting, trimming, ASCII case conversion, prefix/suffix helpers, repeat, capacity reservation, and inspect support.Str.capacity : Str -> U64Str.from_utf16 : List(U16) -> Try(Str, [BadUtf16({ problem : Str.Utf16Problem, index : U64 }), ..])Str.from_utf16_lossy : List(U16) -> StrStr.from_utf32 : List(U32) -> Try(Str, [BadUtf32({ problem : Str.Utf32Problem, index : U64 }), ..])Str.from_utf32_lossy : List(U32) -> StrStr.replace_each : Str, Str, Str -> StrStr.replace_first : Str, Str, Str -> StrStr.replace_last : Str, Str, Str -> StrStr.split_first : Str, Str -> Try({ before : Str, after : Str }, [NotFound, ..])Str.split_last : Str, Str -> Try({ before : Str, after : Str }, [NotFound, ..])Str.iter_utf8 : Str -> Iter(U8)Str.fold_utf8 : Str, state, (state, U8 -> state) -> stateStr.fold_utf8_with_index : Str, state, (state, U8, U64 -> state) -> stateStr.drop_first_bytes : Str, U64 -> Try(Str, [BadUtf8, ..])- see Implement builtin number parsing #7010Str.drop_last_bytes : Str, U64 -> Try(Str, [BadUtf8, ..])- see Implement builtin number parsing #7010Not tracking old
Str.to_u64/Str.to_i64/Str.to_f64style functions here. The modern API already hasT.from_stron numeric modules, plus the parsing work in #7010.Iter Builtins
Current
Iterhascustom,iter,next,map,keep_if,drop_if,fold,take_first,drop_first,take_last, anddrop_last. Recent discussion saysItershould be the shared direction for allocation-free traversal, and collection types should exposeiter/from_iterwhere appropriate.Iter.len_if_known : Iter(_item) -> [Known(U64), Unknown]Iter.collect : Iter(item) -> output where [output.from_iter : Iter(item) -> output]Collection-specific
from_iter/iterfunctions are listed in their module sections below.Effectful iterators should probably be a separate
Streamdesign, not part of this builtin parity checklist yet.List Builtins
Current
Listalready has length, capacity reservation, sort_with, equality, append/prepend, safe access/update/swap, reverse, map/map2, filters, folds, find, split, slicing, repeat, sum/min/max, and encode/decode support.Storage And UTF-8 Helpers
List.capacity : List(_item) -> U64List.concat_utf8 : List(U8), Str -> List(U8)List.from_iter : Iter(item) -> List(item)Combination And Construction Helpers
List.join : List(List(a)) -> List(a)List.join_map : List(a), (a -> List(b)) -> List(b)List.intersperse : List(a), a -> List(a)List.chunks_of : List(a), U64 -> List(List(a))List.product : List(item) -> item where [item.times : item, item -> item, item.default : item]List.append_if_ok : List(a), Try(a, _err) -> List(a)List.prepend_if_ok : List(a), Try(a, _err) -> List(a)List.keep_oks : List(before), (before -> Try(after, _err)) -> List(after)List.keep_errs : List(before), (before -> Try(_ok, after)) -> List(after)List.insert : List(a), U64, a -> Try(List(a), [OutOfBounds, ..])List.drop_at_unordered : List(a), U64 -> List(a)Multi-List Mapping
List.map3 : List(a), List(b), List(c), (a, b, c -> d) -> List(d)List.map4 : List(a), List(b), List(c), List(d), (a, b, c, d -> e) -> List(e)Try-Returning Variants
These fill in the higher-order variants that old builtins represented with result types and that modern Roc should spell with
Try.List.map_try : List(a), (a -> Try(b, err)) -> Try(List(b), err)List.keep_if_try : List(a), (a -> Try(Bool, err)) -> Try(List(a), err)List.fold_try : List(a), state, (state, a -> Try(state, err)) -> Try(state, err)Sorting And Indexing
List.sortbuiltins #7006List.sort_with : List(item), (item, item -> [LT, EQ, GT]) -> List(item)exists.List.sortbuiltins #7006 should be updated to modern structural constraints before implementation.List.get_wrap : List(a), U64 -> Try(a, [ListWasEmpty, ..])- see List.getWrap #3485Dict Builtins
Current
Dictis list-backed inBuiltin.rocwith a TODO to use hashing. Recent discussion saysDictshould remain an insertion-ordered hash map. The oldHashability/module should not be ported directly; the new compiler needs a modern hash/equality contract, with most key types deriving hashing/equality automatically.Public API candidates once the representation exists:
Dict.with_capacity : U64 -> Dict(_k, _v)Dict.capacity : Dict(_k, _v) -> U64Dict.reserve : Dict(k, v), U64 -> Dict(k, v)Dict.release_excess_capacity : Dict(k, v) -> Dict(k, v)Dict.clear : Dict(k, v) -> Dict(k, v)Dict.subscript : Dict(k, v), k -> Try(v, [KeyNotFound, ..])Dict.iter : Dict(k, v) -> Iter((k, v))Dict.from_iter : Iter((k, v)) -> Dict(k, v)Dict.fold_until : Dict(k, v), state, (state, k, v -> [Continue(state), Break(state)]) -> stateExact hash constraints for
Dictfunctions are intentionally not spelled out here until the modern hash contract lands.Set Builtins
Current
Setis also list-backed inBuiltin.roc; storage-capacity functions should land with the hash-backed representation work.Set.with_capacity : U64 -> Set(_item)Set.capacity : Set(_item) -> U64Set.reserve : Set(item), U64 -> Set(item)Set.release_excess_capacity : Set(item) -> Set(item)Set.clear : Set(item) -> Set(item)Set.subscript : Set(item), item -> BoolSet.iter : Set(item) -> Iter(item)Set.from_iter : Iter(item) -> Set(item)Set.fold : Set(item), state, (state, item -> state) -> stateSet.fold_until : Set(item), state, (state, item -> [Continue(state), Break(state)]) -> stateSet.join_map : Set(a), (a -> Set(b)) -> Set(b)Try Builtins
Current
Tryalready hasis_ok,is_err,ok_or,err_or,map_ok,map_ok!,map_err,map_err!, and equality.Try.map_both : Try(ok1, err1), (ok1 -> ok2), (err1 -> err2) -> Try(ok2, err2)Try.map_both! : Try(ok1, err1), (ok1 => ok2), (err1 => err2) => Try(ok2, err2)Try.map2 : Try(a, err), Try(b, err), (a, b -> c) -> Try(c, err)Try.map2! : Try(a, err), Try(b, err), (a, b => c) => Try(c, err)Try.on_err : Try(ok, err), (err -> Try(ok, other_err)) -> Try(ok, other_err)Try.on_err! : Try(ok, err), (err => Try(ok, other_err)) => Try(ok, other_err)Try.catch : Try(ok, err), (err -> a), (ok -> a) -> a- modern spelling of Add functioncatch : Result ok err, (err -> a), (ok -> a) -> ato standard library. #6759Try.catch! : Try(ok, err), (err => a), (ok => a) => aTry.collapse : Try(a, a) -> a- modern spelling of add Result.collapse #3439Deferred / Needs Design
These came up during the research pass, but should not be treated as immediate implementation checklist items.
List.map! : List(a), (a => b) => List(b)List.map_with_index! : List(a), (a, U64 => b) => List(b)List.map3! : List(a), List(b), List(c), (a, b, c => d) => List(d)List.map4! : List(a), List(b), List(c), List(d), (a, b, c, d => e) => List(e)List.keep_if! : List(a), (a => Bool) => List(a)List.drop_if! : List(a), (a => Bool) => List(a)List.count_if! : List(a), (a => Bool) => U64List.fold! : List(a), state, (state, a => state) => stateList.fold_with_index! : List(a), state, (state, a, U64 => state) => stateList.fold_until! : List(a), state, (state, a => [Continue(state), Break(state)]) => stateList.fold_with_index_until! : List(a), state, (state, a, U64 => [Continue(state), Break(state)]) => stateList.map_try! : List(a), (a => Try(b, err)) => Try(List(b), err)List.keep_if_try! : List(a), (a => Try(Bool, err)) => Try(List(a), err)List.fold_try! : List(a), state, (state, a => Try(state, err)) => Try(state, err)List.for_each_try! : List(a), (a => Try({}, err)) => Try({}, err)Dict.fold! : Dict(k, v), state, (state, k, v => state) => stateDict.fold_until! : Dict(k, v), state, (state, k, v => [Continue(state), Break(state)]) => stateDict.map! : Dict(k, a), (k, a => b) => Dict(k, b)Dict.keep_if! : Dict(k, v), ((k, v) => Bool) => Dict(k, v)Dict.drop_if! : Dict(k, v), ((k, v) => Bool) => Dict(k, v)Set.fold! : Set(item), state, (state, item => state) => stateSet.fold_until! : Set(item), state, (state, item => [Continue(state), Break(state)]) => stateSet.map! : Set(a), (a => b) => Set(b)Set.keep_if! : Set(a), (a => Bool) => Set(a)Set.drop_if! : Set(a), (a => Bool) => Set(a)Streamdesign and are not high priority.from_quote-style static dispatch hook. This is a language/API design topic, not part of current builtin parity.import roc.Str. Recent discussion did not settle on changing default builtin imports.Intentionally Not Tracked From The Old Compiler
These existed in the old compiler builtins but should not be added to this checklist without a fresh design:
Inspect.rocmodule. Current direction is automatic string conversion/inspection viato_strandStr.inspect, not a public ability-era inspector module.Hash.rocability andHasherAPI.Dict/Setstill need hash-backed implementation work, but the public hash contract should be designed for modern structural dispatch.Str.to_u64/Str.to_i64/Str.to_f64parsing functions. Numeric modules already provideT.from_str; prefix parsing belongs with Implement builtin number parsing #7010.List.walk*names where currentList.fold*orIterAPIs already cover the same behavior.Str.subscriptor string slicing in core builtins. Recent subscript discussion called out string indexing as a Unicode footgun; use dedicated text/unicode APIs instead.Related Issues
List.sortbuiltins #7006 - List sort convenience APIcatch : Result ok err, (err -> a), (ok -> a) -> ato standard library. #6759 - Result/Try catchsqrttoDec#5831 - Dec sqrtpowCheckedandpowIntCheckedto the builtins #5503 - Checked pow builtinsNum.logbuiltin to support more implementations #5107 - Log APINum.countLeadingZerosandNum.countTrailingZerosbuiltins. #4173 - Leading/trailing zero bit counts