Skip to content

no objects: structs for records, maps for dictionaries - #91

Merged
kryptamine merged 1 commit into
masterfrom
no-objects
Nov 16, 2026
Merged

kryptamine merged 1 commit into
masterfrom
no-objects

Conversation

@kryptamine

Copy link
Copy Markdown
Owner

Untyped objects are removed; a struct holds a record, a map a dictionary.

  • map literal ["a": 1, k: v], empty [:]; duplicate literal keys are a compile error; maps print as their literal
  • json.parse gives maps; User { ...m } builds a struct from one
  • HttpOptions, ExecOptions, Date are required as structs; headers, env, os.environ(), regex named are maps
  • record patterns { a, ...rest } match structs only; rest is a map
  • map(src) takes a struct or pairs; map(), object(), is object are gone
  • struct fields only by name: no s["f"]
  • VM: opMap, map index fast paths; object kind, opcode and stdlib removed

…al [k: v] and [:]; json.parse gives maps, spread into a struct for fields; options are structs; record patterns take structs, rest is a map; struct fields only by name, no s["f"]
@kryptamine
kryptamine merged commit c5f927d into master Nov 16, 2026
3 checks passed
@kryptamine
kryptamine deleted the no-objects branch November 16, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant