Skip to main content

extract_program

Function extract_program 

Source
pub fn extract_program(
    text: &str,
    target: ExtractTarget,
) -> Result<String, String>
Expand description

Extract a typed, non-probabilistic lambda program to JavaScript or Rust.

The supported fragment erases RML type annotations, compiles named lambda definitions to exported functions, compiles apply and arithmetic to ordinary calls/expressions, and turns equality queries into generated tests. Probabilistic assignments and logical/probabilistic operators are rejected instead of being given misleading target-language semantics.