RecurLoop/ Documentation
Embed/Guidesv0.2.12

Embed

Embed exposes binary literals and helps source-time producers create them. Importing the library does not run the embedded data. An embedded literal is represented by BitString*, with an exact bit count and a borrowed byte pointer.

First example

recurloop
import embed
let check_blob = fn () -> i64 {
    let blob = bits"10101010_11110000"
    if Embed:bits(blob) != 16 || Embed:bytes(blob) != 2 { return 1 }
    let data = Embed:data(blob)
    return data[0] != 170 || data[1] != 240
}
assert check_blob() == 0

Learning path

  1. Bit layout — Understand exact lengths and partial bytes.
  2. Native data — Pass borrowed bytes across native interfaces.
  3. Syntax producers — Generate literals while elaborating syntax.