Documentation
¶
Overview ¶
Copyright (c) 2026 Tarek Wasfy Package codetranspiler exposes the stable many-to-many Code Transpiler API.
Import path: github.com/tarekwasfy01/Code-Transpiler
Index ¶
- func BinarySemanticJSON(data []byte, options CompileOptions) ([]byte, error)
- func CapabilityMatrixJSON(features []string) ([]byte, error)
- func DecompileSemanticJSON(data []byte, options CompileOptions) ([]byte, error)
- func ImplementationMatrixJSON() ([]byte, error)
- func LanguagesJSON() ([]byte, error)
- func MarshalSemanticSE(program *SemanticProgram) ([]byte, error)
- func MarshalSemanticSP(program *SemanticProgram) ([]byte, error)
- func MarshalSemanticSPZ(program *SemanticProgram) ([]byte, error)
- func NativeAnalysisJSON(source, filename, code string) ([]byte, error)
- func NativeSemanticJSON(source, filename, code string) ([]byte, error)
- func SemanticJSON(source, code string) ([]byte, error)
- func SemanticSE(source, code string) ([]byte, error)
- func SemanticSP(source, code string) ([]byte, error)
- func Transpile(source, target, code string) (string, error)
- func TranspileSemanticJSON(target string, data []byte) (string, error)
- func TranspileSemanticSE(target string, data []byte) (string, error)
- func TranspileSemanticSP(target string, data []byte) (string, error)
- type Capability
- type CompileInputKind
- type CompileOptions
- type CompileOutputKind
- type CompileResult
- type Language
- type SemanticProgram
- type TranspileRequest
- type TranspileTrace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinarySemanticJSON ¶ added in v1.2.8
func BinarySemanticJSON(data []byte, options CompileOptions) ([]byte, error)
BinarySemanticJSON lifts an x86-64 assembly, machine-code, COFF, or PE32+ input through the structured machine frontend and returns the same SemanticProgram JSON used by source-language inputs. Unsupported or ambiguous instructions fail closed instead of being guessed as source.
func CapabilityMatrixJSON ¶ added in v1.0.5
CapabilityMatrixJSON returns status matrices for semantic requirements across all registered targets. Unknown requested features are unsupported.
func DecompileSemanticJSON ¶ added in v1.2.8
func DecompileSemanticJSON(data []byte, options CompileOptions) ([]byte, error)
DecompileSemanticJSON is the public decompilation entry point for binary and assembly inputs. It returns the canonical SemanticProgram JSON emitted by the structured machine frontend, without routing through a source parser.
func ImplementationMatrixJSON ¶ added in v1.0.5
ImplementationMatrixJSON returns typed operations by frontend, JSON, runtime and target implementation stages. Declarations are not execution test results.
func LanguagesJSON ¶
func MarshalSemanticSE ¶ added in v1.2.9
func MarshalSemanticSE(program *SemanticProgram) ([]byte, error)
func MarshalSemanticSP ¶ added in v1.2.8
func MarshalSemanticSP(program *SemanticProgram) ([]byte, error)
MarshalSemanticSP serializes a canonical program as readable SP.
func MarshalSemanticSPZ ¶ added in v1.2.8
func MarshalSemanticSPZ(program *SemanticProgram) ([]byte, error)
MarshalSemanticSPZ returns the optional compressed SP transport.
func NativeAnalysisJSON ¶ added in v1.0.5
NativeAnalysisJSON extracts native types, source spans and symbol relations. Currently supports import-free Go files. This is an analysis artifact, not an executable SemanticProgram; TranspileSemanticJSON intentionally rejects it.
func NativeSemanticJSON ¶ added in v1.0.5
NativeSemanticJSON converts a supported native source subset directly to an executable SemanticProgram. It never retries the legacy textual frontend. Accepts a bounded Go scalar/function subset, including fixed-width integers.
func SemanticJSON ¶
func SemanticSE ¶ added in v1.2.9
SemanticSE is the .se-named alias of the lossless SemanticProgram format.
func SemanticSP ¶ added in v1.2.8
SemanticSP exports a source program as the readable, lossless Semantic Programming transport format.
func TranspileSemanticSE ¶ added in v1.2.9
Types ¶
type Capability ¶
type Capability struct {
Feature string `json:"feature"`
Backend string `json:"backend"`
Status string `json:"status"`
Reason string `json:"reason,omitempty"`
}
func BackendCapability ¶
func BackendCapability(feature, target string) Capability
type CompileInputKind ¶ added in v1.2.1
type CompileInputKind = backend.CompileInputKind
const ( InputSource CompileInputKind = backend.CompileInputSource InputAssembly CompileInputKind = backend.CompileInputAssembly InputMachine CompileInputKind = backend.CompileInputMachine InputObject CompileInputKind = backend.CompileInputObject InputExecutable CompileInputKind = backend.CompileInputExecutable )
type CompileOptions ¶ added in v1.2.1
type CompileOptions = backend.CompileOptions
type CompileOutputKind ¶ added in v1.2.1
type CompileOutputKind = backend.CompileOutputKind
const ( Source CompileOutputKind = backend.CompileSource Assembly CompileOutputKind = backend.CompileAssembly MachineCode CompileOutputKind = backend.CompileMachineCode Object CompileOutputKind = backend.CompileObject Executable CompileOutputKind = backend.CompileExecutable )
type CompileResult ¶ added in v1.2.1
type CompileResult = backend.CompileResult
func Compile ¶ added in v1.2.1
func Compile(source string, options CompileOptions) (CompileResult, error)
Compile uses the same ModernFrontend and canonical UAST as Transpile. Native outputs are encoded in-process; Assembly is an optional rendering.
type Language ¶
type SemanticProgram ¶ added in v1.2.8
type SemanticProgram = backend.SemanticProgram
func ParseSemanticSE ¶ added in v1.2.9
func ParseSemanticSE(data []byte) (*SemanticProgram, error)
func ParseSemanticSP ¶ added in v1.2.8
func ParseSemanticSP(data []byte) (*SemanticProgram, error)
ParseSemanticSP imports a readable SP document into the canonical program.
func ParseSemanticSPZ ¶ added in v1.2.8
func ParseSemanticSPZ(data []byte) (*SemanticProgram, error)
ParseSemanticSPZ imports the optional compressed SP transport.
type TranspileRequest ¶ added in v1.0.6
type TranspileRequest = manytomany.TranspileRequest
TranspileRequest and TranspileTrace expose the same immutable diagnostic boundary used by the bundled GUI and CLI.
type TranspileTrace ¶ added in v1.0.6
type TranspileTrace = manytomany.TranspileTrace
func TranspileWithTrace ¶ added in v1.0.6
func TranspileWithTrace(request TranspileRequest) (string, TranspileTrace, error)
TranspileWithTrace is useful for differential diagnostics: it returns the exact hashes and native/runtime decision made by the common TranspileCore.