Skip to main content

yulang_runtime/
lib.rs

1//! Typed runtime IR for Yulang.
2//!
3//! Runtime IR is intentionally not a second type inference engine. It accepts
4//! the principal types and local evidence produced by the infer pipeline, then
5//! builds a runtime tree where every expression has a VM-facing type witness. Polymorphic
6//! variables that appear in a principal type are kept as `forall` parameters;
7//! observation-only variables are erased before validation.
8
9pub mod diagnostic;
10pub mod host;
11pub mod hygiene;
12pub mod invariant;
13pub mod ir;
14pub mod lower;
15pub mod monomorphize;
16pub mod refine;
17pub mod runtime;
18pub mod types;
19pub mod validate;
20pub mod vm;
21
22pub use diagnostic::{RuntimeError, RuntimeResult, TypeSource};
23pub use host::{HostRunOutput, eval_root_with_basic_host, eval_roots_with_basic_host};
24pub use hygiene::{format_hygiene_expr, format_hygiene_module};
25pub use invariant::{RuntimeStage, check_runtime_invariants, check_strict_runtime_value_types};
26pub use ir::{
27    Binding, EffectIdRef, EffectIdVar, Expr, ExprKind, HandleArm, HandleEffect, JoinEvidence,
28    MatchArm, Module, Pattern, RecordExprField, RecordPatternField, RecordSpreadExpr,
29    RecordSpreadPattern, ResumeBinding, Root, Stmt, Type, TypeInstantiation, TypeSubstitution,
30};
31pub use lower::{
32    CoreShapeProfile, DerivedExpectedEvidenceProfile, ExpectedAdapterEvidenceProfile,
33    ExpectedArgEvidenceProfile, ObservedAdapterEvidence, ObservedAdapterEvidenceKind,
34    RuntimeAdapterEvent, RuntimeAdapterEventKind, RuntimeAdapterProfile, RuntimeApplyAdapterPhase,
35    RuntimeLowerOutput, RuntimeLowerProfile, lower_core_program, lower_core_program_profiled,
36    lower_principal_module,
37};
38pub use monomorphize::{
39    DemandEvidenceProfile, DemandQueueProfile, MonomorphizePassProfile, MonomorphizeProfile,
40    MonomorphizeProgress, SubstitutionSpecializeInferenceCount,
41    SubstitutionSpecializeMissingVarCount, SubstitutionSpecializeProfile,
42    SubstitutionSpecializeRewriteContextCount, SubstitutionSpecializeRewriteExprKindTiming,
43    SubstitutionSpecializeRewritePhaseTiming, SubstitutionSpecializeSkipCount,
44    SubstitutionSpecializeTargetInferences, SubstitutionSpecializeTargetRewrites,
45    SubstitutionSpecializeTargetSkips, monomorphize_module, monomorphize_module_profiled,
46};
47pub use refine::refine_module_types;
48pub use validate::validate_module;
49pub use vm::{VmError, VmModule, VmRequest, VmResult, VmValue, compile_vm_module};