module Rubellite::Spinel::Transpiler

Overview

Lightweight Ahead-Of-Time C99 transpiler for Ruby compute kernels. Translates a typed, performance-focused subset of Ruby (loops, branches, scalar math, and array buffer lookups) into high-performance C.

Defined in:

rubellite/spinel/transpiler.cr

Class Method Summary

Class Method Detail

def self.c_code?(source : String) : Bool #

Checks if the provided code is already native C code.


[View source]
def self.transpile(source : String, func_name : String, param_names : Array(String), param_c_types : Array(String), ret_c_type : String) : String #

Transpiles Ruby source or formats C code into an exported C99 compilation unit.


[View source]
def self.wrap_raw_c(source : String, primary_func : String) : String #

Wraps raw C source code with necessary headers and export macros


[View source]