docs: regenerate site from f094acfdb5

This commit is contained in:
ludic-docs-bot 2026-09-17 22:10:03 +00:00
commit 63c5ed9baf
975 changed files with 55427 additions and 0 deletions

40
kw-extern.html Normal file
View file

@ -0,0 +1,40 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>extern — Ludic</title>
<meta name="description" content="Bind a name to an external native symbol — the seam for platform and library calls.">
<link rel="stylesheet" href="base.css">
<link rel="stylesheet" href="docs.css">
</head>
<body>
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
<main class="wrap item">
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <a href="api.html#structure">Program structure</a> <span>›</span> <span class="here">extern</span></div>
<div class="item-head">
<span class="kind-badge kind-keyword">keyword</span>
<h1 id="top">extern</h1>
</div>
<code class="sig">extern function name(a: T) -&gt; R = "symbol"</code>
<div class="desc"><p>An <code>extern function</code> declares a function whose body lives outside Ludic and binds it to a native symbol resolved at link time. It is the seam through which Ludic reaches anything with a native interface — a system library, a math routine, or even another <code>.ludic</code> file compiled as a <code>module</code>. You write the Ludic signature you want to call and give the real symbol name after <code>=</code>; the linker connects them (pass <code>-L</code>/<code>-l</code> to <code>ludicc</code> to point at the library). Types must match the foreign ABI, so map each parameter and the return to the right Ludic type (<code>int</code>, <code>fixed</code>, <code>pointer</code>, …).</p></div>
<div class="params"><h2>Parameters</h2><div class="param" id="param-a"><code class="pname">a</code><span class="pdesc">a typed argument passed straight through to the foreign symbol</span></div></div>
<div class="examples"><h2>Example</h2><pre data-lang="ludic">program Physics {
extern function c_hypot(a: fixed, b: fixed) -&gt; fixed = "hypot_fx"
property Velocity { delta_x: int = 0, delta_y: int = 0 }
model Projectile { Velocity }
handler MeasureSpeed phase Update {
for (velocity) in query [Velocity, {Projectile}] {
let speed = c_hypot(a: fixed(velocity.delta_x), b: fixed(velocity.delta_y))
Screen.status(string(floor(speed)))
}
}
}</pre></div>
<a class="back" href="api.html">← All symbols</a>
</main>
<script src="ludic-highlight.js"></script>
<script>Ludic.highlightAll(); Ludic.installCards(); Ludic.flashTarget();</script>
</body></html>