compiler

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(srcDir, outFile string) error

Build translates the Go package in srcDir to C and compiles it into outFile. Uses CC (default "cc"), CFLAGS, and LDFLAGS environment variables.

func Run

func Run(srcDir string, args []string) error

Run translates and compiles the Go package in srcDir, then executes it. Returns an *exec.ExitError if the program exits with a non-zero status.

func Translate

func Translate(srcDir string, outDir string) error

Translate loads all Go packages from srcDir (including So stdlib dependencies), translates them to C, and writes the output to outDir.

func Version

func Version() string

Version returns the compiler version string to embed into compiled programs via -Dso_version. It uses the module version from runtime/debug.BuildInfo when available (e.g. go install ...@vx.y.z), falling back to "(devel)" (e.g. go run during development).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL