Status da stdlib
Gerado de
docs/mappings/_gen/stdlib.pyem 2026-10-05. Implementado =internal/stdlibfs/stdlib/(módulos em Makoto embutidos nomk). Planejado = design (docs/english/language-design.md§24,official_libraries.md,extensions.md).
Regra de ouro: nada é global. print vive em io, panic em runtime. Stdlib = use nome puro (sem versão/checksum); tier 1 (libs oficiais) tem cadência própria e só depende pra baixo.
Implementado
Seção intitulada “Implementado”| Módulo | Status | O que faz | C | JavaScript | TypeScript | Java | Rust |
|---|---|---|---|---|---|---|---|
io |
implementado | Saída padrão. print/println recebem ...Display (heterogêneo e tipado). |
stdio.h (printf, puts) | console.log | console.log | System.out.println | print!/println! |
strings |
implementado | Utilitários sobre string (escritos em Makoto). |
string.h/ctype.h (strstr, strtok, toupper) | String.prototype.* | String.prototype.* | java.lang.String | str / String |
collections |
parcial | HOFs sobre List[T] + Map[K,V]/Set[T] como funções livres (implementação atual: lista associativa, busca linear). |
(nada na libc; hsearch/tsearch) | Array.prototype.* / Map / Set | Array |
java.util (ArrayList, HashMap, HashSet, streams) | Vec / HashMap / HashSet / Iterator |
math |
implementado | Constantes e funções de f64 (finitas: domínio inválido é erro, não NaN). | math.h | Math | Math | java.lang.Math | f64::* (métodos) |
bits |
implementado | Operações de bits por largura (8/16/32/64). | __builtin_popcount/clz/ctz, bswap (GCC/Clang) | Math.clz32 (resto manual) | Math.clz32 | Integer/Long.bitCount, numberOfLeadingZeros, rotateLeft, reverse | u32::count_ones, leading_zeros, rotate_left, swap_bytes |
mem |
implementado | Layout em compile-time (sobre compiler.reflect) e predicados de memória. |
sizeof, _Alignof, offsetof | — | — | (Panama MemoryLayout) | size_of, align_of, offset_of! |
encoding |
implementado | Serialização binária e hash auto-derivados por reflexão (sem macro/annotation). | (manual) | JSON / structuredClone | JSON | Serializable / Jackson | serde + bincode |
os |
implementado | Processo do SO: argumentos, ambiente, saída. | argv, getenv, exit | process.argv / process.env / process.exit | process.* | args / System.getenv / System.exit | std::env::args / var / process::exit |
unicode |
implementado | Ordem de bytes e BOM de UTF-16/32 (o core só fala little-endian sem BOM). | (manual / iconv) | TextDecoder | TextDecoder | StandardCharsets.UTF_16BE/LE | u16::swap_bytes / encoding_rs |
log |
implementado | Log simples por nível. | syslog | console.debug/info/warn/error | console.* | java.util.logging / SLF4J | log crate |
metrics |
implementado | Métricas de aplicação (Counter/Gauge) sobre mm. |
— | prom-client | prom-client | Micrometer | metrics crate |
tracing |
implementado | Spans de aplicação. | — | @opentelemetry/api | @opentelemetry/api | OpenTelemetry | tracing crate |
test |
implementado | Asserções pra @test/@property/@fuzz. |
assert.h | node:assert / expect | expect | JUnit Assertions | assert!/assert_eq! |
gen |
implementado | Geradores de dados pra property-based testing e fuzzing (Gen[T]). |
— | fast-check arbitraries | fast-check | jqwik Arbitraries | proptest strategies |
runtime |
core (realizado pelo compilador/runtime) | Introspecção, trace, panic e controle de supervisão (realizado pelo runtime). | /proc, signal, abort | process / worker_threads | process | ManagementFactory / Thread | std::process / std::thread |
net |
core (realizado pelo compilador/runtime) | Canais pela rede: o Channel[T] comum sobre socket (payload Serializable). |
sys/socket.h | node:net | node:net | java.net.Socket | std::net |
mm |
core (realizado pelo compilador/runtime) | Interface do MemoryManager (estratégia vem do @mm do contexto). |
malloc/realloc/free | — | — | Panama Arena | std::alloc |
compiler |
core (realizado pelo compilador/runtime) | Reflexão e falha em compile-time. | — | — | — | java.lang.reflect (runtime) | proc-macros |
arch |
core (realizado pelo compilador/runtime) | Arquitetura alvo como constante de compile-time. | #if defined(x86_64) | process.arch | process.arch | System.getProperty(“os.arch”) | cfg!(target_arch = …) |
locale |
core (realizado pelo compilador/runtime) | Colação Unicode (DUCET) por locale. | strcoll / ICU | Intl.Collator | Intl.Collator | java.text.Collator | icu_collator |
API por módulo
Seção intitulada “API por módulo”io — implementado
Seção intitulada “io — implementado”use io — Saída padrão. print/println recebem ...Display (heterogêneo e tipado).
print(args: ...Display)println(args: ...Display)
strings — implementado
Seção intitulada “strings — implementado”use strings — Utilitários sobre string (escritos em Makoto).
is_emptybyte_lenstarts_withends_withindex_ofcontainsrepeatsplit(s, sep) -> List[string]join(parts, sep)trim_starttrim_endtrimreplaceto_upperto_lower
collections — parcial
Seção intitulada “collections — parcial”use collections — HOFs sobre List[T] + Map[K,V]/Set[T] como funções livres (implementação atual: lista associativa, busca linear).
mapfilterreduceanyallcountreversefind -> Optionalfind_indexindex_ofcontainstakedropconcatflat_mapset_new / set_add(mut s, v) / set_has / set_sizemap_new / map_put(mut m, k, v) / map_get -> Optional / map_has / map_size
math — implementado
Seção intitulada “math — implementado”use math — Constantes e funções de f64 (finitas: domínio inválido é erro, não NaN).
pi, e, tausqrtfloorceiltruncroundabscopysignminmaxclampsign
bits — implementado
Seção intitulada “bits — implementado”use bits — Operações de bits por largura (8/16/32/64).
count_ones*count_zeros*leading_zeros*trailing_zeros*rotate_left*rotate_right*byte_swap16/32/64reverse_bits*
mem — implementado
Seção intitulada “mem — implementado”use mem — Layout em compile-time (sobre compiler.reflect) e predicados de memória.
size_of[T]()align_of[T]()offset_of[T]("campo") (comptime)is_pointer_free[T]() (comptime)
encoding — implementado
Seção intitulada “encoding — implementado”use encoding.{serialize, deserialize, hash} — Serialização binária e hash auto-derivados por reflexão (sem macro/annotation).
serialize[T + Serializable](v) -> []u8deserialize[T](bytes) -> Result[T, error{Malformed, Truncated}]hash[T](v) -> u64Buffer / buffer_newReadable / reader
os — implementado
Seção intitulada “os — implementado”use os — Processo do SO: argumentos, ambiente, saída.
args() -> []stringenv(name) -> Optional[string]exit(code)
unicode — implementado
Seção intitulada “unicode — implementado”use unicode — Ordem de bytes e BOM de UTF-16/32 (o core só fala little-endian sem BOM).
swap16 / swap32with_bom16 / with_bom32 (bytes, .little|.big)strip_bom16 / strip_bom32
log — implementado
Seção intitulada “log — implementado”use log — Log simples por nível.
debug(...Display)infowarnerror
metrics — implementado
Seção intitulada “metrics — implementado”use metrics — Métricas de aplicação (Counter/Gauge) sobre mm.
counter(name) / gauge(name)increment / increment_by / valueset / add / sub / read
tracing — implementado
Seção intitulada “tracing — implementado”use tracing — Spans de aplicação.
span(name) -> Spanset_attributeattribute -> Optionalattribute_countnamefinishis_open
test — implementado
Seção intitulada “test — implementado”use test — Asserções pra @test/@property/@fuzz.
expect(cond)expect_eq[T + Comparable](a, b)expect_ne
gen — implementado
Seção intitulada “gen — implementado”use gen — Geradores de dados pra property-based testing e fuzzing (Gen[T]).
ints / ints_between / bools / floats / constantmap / list_of / one_of / optionalsbytes / mutate / shrink / render
runtime — core (realizado pelo compilador/runtime)
Seção intitulada “runtime — core (realizado pelo compilador/runtime)”use runtime — Introspecção, trace, panic e controle de supervisão (realizado pelo runtime).
self() / process(name) -> Optional / group(name) / processes() / channels() / stats()trace(alvo, eventos, sink, opções)panic(msg)supervisor.restart() / supervisor.escalate()
net — core (realizado pelo compilador/runtime)
Seção intitulada “net — core (realizado pelo compilador/runtime)”use net — Canais pela rede: o Channel[T] comum sobre socket (payload Serializable).
listen(addr) -> Result[Listener]accept[T](listener) -> Result[Channel[T]]connect[T](addr) -> Result[Channel[T]]
mm — core (realizado pelo compilador/runtime)
Seção intitulada “mm — core (realizado pelo compilador/runtime)”use mm — Interface do MemoryManager (estratégia vem do @mm do contexto).
alloc(n[, align]) -> [*]Tresize(p, n) -> boolrelease(p)reset(p)used(p)
compiler — core (realizado pelo compilador/runtime)
Seção intitulada “compiler — core (realizado pelo compilador/runtime)”use compiler.{reflect, fail} — Reflexão e falha em compile-time.
reflect(T) (.kind, .fields, .construct...)fail(msg)
arch — core (realizado pelo compilador/runtime)
Seção intitulada “arch — core (realizado pelo compilador/runtime)”use arch — Arquitetura alvo como constante de compile-time.
arch.current (.x86_64, .arm, .riscv, .wasm...)
locale — core (realizado pelo compilador/runtime)
Seção intitulada “locale — core (realizado pelo compilador/runtime)”use locale — Colação Unicode (DUCET) por locale.
Collator.new(.pt | .en | .sv ...)Collator.from_tag("pt-BR") -> Resultc.order(a, b) -> Orderingc.equals(a, b)
Planejado
Seção intitulada “Planejado”| Módulo | Tier | O que será | C | JavaScript | TypeScript | Java | Rust |
|---|---|---|---|---|---|---|---|
time |
0 | Relógios, durações ricas (Duration[T], ArbitraryDuration), timers. UTC/offset no core; IANA em tzdata. |
time.h | Date / Temporal | Temporal | java.time | std::time / chrono |
fs |
0 | Sistema de arquivos (primitiva de watch inclusa). | stdio.h / unistd.h | node:fs | node:fs | java.nio.file | std::fs |
io (readers/writers) |
0 | Interfaces Readable/Writeable/Closeable, buffering, io.copy, leitura. |
read/write | streams | streams | InputStream/OutputStream | Read/Write |
fmt |
0 | Formatação (.pad, .fixed, .hex como métodos, sem mini-linguagem). |
printf | padStart / toFixed / toString(16) | idem | String.format | format! |
json |
0 | JSON sobre a mesma derivação por reflexão (json.encode(u), json.decode[User](txt)). |
cJSON/jansson | JSON | JSON | Jackson | serde_json |
bytes |
0 | Utilitários de []byte. |
string.h (mem*) | Uint8Array | Uint8Array | ByteBuffer | bytes crate |
crypto / hash |
0 | Criptografia (AEAD seal/open) e hashes. |
OpenSSL/libsodium | WebCrypto | WebCrypto | javax.crypto | ring / RustCrypto |
http |
1 | Cliente completo (pool, redirect, cookies, gzip) e servidor fn(Request) -> Response, um processo por stream; HTTP/1.1, /2, /3 com superfície agnóstica. |
libcurl / libmicrohttpd | fetch / node:http | fetch | java.net.http.HttpClient | reqwest / hyper |
regex |
1 | Multi-engine: RE2 (padrão, tempo linear), PCRE, HyperScan; padrão literal compila em compile-time. | regex.h / PCRE2 | RegExp | RegExp | java.util.regex | regex crate |
containers |
1 | Estruturas especializadas: Deque, PriorityQueue, SortedMap/SortedSet (B-tree), Trie (ART), RingBuffer. | — | — | — | ArrayDeque / PriorityQueue / TreeMap | VecDeque / BinaryHeap / BTreeMap |
compress |
1 | Codecs como stream: gzip/deflate/zlib (tier 0), brotli/zstd (tier 1). | zlib | node:zlib / CompressionStream | idem | java.util.zip | flate2 / zstd |
encoding (formatos extras) |
1 | MessagePack, CBOR, TOML, CSV. | libs diversas | npm | npm | Jackson modules | rmp-serde / toml / csv |
crypto.pq |
1 | Pós-quântico: ML-KEM, ML-DSA, modo híbrido. | liboqs | — | — | BouncyCastle | pqcrypto |
linalg |
1 | Álgebra linear: tipos fixos (gráficos), Matrix[T] denso, decomposições (backend duplo). |
BLAS/LAPACK | — | — | EJML | nalgebra / ndarray |
intl |
1 | i18n: catálogo, plural, formatação (fase 1); ICU completo (fase 2). | ICU / gettext | Intl | Intl | java.text / ICU4J | icu4x / fluent |
tzdata |
1 | Fusos IANA nomeados (dados mutáveis ficam fora do core). | tzfile | Intl.DateTimeFormat | idem | java.time.ZoneId | chrono-tz |
watch |
1 | File-watching ergonômico (eventos normalizados) sobre a primitiva do fs. |
inotify | fs.watch / chokidar | idem | WatchService | notify |
web |
2 | Framework (router, middleware) sobre http; base da UI. |
— | express / hono | idem | Spring / Javalin | axum / actix-web |