Skip to main content

Crate clipasm

Crate clipasm 

Source
Expand description

Embed the ClipAsm typed Video and Audio compiler and renderer.

ClipAsm separates authoring from execution. Parse a native .clipasm source::SourcePackage through language, then compile it into a pure compiler::CompiledProgram. The dependency-light base library also exposes virtual-asset browser preparation and recipe serialization.

Compilation performs no media or external-tool I/O. The native feature is the first layer allowed to inspect assets, FFmpeg, or FFprobe.

§Cargo features

  • No features builds the language, compiler, model, reference catalog, and pure browser preparation/render-recipe adapters.
  • native adds filesystem/tool preflight and native rendering.
  • The default cli feature includes native and the clipasm executable.

§Example

use std::path::Path;

let program = clipasm::language::parse_str(
    Path::new("program.clipasm"),
    "clipasm 1\nimage(\"missing.png\", 1s)\n",
)?;
let compiled = clipasm::compiler::compile(&program)?;
assert_eq!(compiled.value_count(), 1);

Native execution is available when the native feature is enabled:

use std::path::Path;

let program = clipasm::language::parse_file(Path::new("program.clipasm"))?;
let compiled = clipasm::compiler::compile(&program)?;
let prepared = clipasm::preflight::preflight(&compiled)?;
let report = clipasm::render::render(&prepared)?;
println!("{}", report.output().display());

The native language, programs, and stack behavior are documented in the project guide rather than duplicated in this Rust API reference.

Modules§

compiler
Pure source-program compilation and semantic graph inspection.
diagnostic
Structured, source-located failures shared by every pipeline phase.
language
Native ClipAsm source language.
model
Invariant-protected identifiers, time quantities, and media properties.
preflight
Media-aware preparation of compiled programs for rendering.
reference
Read-only reference information for ClipAsm’s built-in programs.
render
Verified execution, caching, and rollback-capable publication of prepared plans.
source
Lowered, fully desugared authored ClipAsm programs.