refactor(lang): rename the ptr/ptrs types to pointer/pointers
Expand the abbreviated pointer types to full words on the language surface: ptr -> pointer (a raw address / FFI handle) ptrs -> pointers (a buffer of pointers) The Ludic type name is distinct from LLVM's own `ptr` spelling: llty() maps `pointer`/`pointers` to LLVM `ptr`, and the emitted IR keeps `ptr`, so only the Ludic-level surface changes. Rewrites type annotations across all sources, the 8 hardcoded pointer type-tags, the `pointers`-buffer indexing in emit_addr, the grammars/LSP/JetBrains tokens, and the docs (type-ptr -> type-pointer, type-ptrs -> type-pointers). int/bool keep their conventional short spelling (like Math). Reseeded; C-free fixpoint holds; all suites green (45/24/29); site + check.py OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
b7745a4600
commit
effb3f637f
76 changed files with 516 additions and 516 deletions
|
|
@ -11,7 +11,7 @@
|
|||
# Hash.mix(x) fmix32 avalanche of a single int (turn a counter into a seed)
|
||||
# Hash.combine(...) fold several ints into one (e.g. world_seed, cx, cy)
|
||||
|
||||
function is_hash_ns(meth: ptr) -> bool {
|
||||
function is_hash_ns(meth: pointer) -> bool {
|
||||
if (meth == "of") or (meth == "fnv1a") or (meth == "crc32") { return true }
|
||||
if (meth == "mix") or (meth == "combine") { return true }
|
||||
if (meth == "of64") or (meth == "fnv1a_64") or (meth == "mix64") { return true }
|
||||
|
|
@ -21,7 +21,7 @@ function is_hash_ns(meth: ptr) -> bool {
|
|||
# fmix32 (MurmurHash3 finalizer) of a single i32 -> code of an i32. A strong
|
||||
# avalanche: flips ~half the output bits for any one input bit. Used on its own
|
||||
# (Hash.mix) and nowhere else — combine has its own mixing step.
|
||||
function hash_mix_code(x: ptr) -> ptr {
|
||||
function hash_mix_code(x: pointer) -> pointer {
|
||||
let a = emit_bind(`lshr i32 {x}, 16`)
|
||||
let b = emit_bind(`xor i32 {x}, {a}`)
|
||||
let c = emit_bind(`mul i32 {b}, -2048144789`) # * 0x85ebca6b
|
||||
|
|
@ -35,7 +35,7 @@ function hash_mix_code(x: ptr) -> ptr {
|
|||
# fmix64 (MurmurHash3 64-bit finalizer) of a single i64 -> code of an i64. The
|
||||
# 64-bit twin of hash_mix_code: shift by 33 and multiply by the two 64-bit
|
||||
# constants. Backs Hash.mix64.
|
||||
function hash_mix64_code(x: ptr) -> ptr {
|
||||
function hash_mix64_code(x: pointer) -> pointer {
|
||||
let a = emit_bind(`lshr i64 {x}, 33`)
|
||||
let b = emit_bind(`xor i64 {x}, {a}`)
|
||||
let c = emit_bind(`mul i64 {b}, -49064778989728563`) # * 0xff51afd7ed558ccd
|
||||
|
|
@ -46,7 +46,7 @@ function hash_mix64_code(x: ptr) -> ptr {
|
|||
return emit_bind(`xor i64 {f}, {g}`)
|
||||
}
|
||||
|
||||
function emit_hash_ns(meth: ptr, e: Node) -> Val {
|
||||
function emit_hash_ns(meth: pointer, e: Node) -> Val {
|
||||
if (meth == "of") or (meth == "fnv1a") { # FNV-1a 32-bit over the bytes
|
||||
g_uses_hashrt = true
|
||||
let s = emit_expr(e.kids[0])
|
||||
|
|
@ -74,7 +74,7 @@ function emit_hash_ns(meth: ptr, e: Node) -> Val {
|
|||
# seed = seed ^ (v + 0x9e3779b9 + (seed << 6) + (seed >> 2))
|
||||
# order-sensitive and deterministic; seed starts at 0 so a single argument is
|
||||
# still well-mixed with the golden-ratio constant.
|
||||
var seed: ptr = "0"
|
||||
var seed: pointer = "0"
|
||||
var i = 0
|
||||
while i < len(e.kids) {
|
||||
let v = emit_expr(e.kids[i])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue