pub mod rust_codegen;
#[cfg(feature = "cranelift")]
pub mod cranelift;
pub use rust_codegen::{CompiledRustFunction, RustCodeGenerator, RustCompiler, RustOptLevel};
#[cfg(feature = "cranelift")]
pub use cranelift::{CompilationStats, JITCompiler, JITFunction, JITSignature};
pub trait CompilationBackend {
type CompiledFunction;
type Error;
fn compile(
&mut self,
expr: &crate::final_tagless::ASTRepr<f64>,
) -> Result<Self::CompiledFunction, Self::Error>;
}
#[derive(Debug, Clone, PartialEq)]
pub enum BackendType {
RustHotLoad,
#[cfg(feature = "cranelift")]
Cranelift,
}
impl Default for BackendType {
fn default() -> Self {
Self::RustHotLoad
}
}