# Builtin Contract Table (Historical Snapshot)

Historical snapshot generated by `node scripts/gen_builtin_contract_table.mjs`.
The generator belonged to the retired MoonBit host path and is no longer present.
Removed `Threads::*` probe rows are intentionally not part of the current contract;
the compiler and ADR-0068 are authoritative for new concurrency work.

Sources:
- `src/checker/typecheck_call_builtin_handler_*.mbt`, `src/checker/typecheck_effects_set.mbt`
- `src/codegen/wasm_codegen_builtin_*.mbt`, `src/codegen/wasm_codegen_call.mbt`
- `src/codegen/wasm_codegen_builtin_names.mbt`

Legend:
- `required effects` is the effect-set contract (`with ...` requirement).
- `- (do required)` means no effect-set requirement, but current checker
  requires an effect-allowed context (`do { ... }` or effectful function body).
- `compiled` tracks the current public execution surface backed by WASM codegen.
- builtins listed as runtime fallbacks in WASM codegen are treated as unsupported here.
- `component` currently shares builtin codegen support with `compiled`.

| name | signature | required effects | compiled | component |
| --- | --- | --- | --- | --- |
| `Array::get` | `(Array[T], Int) -> T` | `-` | yes | yes |
| `Array::length` | `(Array[T]) -> Int` | `-` | yes | yes |
| `Array::slice` | `(Array[T], Int, Int) -> Array[T]` | `-` | yes | yes |
| `ArrayBuilder::freeze` | `(ArrayBuilder[T]) -> Array[T]` | `-` | yes | yes |
| `ArrayBuilder::new` | `() -> ArrayBuilder[T]` | `-` | yes | yes |
| `ArrayBuilder::push` | `(ArrayBuilder[T], T) -> Unit` | `-` | yes | yes |
| `Double::to_float` | `(Double) -> Float` | `-` | yes | yes |
| `Double::to_int` | `(Double) -> Int` | `-` | yes | yes |
| `Float::to_double` | `(Float) -> Double` | `-` | yes | yes |
| `Float::to_int` | `(Float) -> Int` | `-` | yes | yes |
| `Int::to_double` | `(Int) -> Double` | `-` | yes | yes |
| `Int::to_float` | `(Int) -> Float` | `-` | yes | yes |
| `Map::get` | `(Map[K, V], K) -> V` | `-` | yes | yes |
| `Map::has_key` | `(Map[K, V], K) -> Bool` | `-` | yes | yes |
| `Map::keys` | `(Map[K, V]) -> Array[K]` | `-` | yes | yes |
| `Map::set` | `(Map[K, V], K, V) -> Map[K, V]` | `-` | yes | yes |
| `Map::values` | `(Map[K, V]) -> Array[V]` | `-` | yes | yes |
| `MapBuilder::freeze` | `(MapBuilder[K, V]) -> Map[K, V]` | `-` | yes | yes |
| `MapBuilder::new` | `() -> MapBuilder[K, V]` | `-` | yes | yes |
| `MapBuilder::set` | `(MapBuilder[K, V], K, V) -> Unit` | `-` | yes | yes |
| `Stdin::read_char` | `() -> Int` | `{Stdin}` | yes | yes |
| `Stdin::read_stream` | `(Int) -> String` | `{Stdin}` | yes | yes |
| `Stdout::write_char` | `(Int) -> Unit` | `{Stdout}` | yes | yes |
| `Stdout::write_stream` | `(String) -> Unit` | `{Stdout}` | yes | yes |
| `String::char_code_at` | `(String, Int) -> Int` | `-` | yes | yes |
| `String::concat` | `(String, String) -> String` | `-` | yes | yes |
| `String::contains` | `(String, String) -> Bool` | `-` | yes | yes |
| `String::equals` | `(String, String) -> Bool` | `-` | yes | yes |
| `String::from_char_code` | `(Int) -> String` | `-` | yes | yes |
| `String::from_char_codes` | `(Array[Int]) -> String` | `-` | yes | yes |
| `String::index_of` | `(String, String) -> Int` | `-` | yes | yes |
| `String::length` | `(String) -> Int` | `-` | yes | yes |
| `String::split` | `(String, String) -> Array[String]` | `-` | yes | yes |
| `String::substring` | `(String, Int, Int) -> String` | `-` | yes | yes |
| `String::trim` | `(String) -> String` | `-` | yes | yes |
| `__add` | `(Num, Num) -> Num` | `-` | yes | yes |
| `__assert` | `(Bool) -> Unit` | `-` | yes | yes |
| `__bit_and` | `(Int, Int) -> Int` | `-` | yes | yes |
| `__bit_or` | `(Int, Int) -> Int` | `-` | yes | yes |
| `__bit_xor` | `(Int, Int) -> Int` | `-` | yes | yes |
| `__div` | `(Num, Num) -> Num` | `-` | yes | yes |
| `__eq` | `(Eq, Eq) -> Bool` | `-` | yes | yes |
| `__index` | `(Array[T], Int) -> T \| (Map[K, V], K) -> V` | `-` | yes | yes |
| `__lshift` | `(Int, Int) -> Int` | `-` | yes | yes |
| `__lt` | `(Ord, Ord) -> Bool` | `-` | yes | yes |
| `__mod` | `(Num, Num) -> Num` | `-` | yes | yes |
| `__mul` | `(Num, Num) -> Num` | `-` | yes | yes |
| `__neg` | `(Num) -> Num` | `-` | yes | yes |
| `__rshift` | `(Int, Int) -> Int` | `-` | yes | yes |
| `__sub` | `(Num, Num) -> Num` | `-` | yes | yes |
| `__to_string` | `(Any) -> String` | `-` | yes | yes |
| `addr` | `(String literal) -> T  // address lookup` | `-` | no | no |
| `f32_convert_i32_s` | `(Int) -> Float` | `-` | yes | yes |
| `f32_demote_f64` | `(Double) -> Float` | `-` | yes | yes |
| `f32_load` | `(Int, Int) -> Float` | `-` | yes | yes |
| `f32_neg` | `(Float) -> Float` | `-` | yes | yes |
| `f32_store` | `(Int, Int, Float) -> Unit` | `-` | yes | yes |
| `f64_convert_i32_s` | `(Int) -> Double` | `-` | yes | yes |
| `f64_load` | `(Int, Int) -> Double` | `-` | yes | yes |
| `f64_neg` | `(Double) -> Double` | `-` | yes | yes |
| `f64_promote_f32` | `(Float) -> Double` | `-` | yes | yes |
| `f64_store` | `(Int, Int, Double) -> Unit` | `-` | yes | yes |
| `i32_load` | `(Int, Int) -> Int` | `-` | yes | yes |
| `i32_load8_u` | `(Int, Int) -> Int` | `-` | yes | yes |
| `i32_shr_u` | `(Int, Int) -> Int` | `-` | yes | yes |
| `i32_store` | `(Int, Int, Int) -> Unit` | `-` | yes | yes |
| `i32_store8` | `(Int, Int, Int) -> Unit` | `-` | yes | yes |
| `i32_trunc_f32_s` | `(Float) -> Int` | `-` | yes | yes |
| `i32_trunc_f64_s` | `(Double) -> Int` | `-` | yes | yes |
| `path` | `(String) -> Path` | `-` | yes | yes |
| `record_set` | `(Record{...}, String, V) -> Record{...}` | `-` | no | no |
| `sh` | `(String) -> Unit` | `{Process}` | yes | yes |
| `sh_lines` | `(String) -> Array[String]` | `{Process}` | no | no |
| `sleep` | `(Int) -> Unit` | `{Async}` | yes | yes |
