refactor(stdlib): de-abbreviate namespaces (Mem/Sys/Net/Collide)

Expand the abbreviated public namespaces to full words, part of the
language-wide de-abbreviation pass:
  Mem -> Memory, Sys -> System, Net -> Network, Collide -> Collision

Math stays (universally accepted, like int/bool). Renames the dispatch
strings, LSP signatures, docs (dirs, files, frontmatter), and the
inventory manifest; behavior is byte-identical (the bare rt_ targets are
unchanged). Reseeded; C-free bootstrap fixpoint holds; all suites green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-08-30 01:30:47 +03:00
parent 6e6467b515
commit 2f19c8d8e2
50 changed files with 360 additions and 360 deletions

View file

@ -1,6 +1,6 @@
--- ---
id: collide id: collision
title: Collide title: Collision
order: 6 order: 6
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: collide-circles id: collision-circles
name: Collide.circles name: Collision.circles
category: collide category: collision
kind: namespace-method kind: namespace-method
tokens: Collide.circles tokens: Collision.circles
sig: Collide.circles(ax, ay, ar, bx, by, br) -> bool sig: Collision.circles(ax, ay, ar, bx, by, br) -> bool
tip: Do two circles overlap? tip: Do two circles overlap?
order: 2 order: 2
ns: Collide ns: Collision
member: circles member: circles
--- ---
@ -16,7 +16,7 @@ Returns <code>true</code> when circles centred at <code>(ax, ay)</code> and <cod
```ludic ```ludic
program Demo { program Demo {
handler Step phase Update { handler Step phase Update {
if Collide.circles(px, py, 8, ex, ey, 8) { collide() } if Collision.circles(px, py, 8, ex, ey, 8) { collide() }
} }
} }
``` ```

View file

@ -1,13 +1,13 @@
--- ---
id: collide-point_rect id: collision-point_rect
name: Collide.point_rect name: Collision.point_rect
category: collide category: collision
kind: namespace-method kind: namespace-method
tokens: Collide.point_rect tokens: Collision.point_rect
sig: Collide.point_rect(px, py, rx, ry, rw, rh) -> bool sig: Collision.point_rect(px, py, rx, ry, rw, rh) -> bool
tip: Is a point inside a rectangle? tip: Is a point inside a rectangle?
order: 1 order: 1
ns: Collide ns: Collision
member: point_rect member: point_rect
--- ---
@ -16,7 +16,7 @@ Returns <code>true</code> when the point <code>(px, py)</code> lies within the r
```ludic ```ludic
program Demo { program Demo {
handler Step phase Update { handler Step phase Update {
if Collide.point_rect(mx, my, bx, by, bw, bh) { press() } if Collision.point_rect(mx, my, bx, by, bw, bh) { press() }
} }
} }
``` ```

View file

@ -1,13 +1,13 @@
--- ---
id: collide-rect_circle id: collision-rect_circle
name: Collide.rect_circle name: Collision.rect_circle
category: collide category: collision
kind: namespace-method kind: namespace-method
tokens: Collide.rect_circle tokens: Collision.rect_circle
sig: Collide.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool sig: Collision.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool
tip: Does a rectangle overlap a circle? tip: Does a rectangle overlap a circle?
order: 3 order: 3
ns: Collide ns: Collision
member: rect_circle member: rect_circle
--- ---
@ -16,7 +16,7 @@ Returns <code>true</code> when the rectangle <code>(rx, ry, rw, rh)</code> overl
```ludic ```ludic
program Demo { program Demo {
handler Step phase Update { handler Step phase Update {
if Collide.rect_circle(tx, ty, 16, 16, bx, by, 6) { block() } if Collision.rect_circle(tx, ty, 16, 16, bx, by, 6) { block() }
} }
} }
``` ```

View file

@ -1,13 +1,13 @@
--- ---
id: collide-rects id: collision-rects
name: Collide.rects name: Collision.rects
category: collide category: collision
kind: namespace-method kind: namespace-method
tokens: Collide.rects tokens: Collision.rects
sig: Collide.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool sig: Collision.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool
tip: Do two rectangles overlap? tip: Do two rectangles overlap?
order: 0 order: 0
ns: Collide ns: Collision
member: rects member: rects
--- ---
@ -16,7 +16,7 @@ Returns <code>true</code> when the axis-aligned rectangles <code>(ax, ay, aw, ah
```ludic ```ludic
program Demo { program Demo {
handler Step phase Update { handler Step phase Update {
if Collide.rects(px, py, 16, 16, ex, ey, 16, 16) { hit() } if Collision.rects(px, py, 16, 16, ex, ey, 16, 16) { hit() }
} }
} }
``` ```

View file

@ -1,6 +1,6 @@
--- ---
id: mem id: memory
title: Mem title: Memory
order: 6 order: 6
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-bytes id: memory-bytes
name: Mem.bytes name: Memory.bytes
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.bytes tokens: Memory.bytes
sig: Mem.bytes(n) -> ptr sig: Memory.bytes(n) -> ptr
tip: Allocate n bytes. tip: Allocate n bytes.
order: 0 order: 0
ns: Mem ns: Memory
member: bytes member: bytes
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-copy id: memory-copy
name: Mem.copy name: Memory.copy
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.copy tokens: Memory.copy
sig: Mem.copy(dst, src, n) -> void sig: Memory.copy(dst, src, n) -> void
tip: Copy n bytes between buffers. tip: Copy n bytes between buffers.
order: 2 order: 2
ns: Mem ns: Memory
member: copy member: copy
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-fill id: memory-fill
name: Mem.fill name: Memory.fill
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.fill tokens: Memory.fill
sig: Mem.fill(buf, value, n) -> void sig: Memory.fill(buf, value, n) -> void
tip: Set n bytes to a value. tip: Set n bytes to a value.
order: 3 order: 3
ns: Mem ns: Memory
member: fill member: fill
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-peek id: memory-peek
name: Mem.peek name: Memory.peek
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.peek tokens: Memory.peek
sig: Mem.peek(buf, i) -> int sig: Memory.peek(buf, i) -> int
tip: Read one byte. tip: Read one byte.
order: 4 order: 4
ns: Mem ns: Memory
member: peek member: peek
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-poke id: memory-poke
name: Mem.poke name: Memory.poke
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.poke tokens: Memory.poke
sig: Mem.poke(buf, i, value) -> void sig: Memory.poke(buf, i, value) -> void
tip: Write one byte. tip: Write one byte.
order: 5 order: 5
ns: Mem ns: Memory
member: poke member: poke
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: mem-words id: memory-words
name: Mem.words name: Memory.words
category: mem category: memory
kind: namespace-method kind: namespace-method
tokens: Mem.words tokens: Memory.words
sig: Mem.words(n) -> words sig: Memory.words(n) -> words
tip: Allocate n 32-bit words. tip: Allocate n 32-bit words.
order: 1 order: 1
ns: Mem ns: Memory
member: words member: words
--- ---

View file

@ -1,14 +0,0 @@
---
id: net-apply
name: Net.apply
category: net
kind: namespace-method
tokens: Net.apply
sig: Net.apply(entity, buf) -> int
tip: Apply serialized state to an entity.
order: 3
ns: Net
member: apply
---
Reads synced fields from <code>buf</code> into <code>entity</code> — the inverse of <code>Net.serialize</code>.

View file

@ -1,14 +0,0 @@
---
id: net-local_id
name: Net.local_id
category: net
kind: namespace-method
tokens: Net.local_id
sig: Net.local_id() -> int
tip: This peer's own id.
order: 8
ns: Net
member: local_id
---
Returns the network id of the local peer.

View file

@ -1,6 +1,6 @@
--- ---
id: net id: network
title: Net title: Network
order: 6 order: 6
--- ---

View file

@ -0,0 +1,14 @@
---
id: network-apply
name: Network.apply
category: network
kind: namespace-method
tokens: Network.apply
sig: Network.apply(entity, buf) -> int
tip: Apply serialized state to an entity.
order: 3
ns: Network
member: apply
---
Reads synced fields from <code>buf</code> into <code>entity</code> — the inverse of <code>Network.serialize</code>.

View file

@ -1,13 +1,13 @@
--- ---
id: net-is_owner id: network-is_owner
name: Net.is_owner name: Network.is_owner
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.is_owner tokens: Network.is_owner
sig: Net.is_owner(entity) -> bool sig: Network.is_owner(entity) -> bool
tip: Does this peer own the entity? tip: Does this peer own the entity?
order: 7 order: 7
ns: Net ns: Network
member: is_owner member: is_owner
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: net-is_server id: network-is_server
name: Net.is_server name: Network.is_server
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.is_server tokens: Network.is_server
sig: Net.is_server() -> bool sig: Network.is_server() -> bool
tip: Is this peer the server? tip: Is this peer the server?
order: 6 order: 6
ns: Net ns: Network
member: is_server member: is_server
--- ---

View file

@ -0,0 +1,14 @@
---
id: network-local_id
name: Network.local_id
category: network
kind: namespace-method
tokens: Network.local_id
sig: Network.local_id() -> int
tip: This peer's own id.
order: 8
ns: Network
member: local_id
---
Returns the network id of the local peer.

View file

@ -1,13 +1,13 @@
--- ---
id: net-owner id: network-owner
name: Net.owner name: Network.owner
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.owner tokens: Network.owner
sig: Net.owner(entity) -> int sig: Network.owner(entity) -> int
tip: The peer that owns an entity. tip: The peer that owns an entity.
order: 4 order: 4
ns: Net ns: Network
member: owner member: owner
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: net-poll id: network-poll
name: Net.poll name: Network.poll
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.poll tokens: Network.poll
sig: Net.poll(buf, cap) -> int sig: Network.poll(buf, cap) -> int
tip: Read an inbound datagram. tip: Read an inbound datagram.
order: 1 order: 1
ns: Net ns: Network
member: poll member: poll
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: net-send id: network-send
name: Net.send name: Network.send
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.send tokens: Network.send
sig: Net.send(peer, buf, len) -> void sig: Network.send(peer, buf, len) -> void
tip: Put a datagram on the wire. tip: Put a datagram on the wire.
order: 0 order: 0
ns: Net ns: Network
member: send member: send
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: net-serialize id: network-serialize
name: Net.serialize name: Network.serialize
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.serialize tokens: Network.serialize
sig: Net.serialize(entity, buf) -> int sig: Network.serialize(entity, buf) -> int
tip: Serialize an entity's synced state. tip: Serialize an entity's synced state.
order: 2 order: 2
ns: Net ns: Network
member: serialize member: serialize
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: net-set_owner id: network-set_owner
name: Net.set_owner name: Network.set_owner
category: net category: network
kind: namespace-method kind: namespace-method
tokens: Net.set_owner tokens: Network.set_owner
sig: Net.set_owner(entity, peer) -> void sig: Network.set_owner(entity, peer) -> void
tip: Assign ownership of an entity. tip: Assign ownership of an entity.
order: 5 order: 5
ns: Net ns: Network
member: set_owner member: set_owner
--- ---

View file

@ -1,14 +0,0 @@
---
id: sys-file_close
name: Sys.file_close
category: sys
kind: namespace-method
tokens: Sys.file_close
sig: Sys.file_close(file) -> void
tip: Close a file.
order: 11
ns: Sys
member: file_close
---
Closes <code>file</code>, flushing any buffered writes.

View file

@ -1,14 +0,0 @@
---
id: sys-stderr
name: Sys.stderr
category: sys
kind: namespace-method
tokens: Sys.stderr
sig: Sys.stderr() -> ptr
tip: The standard error handle.
order: 13
ns: Sys
member: stderr
---
Returns the standard-error file handle, for <code>Sys.file_write</code>.

View file

@ -1,14 +0,0 @@
---
id: sys-stdout
name: Sys.stdout
category: sys
kind: namespace-method
tokens: Sys.stdout
sig: Sys.stdout() -> ptr
tip: The standard output handle.
order: 12
ns: Sys
member: stdout
---
Returns the standard-output file handle, for <code>Sys.file_write</code>.

View file

@ -1,6 +1,6 @@
--- ---
id: sys id: system
title: Sys title: System
order: 6 order: 6
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-arg id: system-arg
name: Sys.arg name: System.arg
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.arg tokens: System.arg
sig: Sys.arg(i) -> str sig: System.arg(i) -> str
tip: A command-line argument by index. tip: A command-line argument by index.
order: 0 order: 0
ns: Sys ns: System
member: arg member: arg
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-arg_count id: system-arg_count
name: Sys.arg_count name: System.arg_count
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.arg_count tokens: System.arg_count
sig: Sys.arg_count() -> int sig: System.arg_count() -> int
tip: The number of command-line arguments. tip: The number of command-line arguments.
order: 1 order: 1
ns: Sys ns: System
member: arg_count member: arg_count
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-env id: system-env
name: Sys.env name: System.env
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.env tokens: System.env
sig: Sys.env(name) -> str sig: System.env(name) -> str
tip: Read an environment variable. tip: Read an environment variable.
order: 4 order: 4
ns: Sys ns: System
member: env member: env
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-exit id: system-exit
name: Sys.exit name: System.exit
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.exit tokens: System.exit
sig: Sys.exit(code) -> void sig: System.exit(code) -> void
tip: End the process with a status code. tip: End the process with a status code.
order: 2 order: 2
ns: Sys ns: System
member: exit member: exit
--- ---

View file

@ -0,0 +1,14 @@
---
id: system-file_close
name: System.file_close
category: system
kind: namespace-method
tokens: System.file_close
sig: System.file_close(file) -> void
tip: Close a file.
order: 11
ns: System
member: file_close
---
Closes <code>file</code>, flushing any buffered writes.

View file

@ -1,13 +1,13 @@
--- ---
id: sys-file_open id: system-file_open
name: Sys.file_open name: System.file_open
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.file_open tokens: System.file_open
sig: Sys.file_open(path, mode) -> ptr sig: System.file_open(path, mode) -> ptr
tip: Open a file. tip: Open a file.
order: 6 order: 6
ns: Sys ns: System
member: file_open member: file_open
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-file_read id: system-file_read
name: Sys.file_read name: System.file_read
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.file_read tokens: System.file_read
sig: Sys.file_read(file, buf, n) -> int sig: System.file_read(file, buf, n) -> int
tip: Read bytes from a file. tip: Read bytes from a file.
order: 7 order: 7
ns: Sys ns: System
member: file_read member: file_read
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-file_seek id: system-file_seek
name: Sys.file_seek name: System.file_seek
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.file_seek tokens: System.file_seek
sig: Sys.file_seek(file, offset, whence) -> int sig: System.file_seek(file, offset, whence) -> int
tip: Move a file's read/write position. tip: Move a file's read/write position.
order: 9 order: 9
ns: Sys ns: System
member: file_seek member: file_seek
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-file_tell id: system-file_tell
name: Sys.file_tell name: System.file_tell
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.file_tell tokens: System.file_tell
sig: Sys.file_tell(file) -> int sig: System.file_tell(file) -> int
tip: The current file position. tip: The current file position.
order: 10 order: 10
ns: Sys ns: System
member: file_tell member: file_tell
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-file_write id: system-file_write
name: Sys.file_write name: System.file_write
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.file_write tokens: System.file_write
sig: Sys.file_write(file, buf, n) -> int sig: System.file_write(file, buf, n) -> int
tip: Write bytes to a file. tip: Write bytes to a file.
order: 8 order: 8
ns: Sys ns: System
member: file_write member: file_write
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-read_char id: system-read_char
name: Sys.read_char name: System.read_char
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.read_char tokens: System.read_char
sig: Sys.read_char() -> int sig: System.read_char() -> int
tip: Read one byte from standard input. tip: Read one byte from standard input.
order: 5 order: 5
ns: Sys ns: System
member: read_char member: read_char
--- ---

View file

@ -1,13 +1,13 @@
--- ---
id: sys-run id: system-run
name: Sys.run name: System.run
category: sys category: system
kind: namespace-method kind: namespace-method
tokens: Sys.run tokens: System.run
sig: Sys.run(command) -> int sig: System.run(command) -> int
tip: Run a shell command. tip: Run a shell command.
order: 3 order: 3
ns: Sys ns: System
member: run member: run
--- ---

View file

@ -0,0 +1,14 @@
---
id: system-stderr
name: System.stderr
category: system
kind: namespace-method
tokens: System.stderr
sig: System.stderr() -> ptr
tip: The standard error handle.
order: 13
ns: System
member: stderr
---
Returns the standard-error file handle, for <code>System.file_write</code>.

View file

@ -0,0 +1,14 @@
---
id: system-stdout
name: System.stdout
category: system
kind: namespace-method
tokens: System.stdout
sig: System.stdout() -> ptr
tip: The standard output handle.
order: 12
ns: System
member: stdout
---
Returns the standard-output file handle, for <code>System.file_write</code>.

View file

@ -1,4 +1,4 @@
# emit_collide.ludic — the Collide.* namespace: 2D overlap tests on plain # emit_collide.ludic — the Collision.* namespace: 2D overlap tests on plain
# integer coordinates (pixels or tiles). Rectangles are (x, y, w, h) with the # integer coordinates (pixels or tiles). Rectangles are (x, y, w, h) with the
# origin at the top-left; circles are (x, y, r). Squared distances use i64 so a # origin at the top-left; circles are (x, y, r). Squared distances use i64 so a
# large coordinate can't overflow. Each returns a bool. # large coordinate can't overflow. Each returns a bool.

View file

@ -211,13 +211,13 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
if is_ease_ns(meth) { return emit_ease_ns(meth, e) } if is_ease_ns(meth) { return emit_ease_ns(meth, e) }
perr(`unknown builtin Ease.{meth}`) perr(`unknown builtin Ease.{meth}`)
} }
if (ns == "Collide") { if (ns == "Collision") {
if is_collide_ns(meth) { return emit_collide_ns(meth, e) } if is_collide_ns(meth) { return emit_collide_ns(meth, e) }
perr(`unknown builtin Collide.{meth}`) perr(`unknown builtin Collision.{meth}`)
} }
if (ns == "Mem") { if (ns == "Memory") {
if is_mem_ns(meth) { return emit_mem_ns(meth, e) } if is_mem_ns(meth) { return emit_mem_ns(meth, e) }
perr(`unknown builtin Mem.{meth}`) perr(`unknown builtin Memory.{meth}`)
} }
if (ns == "Color") { if (ns == "Color") {
if is_colorfn_ns(meth) { return emit_colorfn_ns(meth, e) } if is_colorfn_ns(meth) { return emit_colorfn_ns(meth, e) }
@ -288,7 +288,7 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
if (meth == "detach") { bare = "world_detach_dyn" } if (meth == "detach") { bare = "world_detach_dyn" }
if (meth == "query_next") { bare = "world_query_next" } if (meth == "query_next") { bare = "world_query_next" }
} }
if (ns == "Net") { if (ns == "Network") {
if (meth == "send") { bare = "net_send" } if (meth == "send") { bare = "net_send" }
if (meth == "poll") { bare = "net_poll" } if (meth == "poll") { bare = "net_poll" }
if (meth == "serialize") { bare = "serialize" } if (meth == "serialize") { bare = "serialize" }
@ -299,7 +299,7 @@ fn emit_ns_call(ns: ptr, meth: ptr, e: Node) -> Val {
if (meth == "is_owner") { bare = "is_owner" } if (meth == "is_owner") { bare = "is_owner" }
if (meth == "local_id") { bare = "local_id" } if (meth == "local_id") { bare = "local_id" }
} }
if (ns == "Sys") { if (ns == "System") {
if (meth == "arg") { bare = "arg" } if (meth == "arg") { bare = "arg" }
if (meth == "arg_count") { bare = "arg_count" } if (meth == "arg_count") { bare = "arg_count" }
if (meth == "exit") { bare = "exit" } if (meth == "exit") { bare = "exit" }

View file

@ -1,4 +1,4 @@
# emit_mem.ludic — the Mem.* namespace: raw buffers and byte pokes. bytes/words # emit_mem.ludic — the Memory.* namespace: raw buffers and byte pokes. bytes/words
# allocate (as the bare builtins do); copy/fill wrap memcpy/memset; peek/poke # allocate (as the bare builtins do); copy/fill wrap memcpy/memset; peek/poke
# read and write one byte. The low-level escape hatch, PICO-8's memcpy/memset/ # read and write one byte. The low-level escape hatch, PICO-8's memcpy/memset/
# peek/poke by another name. # peek/poke by another name.

View file

@ -3227,10 +3227,10 @@ declare void @win_close()
@.str3126 = private unnamed_addr constant [22 x i8] c"unknown builtin List.\00" @.str3126 = private unnamed_addr constant [22 x i8] c"unknown builtin List.\00"
@.str3127 = private unnamed_addr constant [5 x i8] c"Ease\00" @.str3127 = private unnamed_addr constant [5 x i8] c"Ease\00"
@.str3128 = private unnamed_addr constant [22 x i8] c"unknown builtin Ease.\00" @.str3128 = private unnamed_addr constant [22 x i8] c"unknown builtin Ease.\00"
@.str3129 = private unnamed_addr constant [8 x i8] c"Collide\00" @.str3129 = private unnamed_addr constant [10 x i8] c"Collision\00"
@.str3130 = private unnamed_addr constant [25 x i8] c"unknown builtin Collide.\00" @.str3130 = private unnamed_addr constant [27 x i8] c"unknown builtin Collision.\00"
@.str3131 = private unnamed_addr constant [4 x i8] c"Mem\00" @.str3131 = private unnamed_addr constant [7 x i8] c"Memory\00"
@.str3132 = private unnamed_addr constant [21 x i8] c"unknown builtin Mem.\00" @.str3132 = private unnamed_addr constant [24 x i8] c"unknown builtin Memory.\00"
@.str3133 = private unnamed_addr constant [6 x i8] c"Color\00" @.str3133 = private unnamed_addr constant [6 x i8] c"Color\00"
@.str3134 = private unnamed_addr constant [23 x i8] c"unknown builtin Color.\00" @.str3134 = private unnamed_addr constant [23 x i8] c"unknown builtin Color.\00"
@.str3135 = private unnamed_addr constant [5 x i8] c"Time\00" @.str3135 = private unnamed_addr constant [5 x i8] c"Time\00"
@ -3398,7 +3398,7 @@ declare void @win_close()
@.str3297 = private unnamed_addr constant [17 x i8] c"world_detach_dyn\00" @.str3297 = private unnamed_addr constant [17 x i8] c"world_detach_dyn\00"
@.str3298 = private unnamed_addr constant [11 x i8] c"query_next\00" @.str3298 = private unnamed_addr constant [11 x i8] c"query_next\00"
@.str3299 = private unnamed_addr constant [17 x i8] c"world_query_next\00" @.str3299 = private unnamed_addr constant [17 x i8] c"world_query_next\00"
@.str3300 = private unnamed_addr constant [4 x i8] c"Net\00" @.str3300 = private unnamed_addr constant [8 x i8] c"Network\00"
@.str3301 = private unnamed_addr constant [5 x i8] c"send\00" @.str3301 = private unnamed_addr constant [5 x i8] c"send\00"
@.str3302 = private unnamed_addr constant [9 x i8] c"net_send\00" @.str3302 = private unnamed_addr constant [9 x i8] c"net_send\00"
@.str3303 = private unnamed_addr constant [5 x i8] c"poll\00" @.str3303 = private unnamed_addr constant [5 x i8] c"poll\00"
@ -3417,7 +3417,7 @@ declare void @win_close()
@.str3316 = private unnamed_addr constant [9 x i8] c"is_owner\00" @.str3316 = private unnamed_addr constant [9 x i8] c"is_owner\00"
@.str3317 = private unnamed_addr constant [9 x i8] c"local_id\00" @.str3317 = private unnamed_addr constant [9 x i8] c"local_id\00"
@.str3318 = private unnamed_addr constant [9 x i8] c"local_id\00" @.str3318 = private unnamed_addr constant [9 x i8] c"local_id\00"
@.str3319 = private unnamed_addr constant [4 x i8] c"Sys\00" @.str3319 = private unnamed_addr constant [7 x i8] c"System\00"
@.str3320 = private unnamed_addr constant [4 x i8] c"arg\00" @.str3320 = private unnamed_addr constant [4 x i8] c"arg\00"
@.str3321 = private unnamed_addr constant [4 x i8] c"arg\00" @.str3321 = private unnamed_addr constant [4 x i8] c"arg\00"
@.str3322 = private unnamed_addr constant [10 x i8] c"arg_count\00" @.str3322 = private unnamed_addr constant [10 x i8] c"arg_count\00"

View file

@ -9,14 +9,14 @@ program T {
print(Math.floor(Ease.bounce(0.5) * 1000.0)) # 765 print(Math.floor(Ease.bounce(0.5) * 1000.0)) # 765
print(Math.floor(Ease.back(0.5) * 1000.0)) # -88 print(Math.floor(Ease.back(0.5) * 1000.0)) # -88
print(Math.floor(Ease.back(1.0) * 1000.0)) # 1000 print(Math.floor(Ease.back(1.0) * 1000.0)) # 1000
print(Collide.rects(0, 0, 10, 10, 5, 5, 10, 10)) # 1 print(Collision.rects(0, 0, 10, 10, 5, 5, 10, 10)) # 1
print(Collide.rects(0, 0, 10, 10, 20, 20, 5, 5)) # 0 print(Collision.rects(0, 0, 10, 10, 20, 20, 5, 5)) # 0
print(Collide.point_rect(5, 5, 0, 0, 10, 10)) # 1 print(Collision.point_rect(5, 5, 0, 0, 10, 10)) # 1
print(Collide.point_rect(15, 5, 0, 0, 10, 10)) # 0 print(Collision.point_rect(15, 5, 0, 0, 10, 10)) # 0
print(Collide.point_rect(10, 5, 0, 0, 10, 10)) # 0 print(Collision.point_rect(10, 5, 0, 0, 10, 10)) # 0
print(Collide.circles(0, 0, 5, 6, 0, 5)) # 1 print(Collision.circles(0, 0, 5, 6, 0, 5)) # 1
print(Collide.circles(0, 0, 5, 20, 0, 5)) # 0 print(Collision.circles(0, 0, 5, 20, 0, 5)) # 0
print(Collide.rect_circle(0, 0, 10, 10, 15, 5, 6)) # 1 print(Collision.rect_circle(0, 0, 10, 10, 15, 5, 6)) # 1
print(Collide.rect_circle(0, 0, 10, 10, 20, 5, 6)) # 0 print(Collision.rect_circle(0, 0, 10, 10, 20, 5, 6)) # 0
} }
} }

View file

@ -1,19 +1,19 @@
program T { program T {
entry { entry {
let b = Mem.bytes(8) let b = Memory.bytes(8)
Mem.poke(b, 0, 65) Memory.poke(b, 0, 65)
Mem.poke(b, 1, 66) Memory.poke(b, 1, 66)
print(Mem.peek(b, 0)) # 65 print(Memory.peek(b, 0)) # 65
print(Mem.peek(b, 1)) # 66 print(Memory.peek(b, 1)) # 66
Mem.fill(b, 0, 8) Memory.fill(b, 0, 8)
print(Mem.peek(b, 0)) # 0 print(Memory.peek(b, 0)) # 0
let c = Mem.bytes(8) let c = Memory.bytes(8)
Mem.poke(b, 3, 99) Memory.poke(b, 3, 99)
Mem.copy(c, b, 8) Memory.copy(c, b, 8)
print(Mem.peek(c, 3)) # 99 print(Memory.peek(c, 3)) # 99
let w = Mem.words(4) let w = Memory.words(4)
w[0] = 12345 w[0] = 12345
print(w[0]) # 12345 print(w[0]) # 12345
print(Sys.arg_count()) # 1 print(System.arg_count()) # 1
} }
} }

View file

@ -50,11 +50,11 @@
"fn-file_stdout", "fn-file_stdout",
"fn-file_stderr" "fn-file_stderr"
], ],
"collide": [ "collision": [
"collide-rects", "collision-rects",
"collide-point_rect", "collision-point_rect",
"collide-circles", "collision-circles",
"collide-rect_circle" "collision-rect_circle"
], ],
"color": [ "color": [
"color-rgb", "color-rgb",
@ -168,24 +168,24 @@
"math-asin", "math-asin",
"math-acos" "math-acos"
], ],
"mem": [ "memory": [
"mem-bytes", "memory-bytes",
"mem-words", "memory-words",
"mem-copy", "memory-copy",
"mem-fill", "memory-fill",
"mem-peek", "memory-peek",
"mem-poke" "memory-poke"
], ],
"net": [ "network": [
"net-send", "network-send",
"net-poll", "network-poll",
"net-serialize", "network-serialize",
"net-apply", "network-apply",
"net-owner", "network-owner",
"net-set_owner", "network-set_owner",
"net-is_server", "network-is_server",
"net-is_owner", "network-is_owner",
"net-local_id" "network-local_id"
], ],
"networking": [ "networking": [
"fn-net_send", "fn-net_send",
@ -273,21 +273,21 @@
"kw-ui", "kw-ui",
"kw-enum" "kw-enum"
], ],
"sys": [ "system": [
"sys-arg", "system-arg",
"sys-arg_count", "system-arg_count",
"sys-exit", "system-exit",
"sys-run", "system-run",
"sys-env", "system-env",
"sys-read_char", "system-read_char",
"sys-file_open", "system-file_open",
"sys-file_read", "system-file_read",
"sys-file_write", "system-file_write",
"sys-file_seek", "system-file_seek",
"sys-file_tell", "system-file_tell",
"sys-file_close", "system-file_close",
"sys-stdout", "system-stdout",
"sys-stderr" "system-stderr"
], ],
"text": [ "text": [
"text-length", "text-length",

View file

@ -1324,11 +1324,11 @@ program LudicLsp {
if (meth == "back") { return "Ease.back(t) -> fixed" } if (meth == "back") { return "Ease.back(t) -> fixed" }
if (meth == "bounce") { return "Ease.bounce(t) -> fixed" } if (meth == "bounce") { return "Ease.bounce(t) -> fixed" }
} }
if (ns == "Collide") { if (ns == "Collision") {
if (meth == "rects") { return "Collide.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool" } if (meth == "rects") { return "Collision.rects(ax, ay, aw, ah, bx, by, bw, bh) -> bool" }
if (meth == "point_rect") { return "Collide.point_rect(px, py, rx, ry, rw, rh) -> bool" } if (meth == "point_rect") { return "Collision.point_rect(px, py, rx, ry, rw, rh) -> bool" }
if (meth == "circles") { return "Collide.circles(ax, ay, ar, bx, by, br) -> bool" } if (meth == "circles") { return "Collision.circles(ax, ay, ar, bx, by, br) -> bool" }
if (meth == "rect_circle") { return "Collide.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool" } if (meth == "rect_circle") { return "Collision.rect_circle(rx, ry, rw, rh, cx, cy, cr) -> bool" }
} }
if (ns == "World") { if (ns == "World") {
if (meth == "get") { return "World.get(prop_id, field_id, entity) -> int" } if (meth == "get") { return "World.get(prop_id, field_id, entity) -> int" }
@ -1348,32 +1348,32 @@ program LudicLsp {
if (meth == "detach") { return "World.detach(entity, prop_id)" } if (meth == "detach") { return "World.detach(entity, prop_id)" }
if (meth == "query_next") { return "World.query_next(query_id, cursor) -> int" } if (meth == "query_next") { return "World.query_next(query_id, cursor) -> int" }
} }
if (ns == "Net") { if (ns == "Network") {
if (meth == "send") { return "Net.send(peer, buf, len)" } if (meth == "send") { return "Network.send(peer, buf, len)" }
if (meth == "poll") { return "Net.poll(buf, cap) -> int" } if (meth == "poll") { return "Network.poll(buf, cap) -> int" }
if (meth == "serialize") { return "Net.serialize(entity, buf) -> int" } if (meth == "serialize") { return "Network.serialize(entity, buf) -> int" }
if (meth == "apply") { return "Net.apply(entity, buf) -> int" } if (meth == "apply") { return "Network.apply(entity, buf) -> int" }
if (meth == "owner") { return "Net.owner(entity) -> int" } if (meth == "owner") { return "Network.owner(entity) -> int" }
if (meth == "set_owner") { return "Net.set_owner(entity, peer)" } if (meth == "set_owner") { return "Network.set_owner(entity, peer)" }
if (meth == "is_server") { return "Net.is_server() -> bool" } if (meth == "is_server") { return "Network.is_server() -> bool" }
if (meth == "is_owner") { return "Net.is_owner(entity) -> bool" } if (meth == "is_owner") { return "Network.is_owner(entity) -> bool" }
if (meth == "local_id") { return "Net.local_id() -> int" } if (meth == "local_id") { return "Network.local_id() -> int" }
} }
if (ns == "Sys") { if (ns == "System") {
if (meth == "arg") { return "Sys.arg(i) -> str" } if (meth == "arg") { return "System.arg(i) -> str" }
if (meth == "arg_count") { return "Sys.arg_count() -> int" } if (meth == "arg_count") { return "System.arg_count() -> int" }
if (meth == "exit") { return "Sys.exit(code)" } if (meth == "exit") { return "System.exit(code)" }
if (meth == "run") { return "Sys.run(command) -> int" } if (meth == "run") { return "System.run(command) -> int" }
if (meth == "env") { return "Sys.env(name) -> str" } if (meth == "env") { return "System.env(name) -> str" }
if (meth == "read_char") { return "Sys.read_char() -> int" } if (meth == "read_char") { return "System.read_char() -> int" }
if (meth == "file_open") { return "Sys.file_open(path, mode) -> ptr" } if (meth == "file_open") { return "System.file_open(path, mode) -> ptr" }
if (meth == "file_read") { return "Sys.file_read(file, buf, n) -> int" } if (meth == "file_read") { return "System.file_read(file, buf, n) -> int" }
if (meth == "file_write") { return "Sys.file_write(file, buf, n) -> int" } if (meth == "file_write") { return "System.file_write(file, buf, n) -> int" }
if (meth == "file_seek") { return "Sys.file_seek(file, offset, whence) -> int" } if (meth == "file_seek") { return "System.file_seek(file, offset, whence) -> int" }
if (meth == "file_tell") { return "Sys.file_tell(file) -> int" } if (meth == "file_tell") { return "System.file_tell(file) -> int" }
if (meth == "file_close") { return "Sys.file_close(file)" } if (meth == "file_close") { return "System.file_close(file)" }
if (meth == "stdout") { return "Sys.stdout() -> ptr" } if (meth == "stdout") { return "System.stdout() -> ptr" }
if (meth == "stderr") { return "Sys.stderr() -> ptr" } if (meth == "stderr") { return "System.stderr() -> ptr" }
} }
if (ns == "Save") { if (ns == "Save") {
if (meth == "write") { return "Save.write()" } if (meth == "write") { return "Save.write()" }
@ -1385,13 +1385,13 @@ program LudicLsp {
if (meth == "elapsed") { return "Time.elapsed() -> fixed" } if (meth == "elapsed") { return "Time.elapsed() -> fixed" }
if (meth == "now") { return "Time.now() -> int" } if (meth == "now") { return "Time.now() -> int" }
} }
if (ns == "Mem") { if (ns == "Memory") {
if (meth == "bytes") { return "Mem.bytes(n) -> ptr" } if (meth == "bytes") { return "Memory.bytes(n) -> ptr" }
if (meth == "words") { return "Mem.words(n) -> words" } if (meth == "words") { return "Memory.words(n) -> words" }
if (meth == "copy") { return "Mem.copy(dst, src, n)" } if (meth == "copy") { return "Memory.copy(dst, src, n)" }
if (meth == "fill") { return "Mem.fill(buf, value, n)" } if (meth == "fill") { return "Memory.fill(buf, value, n)" }
if (meth == "peek") { return "Mem.peek(buf, i) -> int" } if (meth == "peek") { return "Memory.peek(buf, i) -> int" }
if (meth == "poke") { return "Mem.poke(buf, i, value)" } if (meth == "poke") { return "Memory.poke(buf, i, value)" }
} }
return null return null
} }