lib-script · crate
kinogaki-script-lib
lib-script's function library.
- Repository
- lib-script (kinogaki/lib-script)
- Folder
libs/lib-script/crates/lib- Source
- 13 files, 2,455 lines
- Tests
- 1 file, 19 lines
What it is
lib-script's function library. Every function is a signature row (what the checker sees), a scalar reference and a column form, tested against each other: most are written once against kinogaki_script_ir::Emit and so lower to column instructions; the rest (noise, random, inverses, slerp, HSV) are kernels over a chunk of lanes.
library is the process-wide instance; reference() writes the function reference (docs/FUNCTIONS.md) from the signature table.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-math | lib-math | normal | Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions. |
kinogaki-script-host | lib-script | normal | The boundary between lib-script and a host. |
kinogaki-script-ir | lib-script | normal | lib-script's column IR: typed SSA values (vectors as groups of scalar values) in structured regions; lowering from the checked program; uniform/varying analysis; optimisation; a verifier; and the fault table that maps instructions back to source spans. |
kinogaki-script-types | lib-script | normal | lib-script's front end after parsing: types, the host schema a context offers, the library catalog's signatures, the checker that builds the typed program, and completion and hover for the editor. |
Third-party
None.
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-script-exec | lib-script | normal | lib-script's engine: a column (batch) interpreter in safe Rust. |
Modules
familyThe function families, one module each.10 linesfamily::colorColor: thecolormodule (HSV conversions, luminance).111 linesfamily::interpInterpolation: fit, fit01, fit10, fit11, efit, lerp, mix, smooth.172 linesfamily::mathMath: rounding, powers, logarithms, trigonometry, min/max/clamp, sign.298 linesfamily::matrixMatrices (rows first; row vectors,v * m, as VEX): transpose, determinant, invert, and themat3/mat4constructors identity, scale, rotate, translate, lookat, from_quat.369 linesfamily::noiseNoise: flat VEX-stylenoise(Perlin, 0 to 1),snoise(simplex, signed),onoise(fBm) andcurlnoise, and thenoisemodule's building blocks.301 linesfamily::quatQuaternionsx y z w(w real): thequatmodule, and the flat VEX namesqmultiply,qrotate,slerp.246 linesfamily::randomRandom numbers:randhashes its seed's bits,random(seed, element)is Studio'schance(SplitMix64's finalizer over the element and seed), so a script and the Random selection node agree.158 linesfamily::vectorVectors: dot, cross, length, length2, normalize, distance, distance2, reflect.138 lineskernelColumn kernels: a library function over a chunk of lanes.63 linesrampRamp parameters, encoded as a flat list of floats: the point count, thenposition, value, interpolationper point (positions ascending in 0..=1; interpolation 0 constant, 1 linear, 2 smooth, 3 monotone, 4 B-spline).238 linesrowSignature rows and their implementations.179 lines
Public types and traits
At the crate root
Structs Lib
By module: 5 public types and traits in 2 modules
kernel KernelCall
row ImplPRowRows
Besides these, 58 public functions at module level.
