Skip to content

Module Reference

This page lists the currently documented Wist frontend module aliases and their broad responsibilities.

For module authoring guidance, read Writing Modules. This page is a reference index, not a tutorial. For a complete beginner-friendly walkthrough, read Create Your First Module.

Alias source

Module aliases are declared through DialectModuleAliasAttribute.

The attribute accepts one or more aliases:

csharp
[DialectModuleAlias("Arithmetic")]

Most Wist frontend modules also expose themselves through:

csharp
[DialectRuntimeExport("FrontendModule", "...")]

Runtime export metadata is what lets dialect/runtime composition select concrete runtime components.

Common frontend modules

The following aliases are used by the current Wist module coverage tests and module implementations.

AliasBroad responsibilityTypical owner evidence
Whitespaceswhitespace lexeme handlingwhitespace module
SemicolonAsNewLinesemicolon/newline normalizationsemicolon module
Commentscomment lexemescomments module
Numbersnumeric literal lexemes and number AST translationNumbersModuleImpl
Identifieridentifier lexemes and identifier handlingidentifier module
Arithmeticarithmetic operator lexemes, parser creators and visitorsArithmeticModuleImpl
TextualAdditiontextual plus operator that lowers to arithmetic additionTextualAdditionModuleImpl
Equalityequality operationsequality module
Conditionsif / elif / else conditional syntaxConditionsModuleImpl
ComparisonConditionscomparison operations such as <, <=, >, >=comparison condition module
BooleanConditionsboolean operations such as and/or/notboolean condition module
Loopswhile and for syntaxLoopsModuleImpl
Variableslet, assignment and local variable behaviorVariablesModuleImpl
Scopesgrouped scopes and parenthesized bodiesscopes module
Labelslabel-related control constructslabels module
InternalPreprocessorLexemesinternal preprocessing lexeme supportinternal preprocessor module
CSharpInteroptrusted C# interop surfaceC# interop module

Native and specialized modules

Additional modules exist for specialized profiles:

AliasBroad responsibility
NativeTypesnative type-oriented execution/profile support
SafeMathFunctionssafe math function surface
FunctionCallsfunction call syntax/runtime support
ParametersSetterparameter-setting syntax/runtime support

These should be used only when the dialect actually needs the corresponding surface.

Optimizer aliases

Optimizers are separate from frontend modules and use DialectOptimizerAliasAttribute.

Examples visible in current code include:

AliasBroad responsibility
ArithmeticOptimizationarithmetic intrinsic lowering and peephole simplification
NativeCilOptimizationtyped native CIL-oriented constant loading
NativeTypesOptimizationnative type optimization support
EGraphOptimizatione-graph-inspired arithmetic/profile optimization support
BooleanOptimizationboolean intrinsic optimization support
ComparisonIntrinsicOptimizationcomparison intrinsic optimization support

Optimizer aliases are enabled through dialect optimizer directives, not through use module directives.

Module responsibilities

A frontend module may contribute:

  • lexeme registrations;
  • parser node creators;
  • AST visitors;
  • bytecode post-processing;
  • capability providers;
  • runtime export metadata.

A module should own only the syntax and semantics it introduces.

Dependencies are not automatic magic

Some modules are useful only with related modules.

Examples:

  • Variables usually requires Identifier.
  • Loops usually requires variables and comparisons to be useful.
  • Conditions often requires equality or comparison modules depending on the condition expression.
  • TextualAddition is useful with Arithmetic, Numbers, Scopes and Whitespaces in the first-module tutorial.
  • CSharpInterop belongs to trusted/full profiles, not restricted user-facing formula DSLs.

Dialect authors are responsible for selecting coherent module sets and testing omitted syntax.

Stability note

This page is a curated reference, not an automatically generated catalog. When adding a new module, update this page only after confirming the module's alias, runtime export and intended responsibility from code.

Built for developers who want to use, extend, or understand UniversalToolchain.