package wax-lib

All checked builds pass
  1. Overview
  2. Docs
Libraries for Wax, a Rust-like syntax for WebAssembly

Install

dune-project
 Dependency

Authors

Maintainers

Sources

wax-v0.3.0.tbz
sha256=cc19989d0db930d9300d7356c8f127309424a82767dd3c91ffd19a0bfd20e3a6
sha512=14ff9219dc6c4e8855c3cb895bd1af6fd81d1c521afefe1e7f69208a2e37abc7ec0946f188198a26780aa405fd43a526b938158334a019f7a5d991d8efc437c3

doc/wax-lib.utils/Wax_utils/Debug/index.html

Module Wax_utils.DebugSource

Developer-facing debug output, enabled per category with --debug.

Sourcetype category =
  1. | Timing
  2. | Width_check
    (*

    Width_check turns on the Wasm-to-Wax differential width check (see Wax_lang.Typing.f's ~width_check): a decompiled expression whose printed form Wax would re-infer at another width is reported instead of being printed. Extend with future debug features.

    *)
  3. | Width_record
    (*

    Width_record turns on the recording-gap census: on a Wasm-to-Wax conversion, report (to stderr) every numeric-valued node the conversion emitted without recording the type its opcode states — Ast.expectation's Unset, as opposed to a deliberate Contextual. Such a node is invisible to the width check above by construction, so a gap can only surface as a silent drift; this makes the class enumerable instead.

    *)
Sourceval categories : string list

Known category names, for help text and error messages. Currently ["timing"; "width-check"; "width-record"].

Sourceval parse : string -> (category, string) result

Parse one category name; Error msg names the valid categories.

Sourceval enable : category list -> unit

Record which debug categories are active. Call once at startup.

Sourceval is_enabled : category -> bool

Whether the given category was enabled by enable.

Sourceval timed : string -> (unit -> 'a) -> 'a

timed label f runs f (). When Timing is enabled, it measures the wall-clock duration of f and prints "<label>: <n> ms" to stderr; otherwise it just runs f with no measurement and no output.

Sourceval timed_if : bool -> string -> (unit -> 'a) -> 'a

timed_if cond label f is timed label f when cond holds, and f () untimed otherwise. Used to skip timing a measurement-only sub-pass (e.g. the dry trivia-collection traversal of the printer).