CLI Reference

The ea binary provides three commands: compile (default), bind, and inspect.

Compile

ea <file.ea> [flags]

Compile an Ea source file to a native object file (.o) by default.

Flags

FlagEffect
-o <name>Link the object file into an executable via cc
--libProduce a shared library (.so/.dll) and metadata (.ea.json)
--opt-level=NOptimization level 0--3 (default: 3)
--avx512Enable AVX-512 vector types and intrinsics. Errors on ARM targets
--target=CPULLVM CPU name, e.g. skylake, znver3, native (default: native)
--target-triple=TCross-compile to a different architecture, e.g. aarch64-unknown-linux-gnu
--emit-llvmWrite LLVM IR to a .ll file and print it to stdout
--emit-asmWrite assembly to a .s file
--headerGenerate a C header (.h) for the exported functions
--emit-astPrint the parsed AST. Does not require LLVM
--emit-tokensPrint the token stream. Does not require LLVM
--help / -hPrint usage information
--version / -VPrint compiler version

Examples

# Compile to object file
ea kernel.ea

# Compile and link to executable
ea kernel.ea -o kernel

# Build shared library for Python/Rust/C++ consumption
ea kernel.ea --lib

# Cross-compile for ARM
ea kernel.ea --lib --target-triple=aarch64-unknown-linux-gnu

# Emit LLVM IR for debugging
ea kernel.ea --emit-llvm

# Compile with AVX-512 support
ea kernel.ea --lib --avx512

# Generate C header
ea kernel.ea --header

Compiler status output goes to stderr, so --emit-llvm stdout is clean for piping.

Bind

ea bind <file.ea> --python [--rust] [--cpp] [--pytorch] [--cmake]

Generate language bindings from a compiled kernel. At least one language flag is required.

Requires the .ea.json metadata file produced by ea <file.ea> --lib. Run the --lib compile first.

Language Flags

FlagOutputDescription
--python<name>.pyPython wrapper using ctypes
--rust<name>.rsRust FFI bindings
--cpp<name>.hppC++ header with inline wrappers
--pytorch<name>_torch.pyPyTorch custom op wrapper
--cmakeCMakeLists.txtCMake build file for C++ integration

Example

# Full workflow: compile, then generate Python bindings
ea kernel.ea --lib
ea bind kernel.ea --python

Inspect

ea inspect <file.ea> [target flags]

Post-optimization analysis of the compiled kernel. Shows instruction mix, loop structure, vector width usage, and register pressure. Accepts the same target flags as compile (--target, --target-triple, --avx512).

Example

ea inspect kernel.ea
ea inspect kernel.ea --avx512
ea inspect kernel.ea --target-triple=aarch64-unknown-linux-gnu
ea --print-target

Print the resolved native CPU name for the current machine. Useful for understanding which CPU features the compiler will target by default.