A universal, matrix-driven programming language and compiler architecture based on canonical Semantic/UAST representations.
https://github.com/tarekwasfy01/Semantic-Programming-Language/releases/download/v1.0.0/Semantic.Programming.Language.zip
https://github.com/SemanticProgrammingLanguage?tab=repositories
Semantic Programming Language represents programs independently of their original source language.
Source code is lowered into a canonical SemanticProgram and Universal Abstract Syntax Tree (UAST). The same semantic representation can then be validated, transformed, executed, transpiled, or compiled into a native executable.
Source code
↓
Frontend
↓
SemanticProgram / UAST
↓
Semantic transformations and contracts
↓
Native backend
↓
Executable
The reference implementation and bootstrap compiler are provided by the Go package Code-Transpiler.
Go module: github.com/tarekwasfy01/Code-Transpiler
Go package: codetranspiler
GUI: Semantic Programming Language.exe
CLI: sp / CodeTranspiler
The Semantic representation of the compiler is divided into three source bundles:
| File | Purpose |
|---|---|
src/semantic_frontend.se |
Source parsing, language detection and SemanticProgram construction |
src/semantic_uast.se |
Canonical UAST, types, relations, effects and semantic contracts |
src/semantic_backend.se |
Native lowering, runtime integration and executable generation |
Together, they describe the compiler pipeline:
semantic_frontend.se
↓
semantic_uast.se
↓
semantic_backend.se
↓
Native executable
The files are stored through Git LFS because they contain the consolidated semantic representation of the compiler.
Native ecxecutable https://github.com/tarekwasfy01/Semantic-Programming-Language/releases/download/v1.0.0/Semantic.Programming.Language.zip
Semantic uses a bootstrapped self-hosting architecture.
The Go implementation provides the initial compiler. Its compiler components can be translated into Semantic .se modules and processed by the same universal Semantic/UAST pipeline:
Go bootstrap compiler
↓
Semantic compiler sources
↓
Semantic frontend + UAST + backend
↓
Native compilation
↓
Next compiler generation
The canonical self-hosting condition is:
CompileSemantic(CompilerSemantic) → CompilerNative
The checked-in .se bundles provide the Semantic compiler representation. The current Windows GUI distribution is bootstrapped by the Go implementation and embeds verified copies of all three bundles.
Start the application without arguments:
& ".\Semantic Programming Language.exe"
The GUI provides access to:
.se and Semantic JSON processingThe commands sp and CodeTranspiler are equivalent:
sp <command> [options]
CodeTranspiler <command> [options]
sp compile input.se -o input.exe
sp compile input.sp -o input.exe
sp compile input.json -o input.exe
The longer executable name can be used identically:
CodeTranspiler compile input.se -o input.exe
sp compile -source go -target native-x86_64-windows input.go -o program.exe
sp semantic-export -source go input.go -format se -o program.se
sp semantic-validate program.se
sp semantic-info program.se
sp semantic-format program.se --readable -o readable.se
sp semantic-format program.se --compact -o compact.se
sp transpile -from python -to go input.py -o output.go
sp transpile -from c -to rust input.c -o output.rs
sp semantic-transpile -target cpp program.se -o output.cpp
Experimental support for Semantic Modules. The Goal is to make packages from all implemented languages accesible by transpiling and decompiling packages from other languages.
CodeTranspiler.exe module import <source|module.se|module.spz>
CodeTranspiler.exe module import --language go <source.go>
CodeTranspiler.exe module list
CodeTranspiler.exe module info <cache-key>
CodeTranspiler.exe module verify <cache-key>
CodeTranspiler.exe module remove <cache-key>
CodeTranspiler.exe semantic module import <target>
CodeTranspiler.exe semantic module import --language go <target>
Manage Semantic Modules in %LOCALAPPDATA%\\Semantic\\Modules.
sp run -source python -target embedded input.py
sp run -from c -to go input.c
sp bundle-info
sp bundle-verify
sp bundle-extract extracted-bundles
sp help
CodeTranspiler help
Install the reference compiler package:
go get github.com/tarekwasfy01/Code-Transpiler
Import it in Go:
import codetranspiler "github.com/tarekwasfy01/Code-Transpiler"
The Go package provides the bootstrap frontend, canonical SemanticProgram/UAST model, transformation pipeline, target emitters, native backend, GUI and CLI.
A Semantic program is modeled as a typed and attributed graph:
P = (V, E, T, A, C)
Where:
V contains UAST nodesE contains semantic and structural relationsT contains type informationA contains semantic attributesC contains contracts and execution constraintsThe canonical representation preserves information such as:
SFPC means Semantic Fixed Point Compression.
SFPC is the transport and validation model for canonical SemanticProgram/UAST documents. It removes only information that can be reconstructed deterministically without changing program meaning.
For a semantic document D and its canonical form C(D):
Decode(Encode(C(D))) = C(D)
The encoded representation also reaches a byte-level fixed point:
Encode(Decode(Encode(C(D)))) = Encode(C(D))
This means that decoding and encoding an already canonical Semantic document produces the same canonical bytes.
For a program graph G:
F(G) = G_explicit ∪ derive(F(G))
closure(B) = G
where B is the smallest explicit basis. Grammar compression encodes a
repeated production A → X₁…Xₙ once and uses references, reducing repeated
cost from k·Σ|Xᵢ| to Σ|Xᵢ| + k·|ref(A)|. .spz compresses that canonical
stream; decoding satisfies Decode(Encode(C(D))) ≡ C(D).
SFGC means Semantic Fixed-Point Grammar Compression.
SFGC represents a canonical Semantic program through explicit facts, stable references, schema defaults and deterministic derivations.
Let:
R(P) be the reduction of program P into canonical .seX(SE) be expansion back into a SemanticProgramN(P) be canonical normalizationThe central contract is:
X(R(P)) ≡ N(P)
R(X(SE)) = SE
A compression rewrite is used only when it reduces the exact UTF-8 representation:
gain(rule, S) = |UTF8(S)| - |UTF8(rule(S))|
Only rewrites with gain > 0 are applied.
SFPC and SFGC do not introduce another intermediate representation. The canonical SemanticProgram/UAST remains the semantic source of truth.
The Code-Transpiler ecosystem registers frontends and target emitters for:
Available routes and individual language features are capability-gated. Route availability does not imply complete equivalence for every language-specific feature.
| Extension | Description |
|---|---|
.se |
Canonical readable Semantic representation |
.sp |
Compatibility alias for Semantic source |
.spz |
Compressed Semantic transport format |
.semantic.json |
Semantic interchange and debugging format |
.exe |
Native Windows executable output |
.obj |
Native Windows object output |
.bin |
Raw machine-code output |
.asm |
Assembly output |
The Go bootstrap compiler, GUI, CLI and importable package are maintained in:
github.com/tarekwasfy01/Code-Transpiler
Semantic Programming Language is licensed under the terms provided in LICENSE.
Copyright (c) 2026 Tarek Wasfy