Precompiler
Precompiler
Describes the concept of a "precompiler," which is used by Elide to transform input code material (either source code or bytecode) into a form that is supported by the runtime or more efficiently consumed by the runtime.
Precompilers are typically implemented to transform code written in a high-level language (e.g., TypeScript, Kotlin) into code which is directly executable by a language engine (e.g. JavaScript, JVM bytecode).
Two major types of precompilers are supported by Elide:
SourcePrecompiler: Responsible for transforming a String of source code into another String of source code. This is the base type for transformation cases like the TypeScript example above.
BytecodePrecompiler: Responsible for transforming a String of source code into a ByteBuffer of bytecode. This is the base type for transformation cases like the Kotlin example above.
In all cases, precompiler steps run immediately after code is loaded and immediately before it is evaluated for execution. Precompilers are only loaded once per run and are only loaded if needed.
Parameters
Configuration type for this precompiler.
Input type accepted by this precompiler.
Output type produced by this precompiler.
Inheritors
Types
Base interface for precompiled bundles of code.
Accepts code in the form of a simple String, and is expected to return transformed code in the form of a file which acts as an executable bundle (for example, a JAR).
Accepts code in the form of a simple String, and is expected to return transformed code in the form of a buffer containing raw bytecode which is directly executable by the runtime.
Base interface for precompiler configurations.
Holds information about the source code being precompiled.
Represents a request from the engine to precompile source code.
Functions
Precompile the input using this precompiler.
Precompile using the provided inputs,