ale_call - Erlang interface to the Aleph Rust compiler binary
This module provides functions to convert Aleph ASTs (in Erlang terms) into JSON and call the Rust Aleph compiler to generate code. It supports configuring the Rust binary path and specifying output type. -------------------------------------------------------------------call_rust_generator_direct/1 | Call Rust compiler using OS command, piping the JSON AST via echo and reading output. |
call_rust_generator_direct/2 | |
call_rust_generator_port/1 | Call Rust compiler using Erlang port for better IO control. |
call_rust_generator_port/2 | |
check_rust_generator/0 | Check if the Rust Aleph compiler executable exists and is a file. |
diagnostic_info/0 | Print diagnostic information about the Rust compiler configuration. |
generate/1 | Generate code from an Aleph AST. |
generate/2 | Generate code from an Aleph AST with specified output type. |
generate_from_file/1 | Generate code from a JSON file. |
generate_from_file/2 | Generate code from a JSON file with specified output type. |
get_rust_generator_path/0 | Get the Rust Aleph compiler executable path. |
set_rust_generator_path/1 | Set the file path of the Rust Aleph compiler executable. |
call_rust_generator_direct(JsonAST) -> any()
Call Rust compiler using OS command, piping the JSON AST via echo and reading output. Defaults to output type "ale". -spec call_rust_generator_direct(binary() | string()) -> {ok,binary()} | {error,term()} -spec call_rust_generator_direct(binary() | string(), string()) -> {ok,binary()} | {error,term()} ===================================================================
call_rust_generator_direct(JsonAST, OutputType) -> any()
call_rust_generator_port(JsonAST) -> any()
Call Rust compiler using Erlang port for better IO control. Sends compact single-line JSON, receives output from stdout. Defaults to output type "ale". -spec call_rust_generator_port(binary() | string()) -> {ok,binary()} | {error,term()} -spec call_rust_generator_port(binary() | string(), string()) -> {ok,binary()} | {error,term()} ===================================================================
call_rust_generator_port(JsonAST, OutputType) -> any()
check_rust_generator() -> any()
Check if the Rust Aleph compiler executable exists and is a file. Returns {ok, Path} or {error, not_found}. -spec check_rust_generator() -> {ok,string()} | {error,not_found} ===================================================================
diagnostic_info() -> any()
Print diagnostic information about the Rust compiler configuration. -spec diagnostic_info() -> ok ===================================================================
generate(AlephAST) -> any()
Generate code from an Aleph AST. Uses "ale" as the default output type. -spec generate(term()) -> {ok,binary()} | {error,term()} ===================================================================
generate(AlephAST, OutputType) -> any()
Generate code from an Aleph AST with specified output type. -spec generate(term(), string()) -> {ok,binary()} | {error,term()} ===================================================================
generate_from_file(JsonFile) -> any()
Generate code from a JSON file. Uses "ale" as the default output type. -spec generate_from_file(string()) -> {ok,binary()} | {error,term()} ===================================================================
generate_from_file(JsonFile, OutputType) -> any()
Generate code from a JSON file with specified output type. Reads JSON content then passes to Rust compiler. -spec generate_from_file(string(), string()) -> {ok,binary()} | {error,term()} ===================================================================
get_rust_generator_path() -> any()
Get the Rust Aleph compiler executable path. Checks process dictionary, then environment variable ALEPHC_BIN, else returns the default path. -spec get_rust_generator_path() -> string() ===================================================================
set_rust_generator_path(Path) -> any()
Set the file path of the Rust Aleph compiler executable. Stored in the process dictionary for current process. -spec set_rust_generator_path(string()) -> ok ===================================================================
Generated by EDoc