Skip to main content

Module js

Module js 

Source
Expand description

JavaScript code generator — rule-based (Tier 2) transpilation from AIR to JS.

Handles all capability gaps:

  • Algebraic types → tagged objects: { _tag: "Variant", ...fields }
  • Pattern matching → switch on _tag + destructuring
  • Effects → destructured parameter object
  • Ownership → erased (JS is GC)
  • Async → async/await (native)
  • Generics → erased (JS is dynamically typed)

Structs§

JsGenerator
JavaScript code generator implementing the CodeGenerator trait.