Release Ziran 0.7.0
Wasm now runs all three Kryon widget scenarios faster than Go: Button 2.46 µs, Text 3.59 µs and Input 3.24 µs per two frames on Alpha. The optimizer inlines small procedures and reads record members through their inserts. Native x86-64 code is faster across division, shifts, floating-point calls and small allocations. std/base64, JPEG reading and writing, portable PNG inflate and core audio join the standard library. The changelog section lists what users get, including the known ARMv7 LevelReplayPump frame-limit issue. update_version.sh set the version files and the standard-library inventory, and site_pages.py regenerated the module pages for 0.7.0.
This commit is contained in:
1 parent
13c2a22ae6
commit
55b0176800
138 files changed
+213
-214
No files matched your search
+9
-50
@@ -2,57 +2,16 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- The ZX optimizer hoists fixed member reads, such as a slice's data and count, out of loops, and rotates loops whose test loads from memory. Across the 29 standard workloads on Alpha both took 0.67% less time by geometric mean; JSON round trips ran 9.7% and radix sort 6.8% faster.
|
||||
- Wasm writes zeroed records with wide stores, or `memory.fill` past 320 bytes, instead of one byte store per member, and a zero record that is only stored or nested is never built. The Kryon Text widget scenario measured 3.604 µs against 3.890 µs in five alternating Alpha rounds, with the paint result checked on every call.
|
||||
- Wasm lowering copies fewer record bytes when a snapshot only supplies fixed member reads or a later replacement. It can also initialize a fresh allocation directly from a member and write a single field back to the original address. Snapshot values survive intervening writes.
|
||||
- ZX reads the length of a local fixed array without loading its elements. Iterating an address-backed array no longer copies it at every loop condition.
|
||||
- The ZX optimizer specializes direct calls that pass a literal Boolean controlling a loop branch. Spectral-norm took 19.9% less time across 11 matched rounds on Alpha, with identical output. It makes no copy in which folding the literal leaves a record load without its field read, and it drops an unused load when the same block loads that address again before anything else takes effect. This keeps the Button and Input widgets from copying the whole widget tree.
|
||||
- Native x86-64 multiplies by 31 with a shift and subtract. FASTA ran faster in 17 of 18 matched rounds on Alpha, with a median paired gain of 0.7% in the original 11-workload suite.
|
||||
- Native x86-64 divides a signed product known to be even by two with one arithmetic shift. Spectral-norm takes 24.2% less time on Alpha at the diagnostic size, with identical output.
|
||||
- The Targets page uses microseconds and C-relative ratios across the runtime comparisons. The standard suite adds 18 deterministic workloads, including JSON round trips, SHA-256, shortest paths, FFT, image filtering and particle updates. Independent C and Go implementations check both runtime sizes against ZX native and Wasm. The example, widget and JSON/UTF-8 runtime snapshots share the standard suite's host gate.
|
||||
- Register allocation puts a value a loop passes back to its block parameter into that parameter's register, so the back edge needs no copy. The rewritten Fib's accumulator is added in place and its loop jumps straight back.
|
||||
- A float multiply by 2.0 becomes an add of the value to itself, exact for every value, NaN, infinities and signed zeros included, so it needs no constant.
|
||||
- The optimizer turns a self call whose integer result is added to another value and returned, as in `Fib(n-1) + Fib(n-2)`, into an accumulator loop, as GCC does at `-O2`: the remaining call runs once per iteration and the other becomes a jump back. Fib makes half as many calls. Effects keep their order, a run charges the same steps, and a function with no base case is left alone so runaway recursion still takes the stack trap.
|
||||
- The native runtime builds on ARMv7 again. Only x86-64 checks the heap offsets used by its generated allocator.
|
||||
- Native x86-64 code divides by a constant divisor folded into the instruction instead of first loading it into a register the division never reads, and starts every loop on a 32-byte boundary, so a change before a loop no longer moves its speed.
|
||||
- Native x86-64 callers keep floating-point values in XMM registers across a direct call to a function whose allocated code, including its own calls, leaves those registers untouched, instead of spilling them around the call. The allocated-code verifier checks each reduced mask against the callee; indirect, recursive and not-yet-allocated callees keep the full ABI clobber set.
|
||||
- `std/parallel` can report the online logical processor count with `ParallelProcessors()` and initialize a worker pool with an explicit lane count using `ParallelInitLanes`.
|
||||
- Native x86-64 code shifts by a constant count inside the width with an immediate `shl`, `shr` or `sar`, without loading the count into `cl` or checking its range. nqueens, which shifts its diagonals by one per placement, runs 4% faster.
|
||||
- Native x86-64 code tests an inclusive `for` range with a computed end once per iteration instead of twice: after leaving on the last value, the copy of the header test that loop rotation leaves in the latch always holds and becomes a jump. The LIR keeps the test, which the vectorizer reads.
|
||||
- `Finite32` and `Finite64` live in the new `std/finite` module, which `std/math` re-exports, and are `#inline`: generated C gets a static inline copy of each in `finite.h`, so callers no longer make an out-of-line call per component. NaN and infinities still give false.
|
||||
- An in-process native run of an entry without a result reports zero instead of whatever its last call left in the result register, as the portable engine does.
|
||||
- In-process native x86-64 code allocates and frees blocks of up to 256 bytes itself: 16-byte classes with free lists and chunks per instance, behind a 16-byte header that still rejects a block with the wrong count or element size. Larger blocks and growth go through the host as before. Binary-trees runs in under half the time of the C reference (46 ms against 98 ms on Alpha), down from 223 ms.
|
||||
- Native x86-64 division and remainder by any other positive constant use a high multiply instead of `idiv`, signed and unsigned at every integer width. FASTA, whose generator takes `%139968` and `%1000000007` per byte, runs in less than half the time.
|
||||
- Native x86-64 code starts every function on a 32-byte boundary and keeps each branch, compare-and-branch pair, call and return inside one 32-byte block, with NOPs where needed. Intel cores with the jump-erratum microcode fix keep such loops in their decoded-instruction cache, so a change elsewhere in a program no longer moves a hot loop's speed by up to a third.
|
||||
- Native x86-64 branches on an ordered float comparison (`<`, `<=`, `>`, `>=`) jump on the compare's flags, NaN included, instead of first building a bool and testing it.
|
||||
- `bench/bench.zi standard-ab` times the C reference and several in-process native runners on the standard suite in shuffled rounds on one CPU, checking every result against C. `standard-profile` reports SIGPROF samples of a runner by function, with the hottest native code disassembled.
|
||||
- Native x86-64 checks no longer branch around their traps: a passing check falls through, and its trap call sits after the function's blocks, so loops with bounds, division, shift, stack and step checks keep one straight path. Trap reports still name the check's function, block and source line.
|
||||
- Native x86-64 additions can write a separate result register with LEA, keeping reused inputs live without tied copies; narrow integer results retain their normalization.
|
||||
- Register allocation keeps spilled values in memory through blocks that only carry them to the next control-flow edge, avoiding a reload and another spill before the next call. Joins retain their register allocation.
|
||||
- Native x86-64 integer-to-float conversions clear unused XMM lanes before converting, removing the legacy SSE instruction's dependency on an earlier floating-point value while preserving rounding and condition flags.
|
||||
- Native x86-64 returns simple integer base cases before allocating a frame or saving registers, while preserving checked and fueled paths. Adjacent 64-bit register copies and constant additions/subtractions use one address instruction, including recursive call arguments.
|
||||
- WAV decoding supports mono/stereo IMA ADPCM and Microsoft ADPCM in the core audio module and mixer, with fact-based frame counts, bounded block validation and independent PCM fixture tests.
|
||||
- Float64 `sqrt` and `std/math.Sqrt` lower to hardware square root on x86-64, AArch64 and ARMv7, with the same IEEE rounding on the portable engine, generated C/Go and Wasm. An independent integer reference checks every exponent and one million bit patterns.
|
||||
- ZX lowering folds signed integer interval checks such as `value > 1000 || value < 0` into one unsigned comparison when both sides read the same stable local, record member or fixed-array element. Calls and other expressions whose second evaluation can matter retain short-circuit evaluation.
|
||||
- Native verification distinguishes integer and floating-point scratch registers when checking parallel copies, so valid floating-point argument copies are accepted even when register numbers match across banks.
|
||||
- Core audio builds share SHA256-pinned Xiph Vorbis archives across native targets; Windows uses the correct C-long ABI, verified against every public field offset and actual streaming/seek decoding.
|
||||
## [0.7.0] - 2026-11-18
|
||||
|
||||
- Native register allocation resolves values across block edges without copying a register from an unrelated block laid out earlier. This fixes tied floating-point results in inlined control flow.
|
||||
- Native x86-64 division and remainder by a known positive power of two use shifts and a signed rounding bias instead of `idiv`, preserving truncation toward zero and remainders at every integer width.
|
||||
- The website's kernel and standard tables are measured with `bench/wasm_tier.py --host-gate`: each job runs pinned to one logical CPU of the quietest core, with Go at `GOMAXPROCS=1`, and runs again unless that CPU held a steady clock at its calibrated sustained speed with its hyperthread sibling idle. Rejected attempts stay in the receipt, and the generators refuse ungated receipts; the earlier native kernel column had run at about half clock. The kernel table's ZX native column runs each kernel's bundle translated to machine code in process, in the same harness as C and the engine, so it no longer includes process startup; each kernel's `zx2native` executable is still run once as an output check. Every /targets table is measured again at one compiler commit, and the widget downloads name Kryon's license after its repository with no stale copies left from earlier runs.
|
||||
- Audio mixing, PCM streams, Ogg/Vorbis inspection and streaming/seek, WAV/MP3 decoding and SDL/WebAudio output are core standard modules independent of Kryon. Android streams through AAudio on API 26+ and OpenSL ES on API 21–25, with the same mixer and sink contract as desktop.
|
||||
|
||||
- Loop invariant hoisting leaves standalone constants and symbolic addresses near their uses while retaining useful invariant expressions. This reduces spills in vector growth loops; the matched Alpha Vectors kernel improves from 85.8 to 42.5 µs with unchanged results.
|
||||
|
||||
- `bench/standard/` holds the benchmarks people use to compare languages, in Ziran, C and Go with every input read at run time: recursive Fibonacci, n-body, spectral-norm, mandelbrot, fannkuch-redux, binary-trees, fasta, nqueens, integer matrix multiplication, quicksort and FNV-1a string hashing. `bench/wasm_tier.py --standard` runs them as C (`cc -O2`), Go, native ZX and Wasm on Alpha's physical host and checks every result against C, at diagnostic sizes or the Benchmarks Game sizes (`--standard-full`); `bench/bench.zi -- standard-compile` times whole-suite builds for each target. The small-kernel table gains independent Go references. The website shows the results, and `bench/results/standard/gaps.md` ranks where native ZX trails C: on spectral-norm, fasta, binary-trees and matmul the same program runs much closer to C as Wasm, so the native backend is the gap there.
|
||||
- The website's benchmark tables share one number format: three significant digits with thousands separators, never scientific notation, and one unit per table named once in its header (ns for the example programs, µs for kernels, workloads and the standard suite, ms for compile time). The Python generators use `format_number` in `scripts/site_targets.py`, the Ziran renderer uses `scripts/site_numbers.zi`, and `tests/site_targets.sh` checks both against one set of cases and the page for scientific notation. The example and JSON/UTF-8 tables were measured again with the updated harness on the same host and compiler commit.
|
||||
- Native x86-64 code builds the record a function returns where its caller keeps the result instead of in a frame object it then copies: when every return gives the same record, that record and the members built in it lie in the caller's result memory, which the function keeps the address of in `r14` for its whole body (saved and never allocated), so the return has nothing to copy. A record returned on two different paths, a parameter, or a parameter with a member changed keeps its copy. The machine IR gains a `result_register` flag on functions and placement into a function's `ResultAddress` object, and both verifiers check them.
|
||||
- Native x86-64 code builds a record member where its parent keeps it instead of in a temporary it then copies from: members of a nested literal, a member inserted into a built record, one replaced through a constant index and a call result used as a member take frame space inside the parent's, and a member that is also read, shared, updated afterwards or whose parent is read while it is built keeps its own. An aggregate build whose members are all replaced before it is read emits nothing, and the optimizer folds f64-to-f32 and f32-to-f64 constant conversions and float negations to the hardware's patterns (NaNs stay). A nested shadow-token builder shaped like Kryon's `DefaultShadows` shrinks from 1759 to 661 bytes of code. The machine IR gains placed stack objects (`placed_in`, `placed_at`), and the allocated verifier checks each lies inside its parent.
|
||||
- Wasm code reads a large record's fields where the record lies instead of copying it whole, gives record parameters and results the caller's storage, builds a member, call result or returned record where its parent or caller keeps it, and leaves out constructor stores that are overwritten before use. On an Intel Core i7-8700, Kryon's Button, Text and Input widget scenarios take 5.6, 7.3 and 8.4 µs per two frames in Wasm instead of 1056, 715 and 1234 µs, faster than native ZX.
|
||||
- Verifying and saving LIR is faster: the verifier checks that each definition dominates its uses against one dominator tree per function instead of searching the control flow graph for every use, and the LIR codec reads and writes a whole integer field with one bounds check. Loop rotation rotates every loop in memory and writes the program once instead of once per loop. Bundling the optimizer's own test program takes 11 s instead of 88 s.
|
||||
- The optimizer inlines direct calls to small procedures (at most 48 instructions that keep no stack storage, do not call their host and do not call themselves): it expands callees before their callers and copies each callee as expanded, so a helper brings its own inlined helpers and one that grew past the limit stays a call, growing a program by at most half and never past its work budget. Native and Wasm code then pay no call, fuel or frame cost for helpers such as Kryon's session lookups. A single-block callee such as `std/math.Sqrt` is copied into the caller's block in place, without new blocks or jumps, so n-body's inner loop keeps its shape. spectral-norm's `Spectral` no longer calls `A` inside its loops; it calls `Multiply`, which has `A` inlined.
|
||||
- The optimizer reads a record member through the inserts that built it: reading a member an insert replaced gives the inserted value, and reading another member looks past the insert to the record underneath. A call whose result is unused goes when its procedure cannot be observed: no stores, host or indirect calls, possible traps or loops, and calls only to such procedures. A member read of a record joined from several branches moves into each branch, and a call to such a procedure whose result is then read only member by member is inlined for those reads, from callees up to four times the call limit, for up to three rounds after the program is folded. A Kryon widget's theme lookup becomes the constant colour or size it reads: the Button scenario calls `DefaultTheme` once instead of 17 times. Control-flow simplification that makes a jump's target the new entry block drops the old entry instead of leaving it jumping into the new one, and leaves an entry block with parameters in place. Jump threading sends an edge into a block that only jumps on to that jump's target, and an edge into a block that only branches, with a constant condition there, to the side it selects; a jump into such a branch becomes the branch. Each block whose only predecessor jumps to it then joins that predecessor. No edge moves onto a loop header, so loops keep the one entry and latch that hoisting and rotation need. The Kryon Button bundle drops from 7,255 blocks and 4,276 jumps to 4,169 and 1,175, and from 1.58 to 1.35 MB. Common-subexpression elimination follows the dominator tree (cmd/compiler_opt_dom.zi): arithmetic, comparisons and record reads repeated in a block that an earlier copy dominates reuse that copy; constants, conversions, addresses and byte comparisons stay reused within their own block, where the backend folds them into their uses. Copy propagation and jump threading run before inlining as well, so callees are measured as they will be after cleanup, and member-read inlining charges its growth to the program's size after each round's cleanup, for up to four rounds. Hoisting, induction-variable rewriting and loop rotation look for a loop only at a block some edge leads back to in a depth-first walk, instead of walking the whole function once for every block: a 3,000-block function takes about half a million units of optimizer work instead of 250 million, and Shovey's hosted app bundle no longer runs out of budget. `zx2wasm --unbounded` makes the Wasm module for a run with no step budget, as a native executable is: its `fuel` instructions charge nothing and it imports no `zx.budget`, which makes the Kryon widget scenarios about a quarter faster; the site's widget table measures Wasm that way, like the C and Go builds. A Wasm procedure reserves edge scratch only for a block an edge enters with two or more aggregates, so one taking a string or record argument no longer sets up an unused stack frame. A fixed-size Wasm copy of up to 320 bytes, such as a paint command record, is unrolled into loads and stores instead of calling memory.copy, which engines run out of line.
|
||||
- A host can inspect a slice of records containing strings or nested slices under Wasm without requiring a copy back when its values are unchanged. Mutable byte slices still copy their changes back.
|
||||
- Wasm now runs all three Kryon widget scenarios faster than Go, and two of them faster than C: Button takes 2.46 µs, Text 3.59 µs and Input 3.24 µs per two frames on Alpha, against 4.33, 3.89 and 6.59 µs in Go. Wasm code reads a record's fields where the record lies instead of copying it, builds records where their caller or parent keeps them, writes a single changed field in place, and writes zeroed records with wide stores or `memory.fill`. `zx2wasm --unbounded` makes a module with no step budget for runs that need none.
|
||||
- The optimizer inlines small procedures, reads record members through the inserts that built them, drops unused calls to procedures without side effects, specializes calls that pass a literal Boolean controlling a loop, and turns recursion such as `Fib(n-1) + Fib(n-2)` into an accumulator loop. It hoists fixed member reads, such as a slice's data and count, out of loops and rotates loops whose test loads from memory, so JSON round trips run 9.7% and radix sort 6.8% faster. It also folds interval checks such as `value > 1000 || value < 0` into one unsigned comparison. A Kryon widget's theme lookups become the constants they read.
|
||||
- Native x86-64 code is faster. Division and remainder by constants use multiplies and shifts, constant shifts use immediates, and floating-point values stay in XMM registers across calls that leave those registers alone. Small blocks are allocated in process, so binary-trees runs in under half the time of the C reference. Functions and loops are aligned, so an unrelated edit no longer moves a loop's speed, and `--checks` builds no longer branch around their traps. Float64 `sqrt` and `std/math.Sqrt` use the hardware square root on x86-64, AArch64 and ARMv7.
|
||||
- New standard library features: `std/base64` encodes and decodes RFC 4648 base64; `std/jpeg` reads baseline and progressive JPEGs and writes JFIF on every target; `std/png_linux` inflates PNG data portably; `std/finite` has inline `Finite32` and `Finite64`; and `std/parallel` adds `ParallelProcessors` and `ParallelInitLanes`.
|
||||
- Audio is part of the core standard library, independent of Kryon: mixing, PCM streams, WAV with IMA and Microsoft ADPCM, MP3, and Ogg/Vorbis with streaming and seeking, played through SDL, WebAudio, or AAudio and OpenSL ES on Android.
|
||||
- Fixes: integers format correctly across the full signed 64-bit range, including the minimum value. The native runtime builds on ARMv7 again. An in-process native run of an entry without a result reports zero. Register allocation no longer copies a register from an unrelated block across a block edge.
|
||||
- The Targets page on the website compares C, Go, native ZX and Wasm in microseconds, all measured on one physical host at one compiler revision. It covers a 29-workload standard suite with independent C and Go references, Kryon widgets and JSON/UTF-8 workloads, with raw samples and generated code to download.
|
||||
- Known issue: on ARMv7, native ZX can stop Kryon's `LevelReplayPump` at its frame limit. The fix is not in this release.
|
||||
|
||||
## [0.6.0] - 2026-11-16
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Reference / Current surface</p><h1>The Ziran <em>API.</em></h1><p>This documents the <code>ziran</code> command, the direct compiler tools, and the public portable C host header. The standard library has its own <a href="modules.html">generated reference</a>. APIs and binary formats are experimental.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Contents</strong><a href="#toolchain">Commands</a><a href="#projects">Projects</a><a href="#tools">Direct tools</a><a href="modules.html">Standard library</a><a href="#host">C host API</a></aside><div class="article-body api-body">
|
||||
<section id="toolchain"><p class="eyebrow">01 / Toolchain</p><h2>Commands</h2><p>Build the tools with <code>make</code>, then run <code>build/bin/ziran</code>, or install it with <code>make install-user</code>. <code>ziran guide</code> prints a short tour of these commands.</p><div class="api-list">
|
||||
<div><code>ziran version</code><p>Print the compiler version; <code>--version</code> is the same. Release tags follow it, so <code>ref = "v0.6.0"</code> in <code>ziran.toml</code> pins a release.</p></div>
|
||||
<div><code>ziran version</code><p>Print the compiler version; <code>--version</code> is the same. Release tags follow it, so <code>ref = "v0.7.0"</code> in <code>ziran.toml</code> pins a release.</p></div>
|
||||
<div><code>ziran check --root DIR file.zi ...</code><p>Check source and its imports without writing output. Add <code>--diagnostics=json</code> for machine-readable diagnostics.</p></div>
|
||||
<div><code>ziran ir --root DIR -o DIR file.zi|file.zir ...</code><p>Check and write versioned binary <code>.zir</code> modules.</p></div>
|
||||
<div><code>ziran build [--target=c|go|wasm|zx] [--root DIR] [-o FILE|DIR] file.zi</code><p>Build a direct native binary by default, or select an explicit output target. <code>--exe --entry module:function</code> writes a runnable C or Go program; Go also takes <code>--pkg NAME</code>.</p></div>
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<a href="examples.html"><span>Learn by doing</span><strong>Examples</strong><p><!-- generated:example_count -->16<!-- /generated:example_count --> complete programs with commands, each printing the same output on every target.</p><b>Browse examples →</b></a>
|
||||
<a href="language.html"><span>Language</span><strong>Syntax reference</strong><p>Modules, declarations, types, generics, control flow, compile-time forms, laws, and foreign calls.</p><b>Read the reference →</b></a>
|
||||
<a href="api.html#toolchain"><span>Toolchain</span><strong>CLI reference</strong><p>Check, build C or Go, bundle, run, format, and query the toolchain.</p><b>See commands →</b></a>
|
||||
<a href="modules.html"><span>Libraries</span><strong>Modules and packages</strong><p>Every public declaration in the <!-- generated:std_count -->126<!-- /generated:std_count --> standard modules and the ziranlang packages, generated from the source.</p><b>Browse modules →</b></a>
|
||||
<a href="modules.html"><span>Libraries</span><strong>Modules and packages</strong><p>Every public declaration in the <!-- generated:std_count -->127<!-- /generated:std_count --> standard modules and the ziranlang packages, generated from the source.</p><b>Browse modules →</b></a>
|
||||
<a href="status.html"><span>Project</span><strong>Implementation status</strong><p>See what works in the tested subset and what still needs implementation.</p><b>Check support →</b></a>
|
||||
<a href="guide/packages.html"><span>Projects</span><strong>Packages</strong><p><code>ziran.toml</code> projects, pinned Git dependencies, locks, and installing applications.</p><b>Read the guide →</b></a>
|
||||
</div></section>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="index.html"><img class="brand-icon" src="assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="get-started.html" aria-current="page">Get started</a><a href="examples.html">Examples</a><a href="targets.html">Targets</a><a href="modules.html">Modules</a><a href="docs.html">Docs</a><a href="status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Get started / First program</p><h1>Write your first <em>Ziran program.</em></h1><p>Build the current toolchain from source, write a complete program, then run it locally. Ziran is experimental; checked and portable formats can change between versions.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>On this page</strong><a href="#build">Build the tools</a><a href="#write">Write a module</a><a href="#check">Check and run</a><a href="#native">Native output</a><a href="#next">Continue learning</a></aside><div class="article-body">
|
||||
<section id="build"><p class="eyebrow">01 / Prepare</p><h2>Build the tools</h2><p>Clone Ziran and build the tools. You need a C compiler and <code>make</code>. Go is needed only to run generated Go output. <code>ziran version</code> prints the version you built; the latest release is <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p><pre><code>git clone https://github.com/ziranlang/ziran.git
|
||||
<section id="build"><p class="eyebrow">01 / Prepare</p><h2>Build the tools</h2><p>Clone Ziran and build the tools. You need a C compiler and <code>make</code>. Go is needed only to run generated Go output. <code>ziran version</code> prints the version you built; the latest release is <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p><pre><code>git clone https://github.com/ziranlang/ziran.git
|
||||
cd ziran
|
||||
make
|
||||
make install-user</code></pre><p>Add <code>~/.local/bin</code> to your <code>PATH</code>. The commands below use the installed tools.</p></section>
|
||||
|
||||
+10
-6
@@ -1654,11 +1654,12 @@ runs an Emscripten <code>.js</code> such as <code>node</code>, or <code>WASI_RUN
|
||||
standalone <code>.wasm</code> such as <code>wasmtime run</code>, with <code>EMCC</code> for WebAssembly) to
|
||||
compare every kernel with the scalar loops and those with std/image.
|
||||
<code>std/png_linux.zi</code> reads every standard PNG into an <code>Image</code> and writes RGBA,
|
||||
RGB and palette files; <code>std/jpeg.zi</code> writes baseline JPEGs at an IJG quality;
|
||||
<code>std/zlib_linux.zi</code> compresses and decompresses whole zlib, gzip or raw
|
||||
deflate streams into growing vectors. The PNG and zlib modules link <code>-lz</code>.
|
||||
Run <code>sh tests/std_image_linux.sh build/bin/ziran</code>, which also compares with
|
||||
Pillow when it is installed.
|
||||
RGB and palette files; <code>std/jpeg.zi</code> reads baseline and progressive JPEGs into
|
||||
an <code>Image</code> (<code>ReadJPEG</code>) and writes baseline JPEGs at an IJG quality
|
||||
(<code>WriteJPEG</code>); <code>std/zlib_linux.zi</code> compresses and decompresses whole zlib,
|
||||
gzip or raw deflate streams into growing vectors. The PNG writer and zlib
|
||||
modules link <code>-lz</code>. Run <code>sh tests/std_image_linux.sh build/bin/ziran</code>, which
|
||||
also compares with Pillow when it is installed.
|
||||
<code>std/vorbis.zi</code> reads what an Ogg Vorbis stream in memory declares without
|
||||
decoding it: <code>VorbisProbe(bytes, *audio)</code> checks that the bytes are whole
|
||||
pages of one stream with a Vorbis identification header and gives its
|
||||
@@ -1758,7 +1759,10 @@ values with exact arithmetic, including subnormals, signed zeros, infinities
|
||||
and NaN, so native targets and portable bundles agree without reinterpreting
|
||||
memory. Run <code>sh tests/std_binary.sh build/bin/ziran</code>, which also compares the
|
||||
decoding with the C compiler's over a million random patterns.
|
||||
<code>std/binary_linux.zi</code> keeps 64-bit fields for native Linux programs.</p>
|
||||
<code>std/binary_linux.zi</code> keeps 64-bit fields for native Linux programs.
|
||||
<code>std/base64.zi</code> encodes and decodes RFC 4648 base64 (<code>Base64EncodeInto</code>,
|
||||
<code>Base64Encode</code>, <code>Base64DecodeInto</code>, <code>Base64Decode</code>) for <code>data:</code> URIs and binary
|
||||
payloads; run <code>sh tests/std_base64.sh build/bin/ziran</code>.</p>
|
||||
<h3 id="constant-tables">Constant tables</h3>
|
||||
<p>A constant array of numbers or booleans is a read-only table:
|
||||
<code>COS :: s32.[4096, 4095, 4091]</code> or <code>#run s32.[...]</code>, of any length and over
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@
|
||||
<p class="hero-lead">One readable language with native, C, Go, portable <code>.zx</code> bundles, and WebAssembly. Inspect the ZIR and follow your source all the way through.</p>
|
||||
<div class="actions"><a class="btn btn-primary" href="get-started.html">Get started <span aria-hidden="true">→</span></a><a class="btn" href="targets.html">Explore the target matrix <span aria-hidden="true">↗</span></a></div>
|
||||
<ul class="hero-points"><li>Readable source</li><li>Build-time laws</li><li><a href="modules.html">Standard library</a></li></ul>
|
||||
<p class="hero-note">Latest release: <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>. Build from source today. <a href="status.html">See current support</a>.</p>
|
||||
<p class="hero-note">Latest release: <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>. Build from source today. <a href="status.html">See current support</a>.</p>
|
||||
</div>
|
||||
<div class="hero-visual">
|
||||
<div class="visual-caption"><span>Try Ziran in your browser</span><span>Edit an example, then press Run.</span></div>
|
||||
@@ -130,7 +130,7 @@ build/bin/ziran version</code></pre><a class="btn btn-primary" href="get-started
|
||||
|
||||
<section class="status-callout modules-callout" aria-labelledby="modules-title">
|
||||
<div><p class="eyebrow">Libraries</p><h2 id="modules-title">Modules and <em>packages.</em></h2></div>
|
||||
<div><p><!-- generated:module_counts -->126 standard modules and 17 packages<!-- /generated:module_counts -->, each with an API reference generated from its source, from text and JSON to image codecs.</p><a class="btn" href="modules.html">Browse all modules →</a></div>
|
||||
<div><p><!-- generated:module_counts -->127 standard modules and 17 packages<!-- /generated:module_counts -->, each with an API reference generated from its source, from text and JSON to image codecs.</p><a class="btn" href="modules.html">Browse all modules →</a></div>
|
||||
</section>
|
||||
<section class="status-callout">
|
||||
<div><p class="eyebrow"><span class="status-dot" aria-hidden="true"></span>Project status</p><h2>Working core.<br><em>Experimental edges.</em></h2></div>
|
||||
|
||||
+23
-22
@@ -1,27 +1,28 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Every Ziran standard module and package: 126 std modules and 17 packages with API references generated from the source."><title>Ziran modules and packages</title><link rel="canonical" href="https://ziran-lang.org/modules"><link rel="icon" href="assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="styles.css"><script defer src="site.js"></script></head>
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Every Ziran standard module and package: 127 std modules and 17 packages with API references generated from the source."><title>Ziran modules and packages</title><link rel="canonical" href="https://ziran-lang.org/modules"><link rel="icon" href="assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="styles.css"><script defer src="site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="index.html"><img class="brand-icon" src="assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="get-started.html">Get started</a><a href="examples.html">Examples</a><a href="targets.html">Targets</a><a href="modules.html" aria-current="page">Modules</a><a href="docs.html">Docs</a><a href="status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Reference / Modules</p><h1>Modules and <em>packages.</em></h1><p>126 standard modules and 17 packages, listed from the source on every site build. Each page shows the public declarations <code>ziran api</code> reports, with the comment written above them.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> ships in the latest release, <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a> (for a package: it has a tagged release). <span class="status-badge is-in-progress">In progress</span> exists only on <code>master</code> or has no release yet.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Reference / Modules</p><h1>Modules and <em>packages.</em></h1><p>127 standard modules and 17 packages, listed from the source on every site build. Each page shows the public declarations <code>ziran api</code> reports, with the comment written above them.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> ships in the latest release, <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a> (for a package: it has a tagged release). <span class="status-badge is-in-progress">In progress</span> exists only on <code>master</code> or has no release yet.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Sections</strong><a href="#std">Standard library</a><a href="#packages">Packages</a></aside><div class="article-body">
|
||||
<section id="std"><h2>Standard library</h2><p>Import a module with <code>#import "std/NAME"</code>. Modules ending in <code>_linux</code>, <code>_windows</code> or <code>_go</code> build only for that target. A module that needs a host capability runs in a portable bundle only when the program hosting the bundle binds it. 108 of 126 modules shipped in the latest release.</p><div class="table-scroll"><table class="module-table"><thead><tr><th scope="col">Module</th><th scope="col">Summary</th><th scope="col">Needs</th><th scope="col">Status</th></tr></thead><tbody>
|
||||
<section id="std"><h2>Standard library</h2><p>Import a module with <code>#import "std/NAME"</code>. Modules ending in <code>_linux</code>, <code>_windows</code> or <code>_go</code> build only for that target. A module that needs a host capability runs in a portable bundle only when the program hosting the bundle binds it. 127 of 127 modules shipped in the latest release.</p><div class="table-scroll"><table class="module-table"><thead><tr><th scope="col">Module</th><th scope="col">Summary</th><th scope="col">Needs</th><th scope="col">Status</th></tr></thead><tbody>
|
||||
<tr><th scope="row"><a href="std/atomic_go.html">atomic_go</a></th><td>Go unsigned 64-bit atomic counters.</td><td>Go target</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio.html">audio</a></th><td>Audio mixer: voices of decoded or streamed sound, each with its own gain, pitch and loop, mixed into interleaved float32 stereo at 48 kHz, with a tap that sees every mixed block.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_aaudio.html">audio_android_aaudio</a></th><td>AAudio is loaded at runtime so an API-21 app still loads on API 21-25.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_buffer.html">audio_android_buffer</a></th><td>Shared Android mixer boundary.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_opensl.html">audio_android_opensl</a></th><td>API-21 PCM output.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_mp3.html">audio_decode_mp3</a></th><td>MPEG audio for std/audio: MP3 (MPEG-1, 2 and 2.5 Layer III) and Layers I and II, decoded as it plays by std/audio_mp3 over dr_mp3 at the stream's own rate.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_vorbis.html">audio_decode_vorbis</a></th><td>Register the existing guarded libvorbisfile decoder with std/audio.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_wav.html">audio_decode_wav</a></th><td>RIFF WAVE for std/audio, PCM16, float32 and IMA/MS ADPCM, decoded by std/audio_wav.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_device.html">audio_device</a></th><td>Caller-owned asynchronous device open.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_mp3.html">audio_mp3</a></th><td>MP3 decoding: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III, mono and stereo, through dr_mp3 (the pinned `dr_libs` source dependency, compiled by native/ziran_mp3.c into libziran_mp3.a).</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_mpeg.html">audio_mpeg</a></th><td>Portable MPEG audio stream inspection for MP3 files: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink.html">audio_sink</a></th><td>Import the output device for the compilation target.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_android.html">audio_sink_android</a></th><td>Android's output device for the shared audio mixer.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_sdl.html">audio_sink_sdl</a></th><td>Desktop audio output for std/audio: SDL2 opens the default output for 48 kHz float32 stereo, converting to what the device takes, and its audio thread pulls each block from the mixer.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_web.html">audio_sink_web</a></th><td>WebAudio output for std/audio.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_types.html">audio_types</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_wav.html">audio_wav</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio.html">audio</a></th><td>Audio mixer: voices of decoded or streamed sound, each with its own gain, pitch and loop, mixed into interleaved float32 stereo at 48 kHz, with a tap that sees every mixed block.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_aaudio.html">audio_android_aaudio</a></th><td>AAudio is loaded at runtime so an API-21 app still loads on API 21-25.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_buffer.html">audio_android_buffer</a></th><td>Shared Android mixer boundary.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_android_opensl.html">audio_android_opensl</a></th><td>API-21 PCM output.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_mp3.html">audio_decode_mp3</a></th><td>MPEG audio for std/audio: MP3 (MPEG-1, 2 and 2.5 Layer III) and Layers I and II, decoded as it plays by std/audio_mp3 over dr_mp3 at the stream's own rate.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_vorbis.html">audio_decode_vorbis</a></th><td>Register the existing guarded libvorbisfile decoder with std/audio.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_decode_wav.html">audio_decode_wav</a></th><td>RIFF WAVE for std/audio, PCM16, float32 and IMA/MS ADPCM, decoded by std/audio_wav.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_device.html">audio_device</a></th><td>Caller-owned asynchronous device open.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_mp3.html">audio_mp3</a></th><td>MP3 decoding: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III, mono and stereo, through dr_mp3 (the pinned `dr_libs` source dependency, compiled by native/ziran_mp3.c into libziran_mp3.a).</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_mpeg.html">audio_mpeg</a></th><td>Portable MPEG audio stream inspection for MP3 files: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink.html">audio_sink</a></th><td>Import the output device for the compilation target.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_android.html">audio_sink_android</a></th><td>Android's output device for the shared audio mixer.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_sdl.html">audio_sink_sdl</a></th><td>Desktop audio output for std/audio: SDL2 opens the default output for 48 kHz float32 stereo, converting to what the device takes, and its audio thread pulls each block from the mixer.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_sink_web.html">audio_sink_web</a></th><td>WebAudio output for std/audio.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_types.html">audio_types</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/audio_wav.html">audio_wav</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/base64.html">base64</a></th><td>RFC 4648 base64 encoding and decoding on every target, for data: URIs, embedded binary payloads and wire protocols.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/binary.html">binary</a></th><td>Little-endian numbers in byte text, such as file or asset contents, read the same way on every native target and in the engine.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/binary_linux.html">binary_linux</a></th><td>Little-endian binary fields for native Linux programs.</td><td>Native Linux</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/bundle_host.html">bundle_host</a></th><td>Native C ABI for embedding a portable Ziran bundle.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
@@ -46,7 +47,7 @@
|
||||
<tr><th scope="row"><a href="std/file_linux.html">file_linux</a></th><td><span class=muted>No module description yet.</span></td><td>Native Linux</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/file_tree.html">file_tree</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/file_tree_linux.html">file_tree_linux</a></th><td>Paths, folders and whole files for native Linux tools and build programs: what a build script needs beyond file_linux's positional I/O.</td><td>Native Linux</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/finite.html">finite</a></th><td>Whether a float is finite: false for NaN and either infinity.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/finite.html">finite</a></th><td>Whether a float is finite: false for NaN and either infinity.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/float_text.html">float_text</a></th><td>Locale-independent IEEE 754 binary64 decimal conversion, entirely in Ziran.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/format.html">format</a></th><td>Text built on an owned Vec(u8) builder.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/go_types.html">go_types</a></th><td>Predeclared Go interface types at the foreign-library boundary.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
@@ -59,7 +60,7 @@
|
||||
<tr><th scope="row"><a href="std/http_go.html">http_go</a></th><td>Go HTTP requests, response writers and headers retain their native types and behavior.</td><td>Go target</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/image.html">image</a></th><td>RGBA pictures in memory and what build tools do with them: resize, composite, paste, rotate and reduce to a palette.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/io_go.html">io_go</a></th><td>Native Go stream interfaces retain resource ownership and error identity.</td><td>Go target</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/jpeg.html">jpeg</a></th><td>Baseline JPEG files from std/image pictures, on every target: JFIF with 4:2:0 chroma subsampling, the standard Huffman tables and the IJG quality scale that libjpeg and Pillow use.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/jpeg.html">jpeg</a></th><td>Baseline and progressive JPEG files to and from std/image pictures, on every target: JFIF writing with 4:2:0 chroma subsampling, standard Huffman tables and the IJG quality scale that libjpeg and Pillow use; reading accepts baseline (SOF0/SOF1) and progressive (SOF2) greyscale and YCbCr JPEGs.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/json_bytes.html">json_bytes</a></th><td>Shared, allocation-free JSON string scanning.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/json_document.html">json_document</a></th><td>JSON documents read into a tree that programs query, change and write back.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/json_go.html">json_go</a></th><td>Go JSON serialization keeps native error values, field tags and byte storage.</td><td>Go target</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
@@ -76,7 +77,7 @@
|
||||
<tr><th scope="row"><a href="std/net_http_linux.html">net_http_linux</a></th><td><span class=muted>No module description yet.</span></td><td>Native Linux</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/net_ws_curl_linux.html">net_ws_curl_linux</a></th><td>Blocking, bounded WebSocket text receive for native libcurl hosts.</td><td>Native Linux</td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/number_text.html">number_text</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/ogg.html">ogg</a></th><td>Portable Ogg container validation and bounded packet/page construction.</td><td><span class=muted>—</span></td><td><span class="status-badge is-in-progress">In progress</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/ogg.html">ogg</a></th><td>Portable Ogg container validation and bounded packet/page construction.</td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/option.html">option</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/pair.html">pair</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
<tr><th scope="row"><a href="std/parallel.html">parallel</a></th><td><span class=muted>No module description yet.</span></td><td><span class=muted>—</span></td><td><span class="status-badge is-stable">Stable</span></td></tr>
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
<url><loc>https://ziran-lang.org/std/audio_sink_web</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/audio_types</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/audio_wav</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/base64</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/binary</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/binary_linux</loc></url>
|
||||
<url><loc>https://ziran-lang.org/std/bundle_host</loc></url>
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="An honest overview of current Ziran language, compiler, backend, and portable runtime coverage and what remains unfinished."><title>Ziran status — What works today</title><link rel="canonical" href="https://ziran-lang.org/status"><link rel="icon" href="assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="styles.css"><script defer src="site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="index.html"><img class="brand-icon" src="assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="get-started.html">Get started</a><a href="examples.html">Examples</a><a href="targets.html">Targets</a><a href="modules.html">Modules</a><a href="docs.html">Docs</a><a href="status.html" aria-current="page">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Status / v0.6.0 and Unreleased</p><h1>Current Ziran support.</h1><p>Query <code>ziran version</code>, <code>ziran features --json</code> and <code>ziran capabilities --json</code> for the compiler you use.</p></div><section class="prose"><h2>Compiler pipeline</h2><p>Source → ZIR → LIR → optimized LIR → ZX → native (ELF/PE, x86-64/AArch64/ARMv7). WebAssembly lowers from verified ZX. C and Go export from ZIR through <code>zi2c</code> and <code>zi2go</code>.</p><p><code>ziran build FILE.zi</code> defaults to native output. Select <code>--target=c</code>, <code>go</code>, <code>wasm</code> or <code>zx</code> for another output. Linux x86-64, AArch64 and ARMv7 run ZX natively; unsupported operations report a named gap.</p><h2>Safety</h2><p>Safety is manual by default, as in C. <code>--checks</code> opts into build-wide runtime checks; <code>#checks</code> keeps selected bounds checks. The instruction engine always checks. See <a href="guide/usage.html#checks">checks</a> for coverage.</p><h2>Learning</h2><p>Native builds record a local corpus by default. <code>ziran learn off</code> stops recording. C-teacher verification and policy training run offline; benchmarks run with learning off. See <a href="guide/zx.html#learning">learning</a>.</p><h2>References</h2><p>The <a href="guide/implementation-status.html">current support reference</a>, <a href="modules.html">module APIs</a>, <a href="targets.html">target matrix</a> and <a href="examples.html">examples</a> describe the supported subsets. A checked program can still require an operation unavailable on a selected backend.</p><p>The latest release is <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">0.6.0</a>. Master includes Unreleased work.</p></section></main><footer><div class="footer-top"><a class="brand" href="index.html"><img class="brand-icon" src="assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><nav aria-label="Footer"><a href="get-started.html">Get started</a><a href="examples.html">Examples</a><a href="targets.html">Targets</a><a href="modules.html">Modules</a><a href="docs.html">Docs</a><a href="status.html">Status</a><a href="index.html#support">Support</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a></nav></div><div class="footer-bottom"><p>A language for useful software.</p><p>© 2026 Kryon Labs · <a href="https://waozi.xyz/">Made by Waozi</a></p></div></footer></body></html>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow">Status / v0.7.0 and Unreleased</p><h1>Current Ziran support.</h1><p>Query <code>ziran version</code>, <code>ziran features --json</code> and <code>ziran capabilities --json</code> for the compiler you use.</p></div><section class="prose"><h2>Compiler pipeline</h2><p>Source → ZIR → LIR → optimized LIR → ZX → native (ELF/PE, x86-64/AArch64/ARMv7). WebAssembly lowers from verified ZX. C and Go export from ZIR through <code>zi2c</code> and <code>zi2go</code>.</p><p><code>ziran build FILE.zi</code> defaults to native output. Select <code>--target=c</code>, <code>go</code>, <code>wasm</code> or <code>zx</code> for another output. Linux x86-64, AArch64 and ARMv7 run ZX natively; unsupported operations report a named gap.</p><h2>Safety</h2><p>Safety is manual by default, as in C. <code>--checks</code> opts into build-wide runtime checks; <code>#checks</code> keeps selected bounds checks. The instruction engine always checks. See <a href="guide/usage.html#checks">checks</a> for coverage.</p><h2>Learning</h2><p>Native builds record a local corpus by default. <code>ziran learn off</code> stops recording. C-teacher verification and policy training run offline; benchmarks run with learning off. See <a href="guide/zx.html#learning">learning</a>.</p><h2>References</h2><p>The <a href="guide/implementation-status.html">current support reference</a>, <a href="modules.html">module APIs</a>, <a href="targets.html">target matrix</a> and <a href="examples.html">examples</a> describe the supported subsets. A checked program can still require an operation unavailable on a selected backend.</p><p>The latest release is <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">0.6.0</a>. Master includes Unreleased work.</p></section></main><footer><div class="footer-top"><a class="brand" href="index.html"><img class="brand-icon" src="assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><nav aria-label="Footer"><a href="get-started.html">Get started</a><a href="examples.html">Examples</a><a href="targets.html">Targets</a><a href="modules.html">Modules</a><a href="docs.html">Docs</a><a href="status.html">Status</a><a href="index.html#support">Support</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a></nav></div><div class="footer-bottom"><p>A language for useful software.</p><p>© 2026 Kryon Labs · <a href="https://waozi.xyz/">Made by Waozi</a></p></div></footer></body></html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Go unsigned 64-bit atomic counters."><title>std/atomic_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/atomic_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/atomic_go</h1><p>Go unsigned 64-bit atomic counters. Keep counters in shared storage and pass their addresses.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/atomic_go</h1><p>Go unsigned 64-bit atomic counters. Keep counters in shared storage and pass their addresses.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Uint64">Uint64</a><a href="#Add">Add</a><a href="#Load">Load</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/atomic_go"</code>.</p><div class="api-list">
|
||||
<div id="Uint64"><code>Uint64 :: struct</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Audio mixer: voices of decoded or streamed sound, each with its own gain, pitch and loop, mixed into interleaved float32 stereo at 48 kHz, with a tap that sees every mixed block."><title>std/audio · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio</h1><p>Audio mixer: voices of decoded or streamed sound, each with its own gain, pitch and loop, mixed into interleaved float32 stereo at 48 kHz, with a tap that sees every mixed block. It owns no device: a sink (std/audio_sink) asks it for blocks from its audio thread, and a test can render into a buffer of its own. Decoders join through AudioUseDecoder (std/audio_decode_wav, std/audio_decode_mp3); each recognizes its content, never a file name. A sound loads decoded whole; music decodes while it plays. A PCM stream plays signed 16-bit blocks the program submits and never finishes: it plays silence until the next block. Every call here belongs to the application thread; while a sink runs, each holds the sink's lock, so the audio thread sees a voice either before or after a change.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio</h1><p>Audio mixer: voices of decoded or streamed sound, each with its own gain, pitch and loop, mixed into interleaved float32 stereo at 48 kHz, with a tap that sees every mixed block. It owns no device: a sink (std/audio_sink) asks it for blocks from its audio thread, and a test can render into a buffer of its own. Decoders join through AudioUseDecoder (std/audio_decode_wav, std/audio_decode_mp3); each recognizes its content, never a file name. A sound loads decoded whole; music decodes while it plays. A PCM stream plays signed 16-bit blocks the program submits and never finishes: it plays silence until the next block. Every call here belongs to the application thread; while a sink runs, each holds the sink's lock, so the audio thread sees a voice either before or after a change.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#AUDIO_RATE">AUDIO_RATE</a><a href="#AUDIO_VOICES">AUDIO_VOICES</a><a href="#AudioSource">AudioSource</a><a href="#AudioSourceRead">AudioSourceRead</a><a href="#AudioSourceRewind">AudioSourceRewind</a><a href="#AudioSourceClose">AudioSourceClose</a><a href="#AudioSourceSeek">AudioSourceSeek</a><a href="#AudioDecoderProbe">AudioDecoderProbe</a><a href="#AudioDecoderOpen">AudioDecoderOpen</a><a href="#AudioTap">AudioTap</a><a href="#AudioLockCall">AudioLockCall</a><a href="#AudioVoiceState">AudioVoiceState</a><a href="#AudioVoice">AudioVoice</a><a href="#AudioDecodedSource">AudioDecodedSource</a><a href="#AudioUseDecoder">AudioUseDecoder</a><a href="#AudioUseLock">AudioUseLock</a><a href="#AudioUseTap">AudioUseTap</a><a href="#AudioSetMasterGain">AudioSetMasterGain</a><a href="#AudioRender">AudioRender</a><a href="#AudioLoad">AudioLoad</a><a href="#AudioLoadFile">AudioLoadFile</a><a href="#AudioOpenStream">AudioOpenStream</a><a href="#AudioStreamWritable">AudioStreamWritable</a><a href="#AudioStreamSubmit">AudioStreamSubmit</a><a href="#AudioPlay">AudioPlay</a><a href="#AudioStop">AudioStop</a><a href="#AudioPause">AudioPause</a><a href="#AudioResume">AudioResume</a><a href="#AudioState">AudioState</a><a href="#AudioPlaying">AudioPlaying</a><a href="#AudioSetGain">AudioSetGain</a><a href="#AudioSetPitch">AudioSetPitch</a><a href="#AudioSetLooping">AudioSetLooping</a><a href="#AudioSeek">AudioSeek</a><a href="#AudioPosition">AudioPosition</a><a href="#AudioLength">AudioLength</a><a href="#AudioUnload">AudioUnload</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio"</code>.</p><div class="api-list">
|
||||
<div id="AUDIO_RATE"><code>AUDIO_RATE :: 48000</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="AAudio is loaded at runtime so an API-21 app still loads on API 21-25."><title>std/audio_android_aaudio · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_android_aaudio"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_aaudio</h1><p>AAudio is loaded at runtime so an API-21 app still loads on API 21-25. All entry points below were introduced in API 26. No AAudio link is needed.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_aaudio</h1><p>AAudio is loaded at runtime so an API-21 app still loads on API 21-25. All entry points below were introduced in API 26. No AAudio link is needed.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Available">Available</a><a href="#Ready">Ready</a><a href="#Close">Close</a><a href="#Open">Open</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_android_aaudio"</code>.</p><div class="api-list">
|
||||
<div id="Available"><code>Available :: () -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Shared Android mixer boundary."><title>std/audio_android_buffer · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_android_buffer"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_buffer</h1><p>Shared Android mixer boundary. Bionic pthread_mutex_t fits this aligned storage on all Android ABIs; its static zero initializer is PTHREAD_MUTEX_INITIALIZER. The lock outlives devices, so voices remain safe after close and reopen.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_buffer</h1><p>Shared Android mixer boundary. Bionic pthread_mutex_t fits this aligned storage on all Android ABIs; its static zero initializer is PTHREAD_MUTEX_INITIALIZER. The lock outlives devices, so voices remain safe after close and reopen.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Enter">Enter</a><a href="#Leave">Leave</a><a href="#Install">Install</a><a href="#Library">Library</a><a href="#Resolve">Resolve</a><a href="#RenderFloat">RenderFloat</a><a href="#RenderPCM">RenderPCM</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_android_buffer"</code>.</p><div class="api-list">
|
||||
<div id="Enter"><code>Enter :: ()</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API-21 PCM output."><title>std/audio_android_opensl · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_android_opensl"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_opensl</h1><p>API-21 PCM output. Android's simple buffer queue owns two alternating signed-16 stereo blocks. Only the completed block is refilled.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_android_opensl</h1><p>API-21 PCM output. Android's simple buffer queue owns two alternating signed-16 stereo blocks. Only the completed block is refilled.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Ready">Ready</a><a href="#Close">Close</a><a href="#Open">Open</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_android_opensl"</code>.</p><div class="api-list">
|
||||
<div id="Ready"><code>Ready :: () -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="MPEG audio for std/audio: MP3 (MPEG-1, 2 and 2.5 Layer III) and Layers I and II, decoded as it plays by std/audio_mp3 over dr_mp3 at the stream's own rate."><title>std/audio_decode_mp3 · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_decode_mp3"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_mp3</h1><p>MPEG audio for std/audio: MP3 (MPEG-1, 2 and 2.5 Layer III) and Layers I and II, decoded as it plays by std/audio_mp3 over dr_mp3 at the stream's own rate. Importing this module is what adds the format; native programs link audio's libziran_mp3.a (make's $(MP3_A)) and -lm.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_mp3</h1><p>MPEG audio for std/audio: MP3 (MPEG-1, 2 and 2.5 Layer III) and Layers I and II, decoded as it plays by std/audio_mp3 over dr_mp3 at the stream's own rate. Importing this module is what adds the format; native programs link audio's libziran_mp3.a (make's $(MP3_A)) and -lm.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_decode_mp3"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/audio_decode_mp3.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Register the existing guarded libvorbisfile decoder with std/audio."><title>std/audio_decode_vorbis · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_decode_vorbis"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_vorbis</h1><p>Register the existing guarded libvorbisfile decoder with std/audio.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_vorbis</h1><p>Register the existing guarded libvorbisfile decoder with std/audio.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_decode_vorbis"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/audio_decode_vorbis.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="RIFF WAVE for std/audio, PCM16, float32 and IMA/MS ADPCM, decoded by std/audio_wav."><title>std/audio_decode_wav · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_decode_wav"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_wav</h1><p>RIFF WAVE for std/audio, PCM16, float32 and IMA/MS ADPCM, decoded by std/audio_wav. Importing this module is what adds the format.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_decode_wav</h1><p>RIFF WAVE for std/audio, PCM16, float32 and IMA/MS ADPCM, decoded by std/audio_wav. Importing this module is what adds the format.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_decode_wav"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/audio_decode_wav.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Caller-owned asynchronous device open."><title>std/audio_device · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_device"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_device</h1><p>Caller-owned asynchronous device open. Only the application thread touches this record; the worker publishes its result through ThreadFinished.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_device</h1><p>Caller-owned asynchronous device open. Only the application thread touches this record; the worker publishes its result through ThreadFinished.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#OpenCall">OpenCall</a><a href="#CloseCall">CloseCall</a><a href="#Device">Device</a><a href="#Poll">Poll</a><a href="#Pending">Pending</a><a href="#Unavailable">Unavailable</a><a href="#Ready">Ready</a><a href="#Open">Open</a><a href="#Close">Close</a><a href="#Invalidate">Invalidate</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_device"</code>.</p><div class="api-list">
|
||||
<div id="OpenCall"><code>OpenCall :: #type () -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="MP3 decoding: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III, mono and stereo, through dr_mp3 (the pinned `dr_libs` source dependency, compiled by native/ziran_mp3.c into libziran_mp3.a)."><title>std/audio_mp3 · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_mp3"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_mp3</h1><p>MP3 decoding: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III, mono and stereo, through dr_mp3 (the pinned `dr_libs` source dependency, compiled by native/ziran_mp3.c into libziran_mp3.a). Native C only: link `libziran_mp3.a -lm`. std/audio_mpeg validates every frame first, so dr_mp3 only sees a complete frame stream with its tags removed.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_mp3</h1><p>MP3 decoding: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III, mono and stereo, through dr_mp3 (the pinned `dr_libs` source dependency, compiled by native/ziran_mp3.c into libziran_mp3.a). Native C only: link `libziran_mp3.a -lm`. std/audio_mpeg validates every frame first, so dr_mp3 only sees a complete frame stream with its tags removed.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Mp3Decoder">Mp3Decoder</a><a href="#Mp3DecoderClose">Mp3DecoderClose</a><a href="#Mp3DecoderOpen">Mp3DecoderOpen</a><a href="#Mp3DecoderOpenFile">Mp3DecoderOpenFile</a><a href="#Mp3DecoderRead">Mp3DecoderRead</a><a href="#Mp3DecoderReadS16">Mp3DecoderReadS16</a><a href="#Mp3DecoderSeek">Mp3DecoderSeek</a><a href="#Mp3DecoderRewind">Mp3DecoderRewind</a><a href="#Mp3Decode">Mp3Decode</a><a href="#Mp3DecodeS16">Mp3DecodeS16</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_mp3"</code>.</p><div class="api-list">
|
||||
<div id="Mp3Decoder"><code>Mp3Decoder :: struct { handle: *void; info: Mp3Info; position: s64; owned: Vec(u8); }</code><p>Single-owner native state over borrowed bytes (or bytes it read itself with Mp3DecoderOpenFile). Do not copy a live decoder or call it concurrently; keep borrowed input alive and unchanged until close.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Portable MPEG audio stream inspection for MP3 files: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III."><title>std/audio_mpeg · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_mpeg"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_mpeg</h1><p>Portable MPEG audio stream inspection for MP3 files: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III. It skips ID3v2, ID3v1 and APEv2 tags, reads Xing/Info, VBRI and LAME gapless headers, and walks every frame header, so the exact duration and truncation are known without a codec library. std/audio_mp3 decodes the bytes this module accepts.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_mpeg</h1><p>Portable MPEG audio stream inspection for MP3 files: MPEG-1, MPEG-2 and MPEG-2.5, Layers I, II and III. It skips ID3v2, ID3v1 and APEv2 tags, reads Xing/Info, VBRI and LAME gapless headers, and walks every frame header, so the exact duration and truncation are known without a codec library. std/audio_mp3 decodes the bytes this module accepts.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Mp3Info">Mp3Info</a><a href="#Mp3Header">Mp3Header</a><a href="#Mp3MaxStreamFrames">Mp3MaxStreamFrames</a><a href="#Mp3ParseHeader">Mp3ParseHeader</a><a href="#Mp3Inspect">Mp3Inspect</a><a href="#Mp3Seconds">Mp3Seconds</a><a href="#Mp3PrintInfo">Mp3PrintInfo</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_mpeg"</code>.</p><div class="api-list">
|
||||
<div id="Mp3Info"><code>Mp3Info :: struct { version: s32; layer: s32; channels: s32; rate: s32; frames: s64; mp3_frames: s64; frame_samples: s32; delay: s32; padding: s32; bitrate: s32; vbr: bool; audio_at: s64; audio_end: s64; }</code><p>`frames` is the exact PCM frame count a decoder returns: a Xing/Info frame count (or the walked frames) times the frame length, minus the LAME encoder delay and padding. Bitrate is nominal for CBR, the average for VBR.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Import the output device for the compilation target."><title>std/audio_sink · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_sink"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink</h1><p>Import the output device for the compilation target. PCM voices and mixing live in std/audio and can also be rendered without opening a device.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink</h1><p>Import the output device for the compilation target. PCM voices and mixing live in std/audio and can also be rendered without opening a device.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_sink"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/audio_sink.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Android's output device for the shared audio mixer."><title>std/audio_sink_android · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_sink_android"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_android</h1><p>Android's output device for the shared audio mixer. The API-21 scaffold needs OpenSL ES on Android 5/6/7; devices with AAudio use float32 output. Public contract matches audio_sink_sdl. Call open/close on the application thread.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_android</h1><p>Android's output device for the shared audio mixer. The API-21 scaffold needs OpenSL ES on Android 5/6/7; devices with AAudio use float32 output. Public contract matches audio_sink_sdl. Call open/close on the application thread.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#AudioSinkOpen">AudioSinkOpen</a><a href="#AudioSinkReady">AudioSinkReady</a><a href="#AudioSinkPending">AudioSinkPending</a><a href="#AudioSinkUnavailable">AudioSinkUnavailable</a><a href="#AudioSinkClose">AudioSinkClose</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_sink_android"</code>.</p><div class="api-list">
|
||||
<div id="AudioSinkOpen"><code>AudioSinkOpen :: () -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Desktop audio output for std/audio: SDL2 opens the default output for 48 kHz float32 stereo, converting to what the device takes, and its audio thread pulls each block from the mixer."><title>std/audio_sink_sdl · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_sink_sdl"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_sdl</h1><p>Desktop audio output for std/audio: SDL2 opens the default output for 48 kHz float32 stereo, converting to what the device takes, and its audio thread pulls each block from the mixer. It needs no window. With SDL_AUDIODRIVER=disk SDL writes the blocks to SDL_DISKAUDIOFILE instead, so a test hears exactly what was mixed without a device.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_sdl</h1><p>Desktop audio output for std/audio: SDL2 opens the default output for 48 kHz float32 stereo, converting to what the device takes, and its audio thread pulls each block from the mixer. It needs no window. With SDL_AUDIODRIVER=disk SDL writes the blocks to SDL_DISKAUDIOFILE instead, so a test hears exactly what was mixed without a device.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#AudioSinkOpen">AudioSinkOpen</a><a href="#AudioSinkReady">AudioSinkReady</a><a href="#AudioSinkPending">AudioSinkPending</a><a href="#AudioSinkUnavailable">AudioSinkUnavailable</a><a href="#AudioSinkClose">AudioSinkClose</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_sink_sdl"</code>.</p><div class="api-list">
|
||||
<div id="AudioSinkOpen"><code>AudioSinkOpen :: () -> bool</code><p>Requests a background open; false while pending or unavailable. Retry is throttled for one second after failure. Ready/Pending/Unavailable poll it.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="WebAudio output for std/audio."><title>std/audio_sink_web · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_sink_web"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_web</h1><p>WebAudio output for std/audio. A short timer schedules two immutable PCM buffers ahead of the audio clock; suspended contexts do not consume voices. The application calls AudioSinkResume from a trusted gesture when required.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_sink_web</h1><p>WebAudio output for std/audio. A short timer schedules two immutable PCM buffers ahead of the audio clock; suspended contexts do not consume voices. The application calls AudioSinkResume from a trusted gesture when required.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#AudioSinkReady">AudioSinkReady</a><a href="#AudioSinkPending">AudioSinkPending</a><a href="#AudioSinkUnavailable">AudioSinkUnavailable</a><a href="#AudioSinkRunning">AudioSinkRunning</a><a href="#AudioSinkResume">AudioSinkResume</a><a href="#AudioSinkClose">AudioSinkClose</a><a href="#AudioSinkOpen">AudioSinkOpen</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_sink_web"</code>.</p><div class="api-list">
|
||||
<div id="AudioSinkReady"><code>AudioSinkReady :: () -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/audio_types module."><title>std/audio_types · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_types"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_types</h1><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_types</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#OK">OK</a><a href="#Invalid">Invalid</a><a href="#Malformed">Malformed</a><a href="#Unsupported">Unsupported</a><a href="#LimitExceeded">LimitExceeded</a><a href="#NativeFailure">NativeFailure</a><a href="#AllocationFailed">AllocationFailed</a><a href="#IOFailure">IOFailure</a><a href="#PCM">PCM</a><a href="#MaxBytes">MaxBytes</a><a href="#MaxFrames">MaxFrames</a><a href="#ValidPCM">ValidPCM</a><a href="#ErrorText">ErrorText</a><a href="#Little">Little</a><a href="#PutLittle">PutLittle</a><a href="#Magic">Magic</a><a href="#Pcm16">Pcm16</a><a href="#SwapSamples">SwapSamples</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_types"</code>.</p><div class="api-list">
|
||||
<div id="OK"><code>OK :: 0</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/audio_wav module."><title>std/audio_wav · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/audio_wav"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_wav</h1><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/audio_wav</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#WavDecode">WavDecode</a><a href="#WavEncode">WavEncode</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/audio_wav"</code>.</p><div class="api-list">
|
||||
<div id="WavDecode"><code>WavDecode :: (input: []u8, max_frames: s64, output: *PCM) -> s32</code><p>RIFF WAVE mono/stereo: PCM16, IEEE float32, IMA ADPCM and MS ADPCM. Unknown chunks skip with padding; duplicate fmt/data and RF64 reject.</p></div>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="RFC 4648 base64 encoding and decoding on every target, for data: URIs, embedded binary payloads and wire protocols."><title>std/base64 · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/base64"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/base64</h1><p>RFC 4648 base64 encoding and decoding on every target, for data: URIs, embedded binary payloads and wire protocols. bytes: Vec(u8) if !Base64DecodeInto(encoded, *bytes) { ... } text := Base64Encode(VecSlice(bytes, 0, bytes.count))</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Base64EncodeInto">Base64EncodeInto</a><a href="#Base64Encode">Base64Encode</a><a href="#Base64DecodeInto">Base64DecodeInto</a><a href="#Base64Decode">Base64Decode</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/base64"</code>.</p><div class="api-list">
|
||||
<div id="Base64EncodeInto"><code>Base64EncodeInto :: (bytes: []u8, output: *Vec(u8))</code><p>Appends the standard padded RFC 4648 base64 encoding of BYTES to OUTPUT.</p></div>
|
||||
<div id="Base64Encode"><code>Base64Encode :: (bytes: []u8) -> Text</code><p>The standard padded RFC 4648 base64 text for BYTES.</p></div>
|
||||
<div id="Base64DecodeInto"><code>Base64DecodeInto :: (text: string, output: *Vec(u8)) -> bool</code><p>Appends the bytes decoded from TEXT to OUTPUT. Accepts standard (+/) and URL-safe (-_) alphabets and skips ASCII whitespace; refuses bad characters, truncated groups or misplaced '=' padding.</p></div>
|
||||
<div id="Base64Decode"><code>Base64Decode :: (text: string, ok: *bool) -> Text</code><p>Decodes TEXT into byte text and sets OK to whether TEXT was valid base64.</p></div>
|
||||
</div><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/base64.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
<footer><div class="footer-top"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><nav aria-label="Footer"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="../index.html#support">Support</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a></nav></div><div class="footer-bottom"><p>A language for useful software.</p><p>© 2026 Kryon Labs · <a href="https://waozi.xyz/">Made by Waozi</a></p></div></footer></body></html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Little-endian numbers in byte text, such as file or asset contents, read the same way on every native target and in the engine."><title>std/binary · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/binary"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/binary</h1><p>Little-endian numbers in byte text, such as file or asset contents, read the same way on every native target and in the engine. Floats are decoded from their IEEE 754 bits with exact arithmetic, so no target reinterprets memory. TryRead names invalid offsets; the plain Read helpers read the bytes at their offset, as in C, for layouts the caller validated.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/binary</h1><p>Little-endian numbers in byte text, such as file or asset contents, read the same way on every native target and in the engine. Floats are decoded from their IEEE 754 bits with exact arithmetic, so no target reinterprets memory. TryRead names invalid offsets; the plain Read helpers read the bytes at their offset, as in C, for layouts the caller validated.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#BinaryReadFailure">BinaryReadFailure</a><a href="#Float32FromBits">Float32FromBits</a><a href="#Float64FromBits">Float64FromBits</a><a href="#TryReadU16LE">TryReadU16LE</a><a href="#TryReadU32LE">TryReadU32LE</a><a href="#TryReadS32LE">TryReadS32LE</a><a href="#TryReadF32LE">TryReadF32LE</a><a href="#ReadU16LE">ReadU16LE</a><a href="#ReadU32LE">ReadU32LE</a><a href="#ReadS32LE">ReadS32LE</a><a href="#ReadF32LE">ReadF32LE</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/binary"</code>.</p><div class="api-list">
|
||||
<div id="BinaryReadFailure"><code>BinaryReadFailure :: enum { None = 0; NegativeOffset = 1; Misaligned = 2; ShortField = 3; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Little-endian binary fields for native Linux programs."><title>std/binary_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/binary_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/binary_linux</h1><p>Little-endian binary fields for native Linux programs. No file format or application record layout is imposed by this module.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/binary_linux</h1><p>Little-endian binary fields for native Linux programs. No file format or application record layout is imposed by this module.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ReadU64LE">ReadU64LE</a><a href="#WriteU64LE">WriteU64LE</a><a href="#ReadF64LE">ReadF64LE</a><a href="#WriteF64LE">WriteF64LE</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/binary_linux"</code>.</p><div class="api-list">
|
||||
<div id="ReadU64LE"><code>ReadU64LE :: (bytes: []u8, at: s32) -> u64</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native C ABI for embedding a portable Ziran bundle."><title>std/bundle_host · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/bundle_host"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/bundle_host</h1><p>Native C ABI for embedding a portable Ziran bundle. The runtime owns the bundle and instance; callers own binding contexts and borrowed result data.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/bundle_host</h1><p>Native C ABI for embedding a portable Ziran bundle. The runtime owns the bundle and instance; callers own binding contexts and borrowed result data.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#HostValueKind">HostValueKind</a><a href="#HostValue">HostValue</a><a href="#HostField">HostField</a><a href="#HostCall">HostCall</a><a href="#HostBinding">HostBinding</a><a href="#BundleBackendPolicy">BundleBackendPolicy</a><a href="#BundleExecutionBackend">BundleExecutionBackend</a><a href="#BundleInstanceOptions">BundleInstanceOptions</a><a href="#BundleStateValue">BundleStateValue</a><a href="#BundleStateMigrate">BundleStateMigrate</a><a href="#BundleComponentVerify">BundleComponentVerify</a><a href="#BundleCapabilityAbi">BundleCapabilityAbi</a><a href="#OpenBundle">OpenBundle</a><a href="#OpenBundleBytes">OpenBundleBytes</a><a href="#CloseBundle">CloseBundle</a><a href="#BundleCapabilities">BundleCapabilities</a><a href="#BundleCapabilityModuleName">BundleCapabilityModuleName</a><a href="#BundleCapabilityFunctionName">BundleCapabilityFunctionName</a><a href="#ReadBundleCapabilityAbi">ReadBundleCapabilityAbi</a><a href="#BundlesAbiCompatible">BundlesAbiCompatible</a><a href="#BundleEntryModule">BundleEntryModule</a><a href="#BundleEntryFunction">BundleEntryFunction</a><a href="#BundleCodeDigest">BundleCodeDigest</a><a href="#BundleAssets">BundleAssets</a><a href="#BundleAssetPath">BundleAssetPath</a><a href="#BundleAssetBytes">BundleAssetBytes</a><a href="#BundleAssetLength">BundleAssetLength</a><a href="#InstantiateBundle">InstantiateBundle</a><a href="#InstantiateBundleLimited">InstantiateBundleLimited</a><a href="#InstantiateBundleWithOptions">InstantiateBundleWithOptions</a><a href="#GetBundleInstanceBackend">GetBundleInstanceBackend</a><a href="#GetBundleNativeProblem">GetBundleNativeProblem</a><a href="#RunBundleInstance">RunBundleInstance</a><a href="#CloseBundleInstance">CloseBundleInstance</a><a href="#LimitBundleSteps">LimitBundleSteps</a><a href="#MatchBundleFieldsByName">MatchBundleFieldsByName</a><a href="#ExportBundleState">ExportBundleState</a><a href="#ImportBundleState">ImportBundleState</a><a href="#BundleStateValueCount">BundleStateValueCount</a><a href="#BundleStateBytes">BundleStateBytes</a><a href="#ReadBundleStateValue">ReadBundleStateValue</a><a href="#BundleStateValueReference">BundleStateValueReference</a><a href="#FindBundleStateValue">FindBundleStateValue</a><a href="#SetBundleStateInteger">SetBundleStateInteger</a><a href="#SetBundleStateUnsigned">SetBundleStateUnsigned</a><a href="#SetBundleStateReal">SetBundleStateReal</a><a href="#SetBundleStateString">SetBundleStateString</a><a href="#CloseBundleState">CloseBundleState</a><a href="#OpenBundleComponent">OpenBundleComponent</a><a href="#AcquireBundleComponent">AcquireBundleComponent</a><a href="#BundleComponentHandleIsValid">BundleComponentHandleIsValid</a><a href="#RunBundleComponent">RunBundleComponent</a><a href="#ReplaceBundleComponent">ReplaceBundleComponent</a><a href="#BundleComponentLiveBytes">BundleComponentLiveBytes</a><a href="#CloseBundleComponent">CloseBundleComponent</a><a href="#CloseBundleComponentHandle">CloseBundleComponentHandle</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/bundle_host"</code>.</p><div class="api-list">
|
||||
<div id="HostValueKind"><code>HostValueKind :: enum { HostVoid = 0; HostInteger = 1; HostUnsigned = 2; HostReal = 3; HostString = 4; HostRecord = 5; HostSlice = 6; HostPointer = 7; HostArray = 8; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/byte_text module."><title>std/byte_text · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/byte_text"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/byte_text</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/byte_text</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/byte_text"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/byte_text.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Borrow UTF-8 bytes as a Ziran string at native foreign-function boundaries."><title>std/byte_text_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/byte_text_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/byte_text_linux</h1><p>Borrow UTF-8 bytes as a Ziran string at native foreign-function boundaries. The caller must keep the byte storage alive while the string is in use.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/byte_text_linux</h1><p>Borrow UTF-8 bytes as a Ziran string at native foreign-function boundaries. The caller must keep the byte storage alive while the string is in use.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#TextDescriptor">TextDescriptor</a><a href="#ByteDescriptor">ByteDescriptor</a><a href="#TextFromBytes">TextFromBytes</a><a href="#BytesFromPointer">BytesFromPointer</a><a href="#TextFromCString">TextFromCString</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/byte_text_linux"</code>.</p><div class="api-list">
|
||||
<div id="TextDescriptor"><code>TextDescriptor :: struct { data: *u8; length: usize; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Copies a borrowed Ziran string into caller-owned, NUL-terminated storage."><title>std/c_string · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/c_string"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/c_string</h1><p>Copies a borrowed Ziran string into caller-owned, NUL-terminated storage. Reject embedded NUL bytes and insufficient capacity before exposing the buffer to a native C API.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/c_string</h1><p>Copies a borrowed Ziran string into caller-owned, NUL-terminated storage. Reject embedded NUL bytes and insufficient capacity before exposing the buffer to a native C API.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#CopyCString">CopyCString</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/c_string"</code>.</p><div class="api-list">
|
||||
<div id="CopyCString"><code>CopyCString :: (value: string, output: []u8) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/calendar module."><title>std/calendar · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/calendar"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/calendar</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/calendar</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#LeapYear">LeapYear</a><a href="#DaysInMonth">DaysInMonth</a><a href="#DayOfWeek">DayOfWeek</a><a href="#DayOfYear">DayOfYear</a><a href="#DateTimeValid">DateTimeValid</a><a href="#FormatDateTime">FormatDateTime</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/calendar"</code>.</p><div class="api-list">
|
||||
<div id="LeapYear"><code>LeapYear :: (year: s32) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native Go channels with runtime element types."><title>std/channel_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/channel_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/channel_go</h1><p>Native Go channels with runtime element types. Keep the reflective channel value as the handle; Interface supplies its native value to select_go.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/channel_go</h1><p>Native Go channels with runtime element types. Keep the reflective channel value as the handle; Interface supplies its native value to select_go.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Channel">Channel</a><a href="#ElementType">ElementType</a><a href="#Direction">Direction</a><a href="#New">New</a><a href="#Interface">Interface</a><a href="#TrySend">TrySend</a><a href="#Close">Close</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/channel_go"</code>.</p><div class="api-list">
|
||||
<div id="Channel"><code>Channel :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Constant-time equality for caller-owned byte spans."><title>std/constant_time · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/constant_time"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/constant_time</h1><p>Constant-time equality for caller-owned byte spans. The length check is intentionally explicit; callers protecting secret tags should use fixed-size buffers so unequal lengths do not become an oracle.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/constant_time</h1><p>Constant-time equality for caller-owned byte spans. The length check is intentionally explicit; callers protecting secret tags should use fixed-size buffers so unequal lengths do not become an oracle.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ConstantTimeEqual">ConstantTimeEqual</a><a href="#ConstantTimeTextEqual">ConstantTimeTextEqual</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/constant_time"</code>.</p><div class="api-list">
|
||||
<div id="ConstantTimeEqual"><code>ConstantTimeEqual :: (left: []u8, right: []u8) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Explicit portable execution context."><title>std/context · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/context"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/context</h1><p>Explicit portable execution context. Callers pass it like any other record; there is deliberately no hidden context parameter or global state.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/context</h1><p>Explicit portable execution context. Callers pass it like any other record; there is deliberately no hidden context parameter or global state.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ContextLogger">ContextLogger</a><a href="#Context">Context</a><a href="#ContextLog">ContextLog</a><a href="#ContextEnd">ContextEnd</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/context"</code>.</p><div class="api-list">
|
||||
<div id="ContextLogger"><code>ContextLogger :: #type (tag: string, message: string)</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native Go contexts retain cancellation, deadlines and interface identity."><title>std/context_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/context_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/context_go</h1><p>Native Go contexts retain cancellation, deadlines and interface identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/context_go</h1><p>Native Go contexts retain cancellation, deadlines and interface identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Context">Context</a><a href="#CancelFunc">CancelFunc</a><a href="#Cancellation">Cancellation</a><a href="#Background">Background</a><a href="#Canceled">Canceled</a><a href="#DeadlineExceeded">DeadlineExceeded</a><a href="#Done">Done</a><a href="#WithCancel">WithCancel</a><a href="#WithTimeout">WithTimeout</a><a href="#Cancel">Cancel</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/context_go"</code>.</p><div class="api-list">
|
||||
<div id="Context"><code>Context :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="UTC calendar parsing for feeds and dated data sources, years 1 through 9999."><title>std/date_parse · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/date_parse"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_parse</h1><p>UTC calendar parsing for feeds and dated data sources, years 1 through 9999.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_parse</h1><p>UTC calendar parsing for feeds and dated data sources, years 1 through 9999.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#DateDigit">DateDigit</a><a href="#DateNumber">DateNumber</a><a href="#DaysFromCivil">DaysFromCivil</a><a href="#DateValid">DateValid</a><a href="#UtcDate">UtcDate</a><a href="#CivilFromUnix">CivilFromUnix</a><a href="#DateWriteDigits">DateWriteDigits</a><a href="#WriteCompactUtc">WriteCompactUtc</a><a href="#WriteIsoDay">WriteIsoDay</a><a href="#UtcSeconds">UtcSeconds</a><a href="#ParseCompactUtc">ParseCompactUtc</a><a href="#DateMonth">DateMonth</a><a href="#ParseRfc822Utc">ParseRfc822Utc</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/date_parse"</code>.</p><div class="api-list">
|
||||
<div id="DateDigit"><code>DateDigit :: (value: u8) -> s32</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/date_time module."><title>std/date_time · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/date_time"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#LocalNow">LocalNow</a><a href="#UnixNow">UnixNow</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/date_time"</code>.</p><div class="api-list">
|
||||
<div id="LocalNow"><code>LocalNow :: () -> LocalDateTime</code><p class="api-note">Needs a host capability.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/date_time_linux module."><title>std/date_time_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/date_time_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#UnixNow">UnixNow</a><a href="#UnixMilliseconds">UnixMilliseconds</a><a href="#LocalAt">LocalAt</a><a href="#UtcAt">UtcAt</a><a href="#LocalNow">LocalNow</a><a href="#ZoneOffsetAt">ZoneOffsetAt</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/date_time_linux"</code>.</p><div class="api-list">
|
||||
<div id="UnixNow"><code>UnixNow :: () -> s64</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="A local or UTC civil clock reading."><title>std/date_time_types · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/date_time_types"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time_types</h1><p>A local or UTC civil clock reading. Months and days are one-based; day_of_year is zero-based. Timezone rules belong to the clock provider.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/date_time_types</h1><p>A local or UTC civil clock reading. Months and days are one-based; day_of_year is zero-based. Timezone rules belong to the clock provider.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#LocalDateTime">LocalDateTime</a><a href="#ZoneOffset">ZoneOffset</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/date_time_types"</code>.</p><div class="api-list">
|
||||
<div id="LocalDateTime"><code>LocalDateTime :: struct { year: s32; month: s32; day: s32; day_of_year: s32; hour: s32; minute: s32; second: s32; valid: bool; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Ed25519 keys and signatures retain Go's native types and validation behavior."><title>std/ed25519_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/ed25519_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/ed25519_go</h1><p>Ed25519 keys and signatures retain Go's native types and validation behavior.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/ed25519_go</h1><p>Ed25519 keys and signatures retain Go's native types and validation behavior.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#PublicKey">PublicKey</a><a href="#PrivateKey">PrivateKey</a><a href="#KeyPairResult">KeyPairResult</a><a href="#GenerateKey">GenerateKey</a><a href="#NewKeyFromSeed">NewKeyFromSeed</a><a href="#Sign">Sign</a><a href="#Verify">Verify</a><a href="#Equal">Equal</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/ed25519_go"</code>.</p><div class="api-list">
|
||||
<div id="PublicKey"><code>PublicKey :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/environment module."><title>std/environment · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/environment"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/environment</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/environment</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/environment"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/environment.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="The process environment, read through the C library."><title>std/environment_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/environment_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/environment_linux</h1><p>The process environment, read through the C library.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/environment_linux</h1><p>The process environment, read through the C library.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#EnvironmentFailure">EnvironmentFailure</a><a href="#ArgumentFailure">ArgumentFailure</a><a href="#BoundedHostText">BoundedHostText</a><a href="#EnvironmentRead">EnvironmentRead</a><a href="#EnvironmentRange">EnvironmentRange</a><a href="#ArgumentRead">ArgumentRead</a><a href="#EnvironmentText">EnvironmentText</a><a href="#EnvironmentNumber">EnvironmentNumber</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/environment_linux"</code>.</p><div class="api-list">
|
||||
<div id="EnvironmentFailure"><code>EnvironmentFailure :: enum { None = 0; InvalidName = 1; Unset = 2; Empty = 3; TooLong = 4; NotNumber = 5; OutOfRange = 6; }</code><p>Named validation failures for process-controlled text. These are input failures, not memory-safety modes: every successful value is first copied into caller-owned bounded storage.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native Go error creation, identity, wrapping and exact error messages."><title>std/errors_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/errors_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/errors_go</h1><p>Native Go error creation, identity, wrapping and exact error messages.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/errors_go</h1><p>Native Go error creation, identity, wrapping and exact error messages.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#New">New</a><a href="#Is">Is</a><a href="#Unwrap">Unwrap</a><a href="#Message">Message</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/errors_go"</code>.</p><div class="api-list">
|
||||
<div id="New"><code>New :: (message: string) -> Error</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Files on every native C target under one import: Linux, Android, the web, and Windows use file_linux."><title>std/file · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/file"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file</h1><p>Files on every native C target under one import: Linux, Android, the web, and Windows use file_linux. It provides OpenRead, OpenWrite, OpenUpdate, OpenReplace, OpenNew, Read, Write, ReadAt, WriteAt, FileSize, CloseFile, RemoveFile, RenameNoReplace, PathExists, PathIsLink, DirectoryExists, CreateDirectory, CreatePrivateDirectory, OpenDirectory, NextDirectoryEntry, and CloseDirectory, plus the whole-file helpers here. ok := WriteEntireFile("notes.txt", "hello\n") text, found := ReadEntireFile("notes.txt") bytes: Vec(u8) found = ReadFileInto("notes.txt", *bytes) // freed with bytes DirectoryEntry.kind reports a snapshot of the entry's type without following links. Unknown requires a path query. Check DirectoryCursor.failed before accepting a complete walk, and always CloseDirectory even after an error.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file</h1><p>Files on every native C target under one import: Linux, Android, the web, and Windows use file_linux. It provides OpenRead, OpenWrite, OpenUpdate, OpenReplace, OpenNew, Read, Write, ReadAt, WriteAt, FileSize, CloseFile, RemoveFile, RenameNoReplace, PathExists, PathIsLink, DirectoryExists, CreateDirectory, CreatePrivateDirectory, OpenDirectory, NextDirectoryEntry, and CloseDirectory, plus the whole-file helpers here. ok := WriteEntireFile("notes.txt", "hello\n") text, found := ReadEntireFile("notes.txt") bytes: Vec(u8) found = ReadFileInto("notes.txt", *bytes) // freed with bytes DirectoryEntry.kind reports a snapshot of the entry's type without following links. Unknown requires a path query. Check DirectoryCursor.failed before accepting a complete walk, and always CloseDirectory even after an error.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FileReadFailure">FileReadFailure</a><a href="#FilePathText">FilePathText</a><a href="#ReadEntireFileCapped">ReadEntireFileCapped</a><a href="#ReadFileIntoCapped">ReadFileIntoCapped</a><a href="#ReadEntireFile">ReadEntireFile</a><a href="#ReadFileInto">ReadFileInto</a><a href="#WriteEntireFile">WriteEntireFile</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/file"</code>.</p><div class="api-list">
|
||||
<div id="FileReadFailure"><code>FileReadFailure :: enum { None = 0; InvalidLimit = 1; InvalidPath = 2; NotFound = 3; TooLarge = 4; ReadError = 5; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native Go file operations preserve filesystem permissions and error identity."><title>std/file_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/file_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_go</h1><p>Native Go file operations preserve filesystem permissions and error identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_go</h1><p>Native Go file operations preserve filesystem permissions and error identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FileMode">FileMode</a><a href="#FileReadResult">FileReadResult</a><a href="#ReadFile">ReadFile</a><a href="#WriteFile">WriteFile</a><a href="#MkdirAll">MkdirAll</a><a href="#Rename">Rename</a><a href="#Remove">Remove</a><a href="#Dir">Dir</a><a href="#NotExist">NotExist</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/file_go"</code>.</p><div class="api-list">
|
||||
<div id="FileMode"><code>FileMode :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/file_linux module."><title>std/file_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/file_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FileHandle">FileHandle</a><a href="#DirectoryCursor">DirectoryCursor</a><a href="#DirectoryKind">DirectoryKind</a><a href="#DirectoryEntry">DirectoryEntry</a><a href="#OpenRead">OpenRead</a><a href="#OpenUpdate">OpenUpdate</a><a href="#OpenWrite">OpenWrite</a><a href="#OpenReplace">OpenReplace</a><a href="#OpenNew">OpenNew</a><a href="#OpenExclusivePrivate">OpenExclusivePrivate</a><a href="#RemoveFile">RemoveFile</a><a href="#PathIsLink">PathIsLink</a><a href="#PathExists">PathExists</a><a href="#DirectoryExists">DirectoryExists</a><a href="#RenamePath">RenamePath</a><a href="#RenameNoReplace">RenameNoReplace</a><a href="#LinkFile">LinkFile</a><a href="#CreateDirectory">CreateDirectory</a><a href="#CreatePrivateDirectory">CreatePrivateDirectory</a><a href="#FileSize">FileSize</a><a href="#ReadAt">ReadAt</a><a href="#WriteAt">WriteAt</a><a href="#WriteTextAt">WriteTextAt</a><a href="#CloseFile">CloseFile</a><a href="#SyncFile">SyncFile</a><a href="#Read">Read</a><a href="#Write">Write</a><a href="#OpenDirectory">OpenDirectory</a><a href="#NextDirectoryEntry">NextDirectoryEntry</a><a href="#CloseDirectory">CloseDirectory</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/file_linux"</code>.</p><div class="api-list">
|
||||
<div id="FileHandle"><code>FileHandle :: struct { fd: s32; valid: bool; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/file_tree module."><title>std/file_tree · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/file_tree"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_tree</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_tree</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/file_tree"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/file_tree.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Paths, folders and whole files for native Linux tools and build programs: what a build script needs beyond file_linux's positional I/O."><title>std/file_tree_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/file_tree_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_tree_linux</h1><p>Paths, folders and whole files for native Linux tools and build programs: what a build script needs beyond file_linux's positional I/O. Paths are UTF-8 text of at most 4095 bytes. CreateDirectories("build/site/pictures") CopyTree("site", "build/site/page") names: Vec(string) if ListDirectory("levels", *names) { for names { ... } } lock := LockPath("backup/drafts/approval.lock") ReplaceFile("levels/approved.json", text) UnlockPath(lock) PathStatus reads a path's kind, owner, permission bits, size and modification time with statx, whose record has one layout on every little-endian Linux architecture, or on Darwin with fstatat's 64-bit-inode record.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/file_tree_linux</h1><p>Paths, folders and whole files for native Linux tools and build programs: what a build script needs beyond file_linux's positional I/O. Paths are UTF-8 text of at most 4095 bytes. CreateDirectories("build/site/pictures") CopyTree("site", "build/site/page") names: Vec(string) if ListDirectory("levels", *names) { for names { ... } } lock := LockPath("backup/drafts/approval.lock") ReplaceFile("levels/approved.json", text) UnlockPath(lock) PathStatus reads a path's kind, owner, permission bits, size and modification time with statx, whose record has one layout on every little-endian Linux architecture, or on Darwin with fstatat's 64-bit-inode record.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#PathKind">PathKind</a><a href="#PathInfo">PathInfo</a><a href="#PathQueryResult">PathQueryResult</a><a href="#PathQuery">PathQuery</a><a href="#PathStatus">PathStatus</a><a href="#FileSnapshot">FileSnapshot</a><a href="#SameFileSnapshot">SameFileSnapshot</a><a href="#IsFile">IsFile</a><a href="#IsDirectory">IsDirectory</a><a href="#SetPathMode">SetPathMode</a><a href="#JoinPath">JoinPath</a><a href="#PathName">PathName</a><a href="#PathParent">PathParent</a><a href="#PathSuffix">PathSuffix</a><a href="#PathStem">PathStem</a><a href="#ResolvePath">ResolvePath</a><a href="#CreateTemporaryDirectory">CreateTemporaryDirectory</a><a href="#WorkingDirectory">WorkingDirectory</a><a href="#CreateDirectories">CreateDirectories</a><a href="#FreeDirectoryNames">FreeDirectoryNames</a><a href="#ListDirectory">ListDirectory</a><a href="#RemoveTree">RemoveTree</a><a href="#CopyFile">CopyFile</a><a href="#CopyTree">CopyTree</a><a href="#CopySymbolicLink">CopySymbolicLink</a><a href="#CopyFileNew">CopyFileNew</a><a href="#CopyTreeNew">CopyTreeNew</a><a href="#ReplaceFile">ReplaceFile</a><a href="#LockPath">LockPath</a><a href="#UnlockPath">UnlockPath</a><a href="#MatchName">MatchName</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/file_tree_linux"</code>.</p><div class="api-list">
|
||||
<div id="PathKind"><code>PathKind :: enum { Missing = 0; File = 1; Directory = 2; Link = 3; Other = 4; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Whether a float is finite: false for NaN and either infinity."><title>std/finite · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/finite"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/finite</h1><p>Whether a float is finite: false for NaN and either infinity. Three comparisons, inlined where they are used: generated C gets a static inline copy in this module's header for every caller. std/math re-exports both.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/finite</h1><p>Whether a float is finite: false for NaN and either infinity. Three comparisons, inlined where they are used: generated C gets a static inline copy in this module's header for every caller. std/math re-exports both.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Finite32">Finite32</a><a href="#Finite64">Finite64</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/finite"</code>.</p><div class="api-list">
|
||||
<div id="Finite32"><code>Finite32 :: (value: float32) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Locale-independent IEEE 754 binary64 decimal conversion, entirely in Ziran."><title>std/float_text · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/float_text"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/float_text</h1><p>Locale-independent IEEE 754 binary64 decimal conversion, entirely in Ziran.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/float_text</h1><p>Locale-independent IEEE 754 binary64 decimal conversion, entirely in Ziran.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ParseFloat64">ParseFloat64</a><a href="#Float64Repr">Float64Repr</a><a href="#Float64ReprInto">Float64ReprInto</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/float_text"</code>.</p><div class="api-list">
|
||||
<div id="ParseFloat64"><code>ParseFloat64 :: (text: string) -> (float64, bool)</code><p>A complete ASCII decimal, optional sign/point/exponent, or inf/nan. No whitespace, separators or trailing bytes. Invalid input returns 0,false. Overflow and underflow succeed, producing infinity or signed zero.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Text built on an owned Vec(u8) builder."><title>std/format · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/format"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/format</h1><p>Text built on an owned Vec(u8) builder. Append adds one value's text, and BuilderPrint(*builder, "x=%\n", x) appends a whole formatted piece: each % takes the next argument's text and %% writes one percent. BuilderFinish turns the builder into a string. line: Vec(u8) BuilderPrint(*line, "% of % done\n", finished, total) text := BuilderFinish(line) Integers are written in base ten, bools as true or false, and floats with up to six digits after the point, trailing zeros dropped.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/format</h1><p>Text built on an owned Vec(u8) builder. Append adds one value's text, and BuilderPrint(*builder, "x=%\n", x) appends a whole formatted piece: each % takes the next argument's text and %% writes one percent. BuilderFinish turns the builder into a string. line: Vec(u8) BuilderPrint(*line, "% of % done\n", finished, total) text := BuilderFinish(line) Integers are written in base ten, bools as true or false, and floats with up to six digits after the point, trailing zeros dropped.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Append">Append</a><a href="#Append">Append</a><a href="#Append">Append</a><a href="#Append">Append</a><a href="#Append">Append</a><a href="#Append">Append</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/format"</code>.</p><div class="api-list">
|
||||
<div id="Append"><code>Append :: (builder: *Vec(u8), text: string)</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Predeclared Go interface types at the foreign-library boundary."><title>std/go_types · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/go_types"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/go_types</h1><p>Predeclared Go interface types at the foreign-library boundary.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/go_types</h1><p>Predeclared Go interface types at the foreign-library boundary.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Any">Any</a><a href="#Error">Error</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/go_types"</code>.</p><div class="api-list">
|
||||
<div id="Any"><code>Any :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Unicode 17.0 extended grapheme clusters (UAX #29, GB3–GB13)."><title>std/grapheme · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/grapheme"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/grapheme</h1><p>Unicode 17.0 extended grapheme clusters (UAX #29, GB3–GB13). Byte offsets remain suitable for slices and wire protocols. A cluster is a user-perceived character; this module needs no font, display or host.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/grapheme</h1><p>Unicode 17.0 extended grapheme clusters (UAX #29, GB3–GB13). Byte offsets remain suitable for slices and wire protocols. A cluster is a user-perceived character; this module needs no font, display or host.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#IsControl">IsControl</a><a href="#State">State</a><a href="#Step">Step</a><a href="#Push">Push</a><a href="#Next">Next</a><a href="#Previous">Previous</a><a href="#Boundary">Boundary</a><a href="#Count">Count</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/grapheme"</code>.</p><div class="api-list">
|
||||
<div id="IsControl"><code>IsControl :: (property: s32) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Generated by scripts/grapheme_data.py from Unicode 17.0.0 UCD."><title>std/grapheme_data · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/grapheme_data"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/grapheme_data</h1><p>Generated by scripts/grapheme_data.py from Unicode 17.0.0 UCD. Copyright Unicode, Inc. Distributed under the Unicode License V3. https://www.unicode.org/license.txt</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/grapheme_data</h1><p>Generated by scripts/grapheme_data.py from Unicode 17.0.0 UCD. Copyright Unicode, Inc. Distributed under the Unicode License V3. https://www.unicode.org/license.txt</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Property">Property</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/grapheme_data"</code>.</p><div class="api-list">
|
||||
<div id="Property"><code>Property :: (point: u32) -> s32</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Bounded native gzip over the platform zlib."><title>std/gzip_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/gzip_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/gzip_linux</h1><p>Bounded native gzip over the platform zlib. Works on the same C targets as zip_linux, including Android, Windows and Emscripten. Link the platform zlib.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/gzip_linux</h1><p>Bounded native gzip over the platform zlib. Works on the same C targets as zip_linux, including Android, Windows and Emscripten. Link the platform zlib.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#GzipBound">GzipBound</a><a href="#GzipCompress">GzipCompress</a><a href="#GzipDecompress">GzipDecompress</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/gzip_linux"</code>.</p><div class="api-list">
|
||||
<div id="GzipBound"><code>GzipBound :: (count: s64) -> s64</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="A hash map from keys to values that runs the same on every target and in the engine."><title>std/hash_map · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/hash_map"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/hash_map</h1><p>A hash map from keys to values that runs the same on every target and in the engine. Keys are strings or integers. The table doubles when half its slots are in use, and HashMapFree releases it. ages: HashMap(string, s32) HashMapSet(*ages, "ada", 36) age: s32 if HashMapGet(*ages, "ada", *age) { print("%\n", age) } HashMapFree(*ages)</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/hash_map</h1><p>A hash map from keys to values that runs the same on every target and in the engine. Keys are strings or integers. The table doubles when half its slots are in use, and HashMapFree releases it. ages: HashMap(string, s32) HashMapSet(*ages, "ada", 36) age: s32 if HashMapGet(*ages, "ada", *age) { print("%\n", age) } HashMapFree(*ages)</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#HashMap">HashMap</a><a href="#HashKey">HashKey</a><a href="#HashKey">HashKey</a><a href="#HashKey">HashKey</a><a href="#HashKey">HashKey</a><a href="#HashMapFind">HashMapFind</a><a href="#HashMapHas">HashMapHas</a><a href="#HashMapGet">HashMapGet</a><a href="#HashMapSet">HashMapSet</a><a href="#HashMapRemove">HashMapRemove</a><a href="#HashMapFree">HashMapFree</a><a href="#HashMapGrow">HashMapGrow</a><a href="#HashMapRehash">HashMapRehash</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/hash_map"</code>.</p><div class="api-list">
|
||||
<div id="HashMap"><code>HashMap :: struct($K: Type, $V: Type) { keys: Vec(K); values: Vec(V); states: Vec(u8); count: s64; removed: s64; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/hmac_sha256_go module."><title>std/hmac_sha256_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/hmac_sha256_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/hmac_sha256_go</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/hmac_sha256_go</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#DigestResult">DigestResult</a><a href="#HMACSHA256">HMACSHA256</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/hmac_sha256_go"</code>.</p><div class="api-list">
|
||||
<div id="DigestResult"><code>DigestResult :: struct { value: string; error: string; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/http_get_linux module."><title>std/http_get_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/http_get_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/http_get_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/http_get_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#HttpsUrl">HttpsUrl</a><a href="#GetHttps">GetHttps</a><a href="#GetHttpsCapped">GetHttpsCapped</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/http_get_linux"</code>.</p><div class="api-list">
|
||||
<div id="HttpsUrl"><code>HttpsUrl :: (url: string) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Go HTTP requests, response writers and headers retain their native types and behavior."><title>std/http_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/http_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/http_go</h1><p>Go HTTP requests, response writers and headers retain their native types and behavior.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/http_go</h1><p>Go HTTP requests, response writers and headers retain their native types and behavior.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Request">Request</a><a href="#Header">Header</a><a href="#ResponseWriter">ResponseWriter</a><a href="#Client">Client</a><a href="#Response">Response</a><a href="#RequestResult">RequestResult</a><a href="#ResponseResult">ResponseResult</a><a href="#RemoteAddress">RemoteAddress</a><a href="#Headers">Headers</a><a href="#Method">Method</a><a href="#RequestURL">RequestURL</a><a href="#Body">Body</a><a href="#Context">Context</a><a href="#MaxBytesReader">MaxBytesReader</a><a href="#WriteHeader">WriteHeader</a><a href="#HeaderValue">HeaderValue</a><a href="#ResponseHeaders">ResponseHeaders</a><a href="#SetHeader">SetHeader</a><a href="#NewClient">NewClient</a><a href="#ClientTimeout">ClientTimeout</a><a href="#NewRequest">NewRequest</a><a href="#Do">Do</a><a href="#ResponseBody">ResponseBody</a><a href="#Status">Status</a><a href="#StatusCode">StatusCode</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/http_go"</code>.</p><div class="api-list">
|
||||
<div id="Request"><code>Request :: struct</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="RGBA pictures in memory and what build tools do with them: resize, composite, paste, rotate and reduce to a palette."><title>std/image · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/image"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/image</h1><p>RGBA pictures in memory and what build tools do with them: resize, composite, paste, rotate and reduce to a palette. An Image holds 8-bit red, green, blue and straight (not premultiplied) alpha per pixel, rows top to bottom with no padding. std/png_linux reads and writes them. sprite := ResizeNearest(*tile, 16, 16) board := NewImage(192, 320) AlphaComposite(*board, *sprite, x, y) palette := QuantizeImage(*board, 192, true) Resizing and compositing follow Pillow's arithmetic: resizing an RGBA image with a filter premultiplies alpha, and AlphaComposite is Image.alpha_composite, so pictures match the ones Pillow made.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/image</h1><p>RGBA pictures in memory and what build tools do with them: resize, composite, paste, rotate and reduce to a palette. An Image holds 8-bit red, green, blue and straight (not premultiplied) alpha per pixel, rows top to bottom with no padding. std/png_linux reads and writes them. sprite := ResizeNearest(*tile, 16, 16) board := NewImage(192, 320) AlphaComposite(*board, *sprite, x, y) palette := QuantizeImage(*board, 192, true) Resizing and compositing follow Pillow's arithmetic: resizing an RGBA image with a filter premultiplies alpha, and AlphaComposite is Image.alpha_composite, so pictures match the ones Pillow made.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Image">Image</a><a href="#IndexedImage">IndexedImage</a><a href="#NewImage">NewImage</a><a href="#ImageValid">ImageValid</a><a href="#CopyImage">CopyImage</a><a href="#DropAlpha">DropAlpha</a><a href="#RotateLeft">RotateLeft</a><a href="#RotateRight">RotateRight</a><a href="#RotateHalf">RotateHalf</a><a href="#FlipLeftRight">FlipLeftRight</a><a href="#CropImage">CropImage</a><a href="#AlphaBounds">AlphaBounds</a><a href="#PasteImage">PasteImage</a><a href="#AlphaComposite">AlphaComposite</a><a href="#AlphaCompositeAt">AlphaCompositeAt</a><a href="#Silhouette">Silhouette</a><a href="#ResizeNearest">ResizeNearest</a><a href="#ResizeBox">ResizeBox</a><a href="#ResizeLanczos">ResizeLanczos</a><a href="#ResizeBicubic">ResizeBicubic</a><a href="#ResizeBicubicInto">ResizeBicubicInto</a><a href="#Thumbnail">Thumbnail</a><a href="#ImageColorBox">ImageColorBox</a><a href="#QuantizeImage">QuantizeImage</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/image"</code>.</p><div class="api-list">
|
||||
<div id="Image"><code>Image :: struct { width: s32; height: s32; pixels: Vec(u8); }</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Native Go stream interfaces retain resource ownership and error identity."><title>std/io_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/io_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/io_go</h1><p>Native Go stream interfaces retain resource ownership and error identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/io_go</h1><p>Native Go stream interfaces retain resource ownership and error identity.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Reader">Reader</a><a href="#ReadCloser">ReadCloser</a><a href="#Writer">Writer</a><a href="#BytesReader">BytesReader</a><a href="#ReadAllResult">ReadAllResult</a><a href="#ReadAll">ReadAll</a><a href="#Close">Close</a><a href="#LimitReader">LimitReader</a><a href="#FromBytes">FromBytes</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/io_go"</code>.</p><div class="api-list">
|
||||
<div id="Reader"><code>Reader :: struct</code></div>
|
||||
|
||||
+4
-3
@@ -1,11 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Baseline JPEG files from std/image pictures, on every target: JFIF with 4:2:0 chroma subsampling, the standard Huffman tables and the IJG quality scale that libjpeg and Pillow use."><title>std/jpeg · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/jpeg"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Baseline and progressive JPEG files to and from std/image pictures, on every target: JFIF writing with 4:2:0 chroma subsampling, standard Huffman tables and the IJG quality scale that libjpeg and Pillow use; reading accepts baseline (SOF0/SOF1) and progressive (SOF2) greyscale and YCbCr JPEGs."><title>std/jpeg · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/jpeg"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/jpeg</h1><p>Baseline JPEG files from std/image pictures, on every target: JFIF with 4:2:0 chroma subsampling, the standard Huffman tables and the IJG quality scale that libjpeg and Pillow use. Alpha is ignored. bytes: Vec(u8) if WriteJPEG(*title, *bytes, 82) { WriteEntireFile("title.jpg", BuilderFinish(bytes)) }</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#WriteJPEG">WriteJPEG</a></aside><div class="article-body api-body">
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/jpeg</h1><p>Baseline and progressive JPEG files to and from std/image pictures, on every target: JFIF writing with 4:2:0 chroma subsampling, standard Huffman tables and the IJG quality scale that libjpeg and Pillow use; reading accepts baseline (SOF0/SOF1) and progressive (SOF2) greyscale and YCbCr JPEGs. bytes: Vec(u8) if WriteJPEG(*title, *bytes, 82) { WriteEntireFile("title.jpg", BuilderFinish(bytes)) } decoded := ReadJPEG(VecSlice(bytes, 0, bytes.count))</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#WriteJPEG">WriteJPEG</a><a href="#ReadJPEG">ReadJPEG</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/jpeg"</code>.</p><div class="api-list">
|
||||
<div id="WriteJPEG"><code>WriteJPEG :: (image: *Image, output: *Vec(u8), quality: s32) -> bool</code><p>Appends IMAGE as a baseline JPEG at QUALITY (1 to 100) to OUTPUT.</p></div>
|
||||
<div id="ReadJPEG"><code>ReadJPEG :: (bytes: []u8) -> Image</code><p>Decodes a baseline or progressive JPEG file's bytes (1-channel greyscale or 3-channel YCbCr with any standard chroma subsampling) into an Image. Returns an invalid Image (see ImageValid) when BYTES is not a supported JPEG.</p></div>
|
||||
</div><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/jpeg.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
<footer><div class="footer-top"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><nav aria-label="Footer"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="../index.html#support">Support</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a></nav></div><div class="footer-bottom"><p>A language for useful software.</p><p>© 2026 Kryon Labs · <a href="https://waozi.xyz/">Made by Waozi</a></p></div></footer></body></html>
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Shared, allocation-free JSON string scanning."><title>std/json_bytes · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/json_bytes"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_bytes</h1><p>Shared, allocation-free JSON string scanning. Stops before a quote, backslash, control byte or the end; escape and Unicode policy stay in callers.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_bytes</h1><p>Shared, allocation-free JSON string scanning. Stops before a quote, backslash, control byte or the end; escape and Unicode policy stay in callers.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#JsonStringRunEnd">JsonStringRunEnd</a><a href="#JsonQuoteRunEnd">JsonQuoteRunEnd</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/json_bytes"</code>.</p><div class="api-list">
|
||||
<div id="JsonStringRunEnd"><code>JsonStringRunEnd :: (text: string, start: s64) -> s64</code><p>Starts outside [0,text.count) are returned unchanged. Valid starts stop at the first special byte or exactly at text.count. The input is never changed.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="JSON documents read into a tree that programs query, change and write back."><title>std/json_document · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/json_document"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_document</h1><p>JSON documents read into a tree that programs query, change and write back. Nodes live in the document's vector and are named by their index; -1 names no node, and every query accepts it. document: JsonDocument if !JsonRead(*document, text) { print("%\n", document.error) } levels := JsonMember(*document, document.root, "levels") level := JsonFirst(*document, levels) while level >= 0 { number, ok := JsonInteger(*document, JsonMember(*document, level, "number")) level = JsonNext(*document, level) } JsonSet(*document, document.root, "count", JsonNewInteger(*document, 3)) saved := JsonWrite(*document, document.root, JsonPythonStyle(1)) JsonWrite lays text out as Python's json.dumps does for the same style: separators, indentation, empty containers, ensure_ascii escapes and sort_keys. Numbers keep the text they were read with unless python_floats is enabled in the style. Strings without escapes are views of the text that was read, so keep that text alive while the document is used. Objects keep every member in order; a repeated name is answered by its last member, as Python's dict reads it.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_document</h1><p>JSON documents read into a tree that programs query, change and write back. Nodes live in the document's vector and are named by their index; -1 names no node, and every query accepts it. document: JsonDocument if !JsonRead(*document, text) { print("%\n", document.error) } levels := JsonMember(*document, document.root, "levels") level := JsonFirst(*document, levels) while level >= 0 { number, ok := JsonInteger(*document, JsonMember(*document, level, "number")) level = JsonNext(*document, level) } JsonSet(*document, document.root, "count", JsonNewInteger(*document, 3)) saved := JsonWrite(*document, document.root, JsonPythonStyle(1)) JsonWrite lays text out as Python's json.dumps does for the same style: separators, indentation, empty containers, ensure_ascii escapes and sort_keys. Numbers keep the text they were read with unless python_floats is enabled in the style. Strings without escapes are views of the text that was read, so keep that text alive while the document is used. Objects keep every member in order; a repeated name is answered by its last member, as Python's dict reads it.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#JsonKind">JsonKind</a><a href="#JsonEraser">JsonEraser</a><a href="#JsonNoErase">JsonNoErase</a><a href="#JsonNode">JsonNode</a><a href="#JsonDocument">JsonDocument</a><a href="#JsonStyle">JsonStyle</a><a href="#JsonPythonStyle">JsonPythonStyle</a><a href="#JsonCompactStyle">JsonCompactStyle</a><a href="#JsonSetEraser">JsonSetEraser</a><a href="#JsonReset">JsonReset</a><a href="#JsonRead">JsonRead</a><a href="#JsonKindOf">JsonKindOf</a><a href="#JsonCount">JsonCount</a><a href="#JsonFirst">JsonFirst</a><a href="#JsonNext">JsonNext</a><a href="#JsonKey">JsonKey</a><a href="#JsonKeyInto">JsonKeyInto</a><a href="#JsonMember">JsonMember</a><a href="#JsonElement">JsonElement</a><a href="#JsonString">JsonString</a><a href="#JsonStringInto">JsonStringInto</a><a href="#JsonIs">JsonIs</a><a href="#JsonNumberText">JsonNumberText</a><a href="#JsonNumberTextInto">JsonNumberTextInto</a><a href="#JsonInteger">JsonInteger</a><a href="#JsonBool">JsonBool</a><a href="#JsonNewNull">JsonNewNull</a><a href="#JsonNewBool">JsonNewBool</a><a href="#JsonNewInteger">JsonNewInteger</a><a href="#JsonNewNumber">JsonNewNumber</a><a href="#JsonNewString">JsonNewString</a><a href="#JsonNewStringCopy">JsonNewStringCopy</a><a href="#JsonNewArray">JsonNewArray</a><a href="#JsonNewObject">JsonNewObject</a><a href="#JsonAppend">JsonAppend</a><a href="#JsonSet">JsonSet</a><a href="#JsonSetCopy">JsonSetCopy</a><a href="#JsonRemove">JsonRemove</a><a href="#JsonClear">JsonClear</a><a href="#JsonCopy">JsonCopy</a><a href="#JsonQuoteInto">JsonQuoteInto</a><a href="#JsonQuote">JsonQuote</a><a href="#JsonWrite">JsonWrite</a><a href="#JsonWriteInto">JsonWriteInto</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/json_document"</code>.</p><div class="api-list">
|
||||
<div id="JsonKind"><code>JsonKind :: enum { Missing = 0; Null = 1; False = 2; True = 3; Number = 4; String = 5; Array = 6; Object = 7; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Go JSON serialization keeps native error values, field tags and byte storage."><title>std/json_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/json_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_go</h1><p>Go JSON serialization keeps native error values, field tags and byte storage.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_go</h1><p>Go JSON serialization keeps native error values, field tags and byte storage.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Encoder">Encoder</a><a href="#Decoder">Decoder</a><a href="#JSONResult">JSONResult</a><a href="#Marshal">Marshal</a><a href="#Unmarshal">Unmarshal</a><a href="#Valid">Valid</a><a href="#NewEncoder">NewEncoder</a><a href="#Encode">Encode</a><a href="#NewDecoder">NewDecoder</a><a href="#Decode">Decode</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/json_go"</code>.</p><div class="api-list">
|
||||
<div id="Encoder"><code>Encoder :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="JSON string serialization without a document tree."><title>std/json_quote · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/json_quote"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_quote</h1><p>JSON string serialization without a document tree. Appends into owned byte vectors; ASCII runs are copied in bulk and UTF-8 escapes preserve the document writer semantics on native and portable targets.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_quote</h1><p>JSON string serialization without a document tree. Appends into owned byte vectors; ASCII runs are copied in bulk and UTF-8 escapes preserve the document writer semantics on native and portable targets.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#JsonQuoteInto">JsonQuoteInto</a><a href="#JsonQuote">JsonQuote</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/json_quote"</code>.</p><div class="api-list">
|
||||
<div id="JsonQuoteInto"><code>JsonQuoteInto :: (output: *Vec(u8), value: string, ascii: bool) -> bool</code><p>Appends VALUE as a quoted JSON string, escaped as json.dumps escapes it.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/json_scan module."><title>std/json_scan · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/json_scan"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_scan</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/json_scan</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#JsonSpan">JsonSpan</a><a href="#JsonNumber">JsonNumber</a><a href="#JsonRange">JsonRange</a><a href="#JsonText">JsonText</a><a href="#Space">Space</a><a href="#Digit">Digit</a><a href="#Hex">Hex</a><a href="#ReadString">ReadString</a><a href="#HexValue">HexValue</a><a href="#ReadHex4">ReadHex4</a><a href="#AppendUtf8">AppendUtf8</a><a href="#ReadStringText">ReadStringText</a><a href="#ReadStringValue">ReadStringValue</a><a href="#SpanEqualsASCII">SpanEqualsASCII</a><a href="#SpanContainsFoldASCII">SpanContainsFoldASCII</a><a href="#ReadNumber">ReadNumber</a><a href="#MatchLiteral">MatchLiteral</a><a href="#ValueEnd">ValueEnd</a><a href="#FieldAt">FieldAt</a><a href="#ObjectPositions">ObjectPositions</a><a href="#ElementAt">ElementAt</a><a href="#ArrayPositions">ArrayPositions</a><a href="#ArrayRanges">ArrayRanges</a><a href="#ArrayRangesReuse">ArrayRangesReuse</a><a href="#WalkArray">WalkArray</a><a href="#ArrayCount">ArrayCount</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/json_scan"</code>.</p><div class="api-list">
|
||||
<div id="JsonSpan"><code>JsonSpan :: struct { start: s32; end: s32; after: s32; valid: bool; }</code><p>A small allocation-free JSON scanner. Positions are UTF-8 byte offsets. String spans retain escapes; member lookup matches unescaped ASCII names.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Go maps share their storage when copied or passed to a function."><title>std/map_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/map_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/map_go</h1><p>Go maps share their storage when copied or passed to a function. The private fields describe type arguments; access goes through Map operations. Go target only. Import option to use MapLookup, whose result is Option(V). MapSet initializes nil storage; MapInit preserves an existing map. MapGet returns a zero value for absent keys. MapKeys returns an unordered snapshot.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/map_go</h1><p>Go maps share their storage when copied or passed to a function. The private fields describe type arguments; access goes through Map operations. Go target only. Import option to use MapLookup, whose result is Option(V). MapSet initializes nil storage; MapInit preserves an existing map. MapGet returns a zero value for absent keys. MapKeys returns an unordered snapshot.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Map">Map</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/map_go"</code>.</p><div class="api-list">
|
||||
<div id="Map"><code>Map :: struct($K: Type, $V: Type) { key: K; value: V; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/mapped_file module."><title>std/mapped_file · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/mapped_file"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mapped_file</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mapped_file</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/mapped_file"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/mapped_file.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/mapped_file_linux module."><title>std/mapped_file_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/mapped_file_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mapped_file_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mapped_file_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#MappedFile">MappedFile</a><a href="#MapPrivate">MapPrivate</a><a href="#MappedBytes">MappedBytes</a><a href="#UnmapFile">UnmapFile</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/mapped_file_linux"</code>.</p><div class="api-list">
|
||||
<div id="MappedFile"><code>MappedFile :: struct { data: *u8; length: u64; valid: bool; }</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Portable float32 helpers for native and bundled Ziran programs."><title>std/math · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/math"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/math</h1><p>Portable float32 helpers for native and bundled Ziran programs. Finite32 and Finite64 live in std/finite, whose C header is not named like a standard one and so carries their inline copies.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/math</h1><p>Portable float32 helpers for native and bundled Ziran programs. Finite32 and Finite64 live in std/finite, whose C header is not named like a standard one and so carries their inline copies.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FloorInteger">FloorInteger</a><a href="#CeilInteger">CeilInteger</a><a href="#SineDegrees">SineDegrees</a><a href="#CosineDegrees">CosineDegrees</a><a href="#NotANumber">NotANumber</a><a href="#Infinity">Infinity</a><a href="#ScaleByPowerOfTwo">ScaleByPowerOfTwo</a><a href="#RoundToInteger">RoundToInteger</a><a href="#Sqrt">Sqrt</a><a href="#Exp">Exp</a><a href="#Expm1">Expm1</a><a href="#Log">Log</a><a href="#Log1p">Log1p</a><a href="#Log10">Log10</a><a href="#Log2">Log2</a><a href="#Sin">Sin</a><a href="#Cos">Cos</a><a href="#Tan">Tan</a><a href="#Atan">Atan</a><a href="#Atan2">Atan2</a><a href="#Asin">Asin</a><a href="#Acos">Acos</a><a href="#Sinh">Sinh</a><a href="#Cosh">Cosh</a><a href="#Tanh">Tanh</a><a href="#Asinh">Asinh</a><a href="#Acosh">Acosh</a><a href="#Atanh">Atanh</a><a href="#Pow">Pow</a><a href="#Cbrt">Cbrt</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/math"</code>.</p><div class="api-list">
|
||||
<div id="FloorInteger"><code>FloorInteger :: (value: float32) -> s32</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="A native POSIX mutex."><title>std/mutex_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/mutex_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mutex_linux</h1><p>A native POSIX mutex. Keep the record at one address while open; stop and join users before closing it. The storage covers the supported pthread ABIs.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/mutex_linux</h1><p>A native POSIX mutex. Keep the record at one address while open; stop and join users before closing it. The storage covers the supported pthread ABIs.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Mutex">Mutex</a><a href="#Address">Address</a><a href="#Open">Open</a><a href="#Close">Close</a><a href="#Lock">Lock</a><a href="#Unlock">Unlock</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/mutex_linux"</code>.</p><div class="api-list">
|
||||
<div id="Mutex"><code>Mutex :: struct { storage: [8]u64; opened: bool; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Go IP parsing, canonical formatting, loopback classification and host/port splitting."><title>std/net_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/net_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_go</h1><p>Go IP parsing, canonical formatting, loopback classification and host/port splitting.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_go</h1><p>Go IP parsing, canonical formatting, loopback classification and host/port splitting.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#IP">IP</a><a href="#HostPort">HostPort</a><a href="#SplitHostPort">SplitHostPort</a><a href="#ParseIP">ParseIP</a><a href="#ValidIP">ValidIP</a><a href="#FormatIP">FormatIP</a><a href="#IsLoopback">IsLoopback</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/net_go"</code>.</p><div class="api-list">
|
||||
<div id="IP"><code>IP :: struct</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/net_http module."><title>std/net_http · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/net_http"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#HttpHeader">HttpHeader</a><a href="#HttpRequest">HttpRequest</a><a href="#HttpResponse">HttpResponse</a><a href="#HttpInputFailure">HttpInputFailure</a><a href="#HttpTextValid">HttpTextValid</a><a href="#Send">Send</a><a href="#HttpUrlValid">HttpUrlValid</a><a href="#ValidateHttpRequest">ValidateHttpRequest</a><a href="#ValidateHostResponse">ValidateHostResponse</a><a href="#SendCapped">SendCapped</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/net_http"</code>.</p><div class="api-list">
|
||||
<div id="HttpHeader"><code>HttpHeader :: struct { name: string; value: string; }</code><p>Network transport is an explicit host capability. The host adds a Bearer Authorization header when token is nonempty. It must not log that token. The request and response records have the same meaning in native targets and portable bundles.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/net_http_curl_linux module."><title>std/net_http_curl_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/net_http_curl_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http_curl_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http_curl_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#CurlInitRoutine">CurlInitRoutine</a><a href="#CurlUrl">CurlUrl</a><a href="#CurlMethod">CurlMethod</a><a href="#CurlWriteData">CurlWriteData</a><a href="#CurlWriteFunction">CurlWriteFunction</a><a href="#CurlHeaders">CurlHeaders</a><a href="#CurlAcceptEncoding">CurlAcceptEncoding</a><a href="#CurlPostFields">CurlPostFields</a><a href="#CurlPostSize">CurlPostSize</a><a href="#CurlTimeoutMs">CurlTimeoutMs</a><a href="#CurlConnectTimeoutMs">CurlConnectTimeoutMs</a><a href="#CurlNoSignal">CurlNoSignal</a><a href="#CurlNoBody">CurlNoBody</a><a href="#CurlProxy">CurlProxy</a><a href="#CurlFollowLocation">CurlFollowLocation</a><a href="#CurlResponseCode">CurlResponseCode</a><a href="#CurlMaxConnects">CurlMaxConnects</a><a href="#CurlPoolSlot">CurlPoolSlot</a><a href="#CurlLease">CurlLease</a><a href="#curl_pool">curl_pool</a><a href="#curl_once">curl_once</a><a href="#curl_init_result">curl_init_result</a><a href="#curl_pool_lock">curl_pool_lock</a><a href="#LockCurlPool">LockCurlPool</a><a href="#UnlockCurlPool">UnlockCurlPool</a><a href="#InitCurl">InitCurl</a><a href="#CurlReady">CurlReady</a><a href="#CurlOrigin">CurlOrigin</a><a href="#AcquireCurl">AcquireCurl</a><a href="#ReleaseCurl">ReleaseCurl</a><a href="#CloseCurlConnections">CloseCurlConnections</a><a href="#StartsWith">StartsWith</a><a href="#MethodToken">MethodToken</a><a href="#HeaderName">HeaderName</a><a href="#CurlFailure">CurlFailure</a><a href="#CurlResult">CurlResult</a><a href="#CurlOutput">CurlOutput</a><a href="#CurlWriteCallback64">CurlWriteCallback64</a><a href="#CurlWriteCallback32">CurlWriteCallback32</a><a href="#AppendCurlOutput">AppendCurlOutput</a><a href="#CurlWrite64">CurlWrite64</a><a href="#CurlWrite32">CurlWrite32</a><a href="#SetCurlLong">SetCurlLong</a><a href="#ReadCurlStatus">ReadCurlStatus</a><a href="#HeaderText">HeaderText</a><a href="#AddCurlHeader">AddCurlHeader</a><a href="#AddNamedHeader">AddNamedHeader</a><a href="#SendCurl">SendCurl</a><a href="#SendCurlWithin">SendCurlWithin</a><a href="#SendCurlDirectWithin">SendCurlDirectWithin</a><a href="#SendCurlConfigured">SendCurlConfigured</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/net_http_curl_linux"</code>.</p><div class="api-list">
|
||||
<div id="CurlInitRoutine"><code>CurlInitRoutine :: #type ()</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/net_http_linux module."><title>std/net_http_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/net_http_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_http_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#HttpUrl">HttpUrl</a><a href="#PostJson">PostJson</a><a href="#PostJsonCapped">PostJsonCapped</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/net_http_linux"</code>.</p><div class="api-list">
|
||||
<div id="HttpUrl"><code>HttpUrl :: (url: string) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Blocking, bounded WebSocket text receive for native libcurl hosts."><title>std/net_ws_curl_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/net_ws_curl_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_ws_curl_linux</h1><p>Blocking, bounded WebSocket text receive for native libcurl hosts. The protocol consumer owns URL construction and JSON validation.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/net_ws_curl_linux</h1><p>Blocking, bounded WebSocket text receive for native libcurl hosts. The protocol consumer owns URL construction and JSON validation.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#PollDescriptor">PollDescriptor</a><a href="#PollRead">PollRead</a><a href="#NoSocket">NoSocket</a><a href="#ValidSocket">ValidSocket</a><a href="#CurlWsFrame">CurlWsFrame</a><a href="#CurlConnectOnly">CurlConnectOnly</a><a href="#CurlActiveSocket">CurlActiveSocket</a><a href="#CurlAgain">CurlAgain</a><a href="#CurlWsText">CurlWsText</a><a href="#CurlWsContinue">CurlWsContinue</a><a href="#CurlWsClose">CurlWsClose</a><a href="#ReceiveWebSocketCurl">ReceiveWebSocketCurl</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/net_ws_curl_linux"</code>.</p><div class="api-list">
|
||||
<div id="PollDescriptor"><code>PollDescriptor :: struct { fd: s32; events: s16; returned: s16; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/number_text module."><title>std/number_text · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/number_text"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/number_text</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/number_text</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FormatInteger">FormatInteger</a><a href="#IntegerPrefix">IntegerPrefix</a><a href="#FormatDecimal">FormatDecimal</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/number_text"</code>.</p><div class="api-list">
|
||||
<div id="FormatInteger"><code>FormatInteger :: (value: s64, output: []u8) -> string</code><p>A whole number in base ten. The buffer needs 21 bytes for any s64.</p></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Portable Ogg container validation and bounded packet/page construction."><title>std/ogg · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/ogg"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/ogg</h1><p>Portable Ogg container validation and bounded packet/page construction.</p><p class="module-meta"><span class="status-badge is-in-progress">In progress</span> Available on master (Unreleased).</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/ogg</h1><p>Portable Ogg container validation and bounded packet/page construction.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#OggCRC">OggCRC</a><a href="#OggReader">OggReader</a><a href="#NextPacket">NextPacket</a><a href="#AppendPage">AppendPage</a><a href="#PageBuilder">PageBuilder</a><a href="#PageAdd">PageAdd</a><a href="#PageFlush">PageFlush</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/ogg"</code>.</p><div class="api-list">
|
||||
<div id="OggCRC"><code>OggCRC :: (page: []u8) -> u32</code><p>Ogg CRC-32 (non-reflected), with the checksum field treated as zero.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/option module."><title>std/option · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/option"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/option</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/option</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Option">Option</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/option"</code>.</p><div class="api-list">
|
||||
<div id="Option"><code>Option :: struct($T: Type) { has_value: bool; value: T; }</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/pair module."><title>std/pair · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/pair"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/pair</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/pair</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Pair">Pair</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/pair"</code>.</p><div class="api-list">
|
||||
<div id="Pair"><code>Pair :: struct($A: Type, $B: Type) { first: A; second: B; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/parallel module."><title>std/parallel · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/parallel"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/parallel</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/parallel</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/parallel"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/parallel.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Reusable native range workers."><title>std/parallel_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/parallel_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/parallel_linux</h1><p>Reusable native range workers. One owner submits non-overlapping ranges and joins their effects before continuing. Keep the pool at one address until ParallelClose; callbacks must not submit to or close their own pool.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/parallel_linux</h1><p>Reusable native range workers. One owner submits non-overlapping ranges and joins their effects before continuing. Keep the pool at one address until ParallelClose; callbacks must not submit to or close their own pool.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#RangeProcedure">RangeProcedure</a><a href="#ParallelLane">ParallelLane</a><a href="#ParallelPool">ParallelPool</a><a href="#ParallelProcessors">ParallelProcessors</a><a href="#ParallelCount">ParallelCount</a><a href="#ParallelLock">ParallelLock</a><a href="#ParallelWake">ParallelWake</a><a href="#ParallelDone">ParallelDone</a><a href="#ParallelWorker">ParallelWorker</a><a href="#ParallelInit">ParallelInit</a><a href="#ParallelInitLanes">ParallelInitLanes</a><a href="#ParallelRun">ParallelRun</a><a href="#ParallelClose">ParallelClose</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/parallel_linux"</code>.</p><div class="api-list">
|
||||
<div id="RangeProcedure"><code>RangeProcedure :: #type (start: s64, end: s64, argument: *void)</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/path module."><title>std/path · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/path"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/path</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/path</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#CleanAbsolute">CleanAbsolute</a><a href="#WithinDirectory">WithinDirectory</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/path"</code>.</p><div class="api-list">
|
||||
<div id="CleanAbsolute"><code>CleanAbsolute :: (value: string, output: []u8) -> string</code><p>Lexical slash-path operations. These do not resolve links or mount points. Returned text borrows output until the caller changes that storage.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="PNG files to and from std/image pictures on native Linux, over the platform zlib (link -lz)."><title>std/png_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/png_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/png_linux</h1><p>PNG files to and from std/image pictures on native Linux, over the platform zlib (link -lz). sprite := ReadPNGFile("sprites/tile-12.png") if !ImageValid(*sprite) { ... } WritePNGFile("build/tile.png", *sprite) WriteIndexedPNGFile("build/level.png", *QuantizeImage(*board, 192, true)) Reading accepts every standard PNG: greyscale, RGB, palette, grey with alpha and RGBA at any bit depth, tRNS transparency and Adam7 interlacing; 16-bit samples keep their high byte. Writing uses Pillow's choices for an optimized file: zlib level 9, adaptive row filters for RGB and RGBA, none for palette pictures.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/png_linux</h1><p>PNG files to and from std/image pictures on native Linux, over the platform zlib (link -lz). sprite := ReadPNGFile("sprites/tile-12.png") if !ImageValid(*sprite) { ... } WritePNGFile("build/tile.png", *sprite) WriteIndexedPNGFile("build/level.png", *QuantizeImage(*board, 192, true)) Reading accepts every standard PNG: greyscale, RGB, palette, grey with alpha and RGBA at any bit depth, tRNS transparency and Adam7 interlacing; 16-bit samples keep their high byte. Writing uses Pillow's choices for an optimized file: zlib level 9, adaptive row filters for RGB and RGBA, none for palette pictures.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ReadPNG">ReadPNG</a><a href="#WritePNG">WritePNG</a><a href="#WriteIndexedPNG">WriteIndexedPNG</a><a href="#ReadPNGFile">ReadPNGFile</a><a href="#WritePNGFile">WritePNGFile</a><a href="#WriteIndexedPNGFile">WriteIndexedPNGFile</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/png_linux"</code>.</p><div class="api-list">
|
||||
<div id="ReadPNG"><code>ReadPNG :: (bytes: []u8) -> Image</code><p>The picture a whole PNG file's bytes hold; an invalid Image (see ImageValid) when they are not a PNG this reads.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/process module."><title>std/process · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/process"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Host capability.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ProcessRequest">ProcessRequest</a><a href="#ProcessStart">ProcessStart</a><a href="#ProcessLine">ProcessLine</a><a href="#ProcessExit">ProcessExit</a><a href="#Start">Start</a><a href="#NextLine">NextLine</a><a href="#Wait">Wait</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/process"</code>.</p><div class="api-list">
|
||||
<div id="ProcessRequest"><code>ProcessRequest :: struct { executable: string; cwd: string; stdin: string; credential_name: string; credential_value: string; isolate_desktop: bool; timeout_ms: s64; }</code><p>A line-oriented child-process capability. The host receives explicit arguments, stdin, and one optional secret environment binding. Hosts must honor isolate_desktop before starting any child. Handles are host-owned; callers consume lines and then wait exactly once.</p></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/process_capture_linux module."><title>std/process_capture_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/process_capture_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_capture_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_capture_linux</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#CapturePointer">CapturePointer</a><a href="#CaptureArgument">CaptureArgument</a><a href="#CaptureFailure">CaptureFailure</a><a href="#CaptureResult">CaptureResult</a><a href="#CaptureOutput">CaptureOutput</a><a href="#CaptureOutputCapped">CaptureOutputCapped</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/process_capture_linux"</code>.</p><div class="api-list">
|
||||
<div id="CapturePointer"><code>CapturePointer :: struct { value: *u8; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="An owned native child with bidirectional byte I/O."><title>std/process_channel_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/process_channel_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_channel_linux</h1><p>An owned native child with bidirectional byte I/O. Arguments pass directly to execvp, and each child has its own process group. Do not copy a live channel: one owner must join it before releasing its storage. The explicit argv contains 1 through 32 arguments, each at most 4095 non-NUL bytes.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_channel_linux</h1><p>An owned native child with bidirectional byte I/O. Arguments pass directly to execvp, and each child has its own process group. Do not copy a live channel: one owner must join it before releasing its storage. The explicit argv contains 1 through 32 arguments, each at most 4095 non-NUL bytes.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ProcessChannel">ProcessChannel</a><a href="#StartChannel">StartChannel</a><a href="#ChannelSend">ChannelSend</a><a href="#CloseChannelInput">CloseChannelInput</a><a href="#ChannelReceive">ChannelReceive</a><a href="#WaitChannel">WaitChannel</a><a href="#CloseChannel">CloseChannel</a><a href="#CancelChannel">CancelChannel</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/process_channel_linux"</code>.</p><div class="api-list">
|
||||
<div id="ProcessChannel"><code>ProcessChannel :: struct { socket: Socket.LinuxSocket; pid: s32; code: s32; exited: bool; error: s32; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Run native Linux child processes from build and release programs: any number of arguments, a working directory, environment changes, and each standard stream inherited, discarded, read from or written to a file, or captured."><title>std/process_run_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/process_run_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_run_linux</h1><p>Run native Linux child processes from build and release programs: any number of arguments, a working directory, environment changes, and each standard stream inherited, discarded, read from or written to a file, or captured. No shell parses anything; the first argument is looked up on PATH as execvp does. command: [3]string = .["git", "rev-parse", "HEAD"] options: ProcessOptions = .{arguments = command[:], capture_output = true} run: ProcessRun if RunProcess(options, *run) && run.code == 0 { revision := BuilderFinish(run.output) } StartProcess leaves the child running; PollProcess, WaitProcess and SignalProcess follow it. A child that cannot be started (a missing program or directory, an unreadable input file) reports started = false and code 127 instead of running anything. Programs that start children should stay single-threaded: the child applies its working directory and environment between fork and exec.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/process_run_linux</h1><p>Run native Linux child processes from build and release programs: any number of arguments, a working directory, environment changes, and each standard stream inherited, discarded, read from or written to a file, or captured. No shell parses anything; the first argument is looked up on PATH as execvp does. command: [3]string = .["git", "rev-parse", "HEAD"] options: ProcessOptions = .{arguments = command[:], capture_output = true} run: ProcessRun if RunProcess(options, *run) && run.code == 0 { revision := BuilderFinish(run.output) } StartProcess leaves the child running; PollProcess, WaitProcess and SignalProcess follow it. A child that cannot be started (a missing program or directory, an unreadable input file) reports started = false and code 127 instead of running anything. Programs that start children should stay single-threaded: the child applies its working directory and environment between fork and exec.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ProcessArgumentSlot">ProcessArgumentSlot</a><a href="#ProcessOptions">ProcessOptions</a><a href="#ProcessRun">ProcessRun</a><a href="#StartProcess">StartProcess</a><a href="#PollProcess">PollProcess</a><a href="#WaitProcess">WaitProcess</a><a href="#SignalProcess">SignalProcess</a><a href="#RunProcess">RunProcess</a><a href="#CatchTermination">CatchTermination</a><a href="#TerminationRequested">TerminationRequested</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/process_run_linux"</code>.</p><div class="api-list">
|
||||
<div id="ProcessArgumentSlot"><code>ProcessArgumentSlot :: struct { value: *u8; }</code></div>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Allocation-free bounded FIFO queue over caller-owned byte storage."><title>std/queue · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/queue"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/queue</h1><p>Allocation-free bounded FIFO queue over caller-owned byte storage. Queue state is passed and returned by value; every operation receives the backing bytes explicitly so their lifetime remains visible to the caller.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/queue</h1><p>Allocation-free bounded FIFO queue over caller-owned byte storage. Queue state is passed and returned by value; every operation receives the backing bytes explicitly so their lifetime remains visible to the caller.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#BoundedQueue">BoundedQueue</a><a href="#QueueByte">QueueByte</a><a href="#QueueBytes">QueueBytes</a><a href="#QueueStart">QueueStart</a><a href="#QueueCapacity">QueueCapacity</a><a href="#QueueCount">QueueCount</a><a href="#QueuePush">QueuePush</a><a href="#QueuePushBytes">QueuePushBytes</a><a href="#QueuePop">QueuePop</a><a href="#QueuePopBytes">QueuePopBytes</a><a href="#QueueClear">QueueClear</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/queue"</code>.</p><div class="api-list">
|
||||
<div id="BoundedQueue"><code>BoundedQueue :: struct { capacity: s64; head: s64; count: s64; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/random module."><title>std/random · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/random"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><span>None</span></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/random"</code>.</p><p>No public declarations.</p><p><a class="text-link" href="https://github.com/ziranlang/ziran/blob/master/std/random.zi">Source ↗</a> · <a class="text-link" href="../modules.html#std">All modules</a></p></section>
|
||||
</div></div></main>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Cryptographic random bytes from Go, preserving its count and error results."><title>std/random_go · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/random_go"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random_go</h1><p>Cryptographic random bytes from Go, preserving its count and error results.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random_go</h1><p>Cryptographic random bytes from Go, preserving its count and error results.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Go target.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#ReadResult">ReadResult</a><a href="#Fill">Fill</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/random_go"</code>.</p><div class="api-list">
|
||||
<div id="ReadResult"><code>ReadResult :: struct { count: isize; error: Error; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Secure operating-system randomness for native Linux programs."><title>std/random_linux · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/random_linux"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random_linux</h1><p>Secure operating-system randomness for native Linux programs. The caller owns the destination bytes and no fallback generator is permitted.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/random_linux</h1><p>Secure operating-system randomness for native Linux programs. The caller owns the destination bytes and no fallback generator is permitted.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> <span class="module-target">Needs: Native Linux.</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FillSecure">FillSecure</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/random_linux"</code>.</p><div class="api-list">
|
||||
<div id="FillSecure"><code>FillSecure :: (output: []u8) -> bool</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="Pillow's separable resampling of 8-bit RGBA as allocation-free row kernels, with std/simd versions for x86-64 (SSE2 to AVX2), NEON (AArch64 and ARMv7) and WebAssembly SIMD128 that make the same bytes."><title>std/resample · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/resample"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/resample</h1><p>Pillow's separable resampling of 8-bit RGBA as allocation-free row kernels, with std/simd versions for x86-64 (SSE2 to AVX2), NEON (AArch64 and ARMv7) and WebAssembly SIMD128 that make the same bytes. axis: ResampleAxis ResampleAxisInto(*axis, 640, 853, RESAMPLE_LANCZOS) // weights once ResampleRowHorizontal(*axis, source_row, target_row) // then every row ResamplePlan resizes a whole premultiplied picture in two passes with scratch it owns, so resizing again to the same size never allocates; its passes split into row ranges for worker threads. Weights are Pillow's 22-bit fixed point, each pass rounds to bytes and the arithmetic is on the stored (premultiplied) bytes, not linear light, as in Pillow. The scalar loops are the reference; the fastest kernels this CPU has are chosen once. An axis whose sums could leave 32 bits, which Pillow's filters never produce, uses the scalar loops. Pointer kernels need a native target; std/image keeps the portable resizes.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/resample</h1><p>Pillow's separable resampling of 8-bit RGBA as allocation-free row kernels, with std/simd versions for x86-64 (SSE2 to AVX2), NEON (AArch64 and ARMv7) and WebAssembly SIMD128 that make the same bytes. axis: ResampleAxis ResampleAxisInto(*axis, 640, 853, RESAMPLE_LANCZOS) // weights once ResampleRowHorizontal(*axis, source_row, target_row) // then every row ResamplePlan resizes a whole premultiplied picture in two passes with scratch it owns, so resizing again to the same size never allocates; its passes split into row ranges for worker threads. Weights are Pillow's 22-bit fixed point, each pass rounds to bytes and the arithmetic is on the stored (premultiplied) bytes, not linear light, as in Pillow. The scalar loops are the reference; the fastest kernels this CPU has are chosen once. An axis whose sums could leave 32 bits, which Pillow's filters never produce, uses the scalar loops. Pointer kernels need a native target; std/image keeps the portable resizes.</p><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#RESAMPLE_BOX">RESAMPLE_BOX</a><a href="#RESAMPLE_LANCZOS">RESAMPLE_LANCZOS</a><a href="#RESAMPLE_BICUBIC">RESAMPLE_BICUBIC</a><a href="#RESAMPLE_SCALAR">RESAMPLE_SCALAR</a><a href="#RESAMPLE_SSE2">RESAMPLE_SSE2</a><a href="#RESAMPLE_AVX2">RESAMPLE_AVX2</a><a href="#RESAMPLE_NEON">RESAMPLE_NEON</a><a href="#RESAMPLE_SIMD128">RESAMPLE_SIMD128</a><a href="#ResampleAxis">ResampleAxis</a><a href="#ResamplePlan">ResamplePlan</a><a href="#ResampleKernels">ResampleKernels</a><a href="#ResampleUseKernels">ResampleUseKernels</a><a href="#ResampleAxisBoxInto">ResampleAxisBoxInto</a><a href="#ResampleAxisInto">ResampleAxisInto</a><a href="#ResampleRowHorizontal">ResampleRowHorizontal</a><a href="#ResampleRowVertical">ResampleRowVertical</a><a href="#ResamplePremultiply">ResamplePremultiply</a><a href="#ResampleUnpremultiply">ResampleUnpremultiply</a><a href="#ResamplePlanInto">ResamplePlanInto</a><a href="#ResamplePlanFirstRows">ResamplePlanFirstRows</a><a href="#ResamplePlanSecondRows">ResamplePlanSecondRows</a><a href="#ResamplePlanFirst">ResamplePlanFirst</a><a href="#ResamplePlanSecond">ResamplePlanSecond</a><a href="#ResamplePlanRun">ResamplePlanRun</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/resample"</code>.</p><div class="api-list">
|
||||
<div id="RESAMPLE_BOX"><code>RESAMPLE_BOX :: 0</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/result module."><title>std/result · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/result"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/result</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/result</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#Result">Result</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/result"</code>.</p><div class="api-list">
|
||||
<div id="Result"><code>Result :: struct($T: Type, $E: Type) { is_ok: bool; value: T; error: E; }</code></div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="theme-color" content="#f7f3eb"><meta name="description" content="API reference for the Ziran std/rss_scan module."><title>std/rss_scan · Ziran</title><link rel="canonical" href="https://ziran-lang.org/std/rss_scan"><link rel="icon" href="../assets/logo-capybara.png" type="image/png"><link rel="stylesheet" href="../styles.css"><script defer src="../site.js"></script></head>
|
||||
<body><a class="skip-link" href="#main">Skip to content</a><header class="site-header"><div class="site-header-inner"><a class="brand" href="../index.html"><img class="brand-icon" src="../assets/logo-capybara.png" alt="" width="36" height="36"><span>Ziran</span></a><button class="menu-button" type="button" aria-expanded="false" aria-controls="primary-nav">Menu</button><nav class="header-nav" id="primary-nav" aria-label="Primary"><a href="../get-started.html">Get started</a><a href="../examples.html">Examples</a><a href="../targets.html">Targets</a><a href="../modules.html" aria-current="page">Modules</a><a href="../docs.html">Docs</a><a href="../status.html">Status</a><a href="https://github.com/ziranlang/ziran">GitHub ↗</a><button class="theme-toggle" type="button" aria-label="Switch color theme"></button></nav></div></header>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/rss_scan</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.6.0">v0.6.0</a>.</p></div>
|
||||
<main id="main" class="article-layout"><div class="article-head"><p class="eyebrow"><a href="../modules.html#std">Modules</a> / Standard library</p><h1>std/rss_scan</h1><p class="module-meta"><span class="status-badge is-stable">Stable</span> Shipped in release <a href="https://github.com/ziranlang/ziran/releases/tag/v0.7.0">v0.7.0</a>.</p></div>
|
||||
<div class="article-grid"><aside class="page-toc"><strong>Declarations</strong><a href="#FeedSpan">FeedSpan</a><a href="#FeedMatch">FeedMatch</a><a href="#FeedFind">FeedFind</a><a href="#FeedNextItem">FeedNextItem</a><a href="#FeedTag">FeedTag</a><a href="#FeedEntity">FeedEntity</a><a href="#FeedCopyText">FeedCopyText</a></aside><div class="article-body api-body">
|
||||
<section><p>Import with <code>#import "std/rss_scan"</code>.</p><div class="api-list">
|
||||
<div id="FeedSpan"><code>FeedSpan :: struct { start: s32; end: s32; after: s32; valid: bool; }</code></div>
|
||||
|
||||
Loaded 100 of 138 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user