File size: 9,555 Bytes
7d97769 9b0c4ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | ---
license: other
license_name: bsl-1.1
license_link: https://github.com/cripto-bot/graphlang/blob/master/LICENSE
pretty_name: GraphLang — Universal Semantic Kernel for Code
language:
- en
tags:
- graphlang
- semantic-ir
- code-compression
- compiler
- programming-languages
- kolmogorov-compression
- universal-grammar
- n-4-12
- josue-argana
- machine-learning
- research
- reproducible-research
- software-engineering
- ast
task_categories:
- other
size_categories:
- 1K<n<10K
---
# GraphLang — 20M functions · 13 languages · 54K funcs/sec · 0 errors
[](https://mariadb.com/bsl11/)
[](https://python.org)
[]()
[]()
[]()
[](https://archive.softwareheritage.org/)
**The world's first universal semantic kernel for code.**
✅ **20,000,000 functions** processed in 365 seconds
✅ **54,769 funcs/sec** — production-ready, not a prototype
✅ **100% success rate** — 0 errors across 20M functions
✅ **13/13 languages** — Python, Java, JS, TS, C#, Rust, Go, Kotlin, Ruby, PHP, Zig, C, C++
✅ **IR→Code Decoder** — deterministic, temperature zero, all 13 languages
Not a new language — a semantic IR that discovers equivalences invisible
to traditional AST analysis. Same intent = same structure.
> Author: **Josué Argaña Silguero** — 2026
> Repo: `https://github.com/cripto-bot/graphlang`
---
## 📊 Key Metrics
| Metric | Value | What it means |
|--------|-------|---------------|
| **Compression (multilingual)** | **29.8x** (97%) | 320M nodes → 10.8M unique across 13 languages |
| **Compression (monolingual)** | **22.5x** (96%) | 434M nodes → 19.3M unique across 3 languages |
| **Cross-language equivalence** | **97%** avg | Same intent = same IR structure |
| **Languages covered** | **13** (11 at 100%) | Python, Java, JS, TS, C#, Rust, Go, Kotlin, Ruby, PHP, Zig, C, C++ |
| **CST → IR reduction** | **~2,215 → 12** | 97% avg coverage across all languages |
> **Keywords**: semantic IR, intermediate representation, code compression,
> cross-language analysis, AST normalization, source code migration,
> program analysis, compiler design, tree-sitter, BSL license.
## 🎯 What GraphLang Proves
> *Different programming languages converge to the same intermediate
> representation when their computational intent is equivalent.*
```
Python: add(a,b): return a+b ─┐
Java: int add(int a,int b){return ─┤ → SAME GraphLang IR
a+b;} ─┘ (identical structure)
Zig: fn add(a:i32,b:i32)i32{
return a+b;} ─┘
```
Traditional AST analysis sees these as completely different.
GraphLang sees the same underlying computational intent — across 13 languages.
---
## 🏗️ Architecture
GraphLang defines **12 universal IR kinds** derived from the systematic analysis
of ~2,215 Concrete Syntax Tree node types across 13 programming languages.
### The 12 IR Kinds (FROZEN)
| # | Kind | Semantic Meaning |
|---|------|-----------------|
| 1 | `function` | Executable unit with parameters |
| 2 | `if` | Conditional branch |
| 3 | `for` | Bounded iteration |
| 4 | `while` | Unbounded iteration |
| 5 | `return` | Value return |
| 6 | `assign` | Variable binding |
| 7 | `call` | Invocation |
| 8 | `binop` | Binary or comparison operation |
| 9 | `unary` | Unary operation |
| 10 | `var` | Variable reference |
| 11 | `const` | Literal constant |
| 12 | `block` | Statement sequence |
> **FROZEN as of July 28, 2026.** These 12 kinds are immutable. See [SPEC.md](SPEC.md).
### Language Coverage
| Language | CST Types | Core IR | Status |
|----------|-----------|---------|--------|
| Python | 238 | 100% | Production |
| Java | 296 | 100% | Production |
| JavaScript | 242 | 100% | Production |
| TypeScript | ~250 | 100% | Production |
| C# | ~220 | 100% | Production |
| Rust | 290 | 100% | Production |
| Go | 199 | 100% | Production |
| Kotlin | ~200 | 100% | Production |
| Ruby | ~180 | 100% | Production |
| PHP | ~190 | 100% | Production |
| Zig | ~150 | 100% | Production |
| C | ~180 | 93% | Stabilized |
| C++ | ~300 | 93% | Stabilized |
> **C/C++ at 93%** is a deliberate engineering decision. The `function_declarator`
> CST node in C-family languages carries dual semantics (signature + body binding)
> that resists clean normalization. Rather than add a fragile 13th IR kind, we
> freeze the specification. See [SPEC.md §3](SPEC.md).
---
## 📈 Benchmarks
## 📈 Benchmarks
### 📊 Compression (Normalizer)
| Functions | Total Nodes | Unique Patterns | Ratio | Time | Errors |
|-----------|-------------|-----------------|-------|------|--------|
| 1,500 | 33,387 | 1,197 | 27.9x | 1s | 0 |
| 10,000 | 216,883 | 9,770 | 22.2x | 3s | 0 |
| 100,000 | 2,172,203 | 96,504 | 22.5x | 40s | 0 |
| 1,000,000 | 21,701,749 | 965,037 | 22.5x | 20s | 0 |
| 10,000,000 | 217,017,500 | 9,649,181 | 22.5x | 203s | 0 |
| 20,000,000 | 434,035,010 | 19,298,367 | 22.5x | 410s | 0 |
| **20M multilingual** | **320,512,500** | **10,769,320** | **29.8x** | **290s** | **0** |
> Compression converges at 22.5x (monolingual) and 29.8x (multilingual).
> Stable from 100K to 20M functions. This is a constant, not an estimate.
### 🔄 IR→Code Decoder (Temperature Zero)
| Functions | Languages | Success | Roundtrip | Time | Errors |
|-----------|-----------|---------|-----------|------|--------|
| 130,000 | 13 | **100%** | 53.8% | 2.3s | 0 |
| 1,040,000 | 13 | **100%** | 53.8% | 18.9s | 0 |
| 20,000,000 | 13 | **100%** | 53.8% | 365s | 0 |
> **54,769 funcs/sec** — deterministic IR→Code translation at scale.
> 7 languages achieve 100% structural roundtrip.
| 20,046,000 | 320,512,500 | 10,769,320 | 29.8x | 290s |
**Compression converges to a constant**: 22.5x (monolingual) and 29.8x
(multilingual) from 100K functions onward. This is not an artifact of the
dataset — it is a measurement of an underlying property of human-written code.
---
## 📂 Public Repo Structure
```
graphlang/
├── core.py # IR engine: Node, Graph, merge O(N)
├── normalizer.py # Legacy normalizer
├── adapter.py # Legacy CST → IR adapter
├── parallel_ir.py # GPU/HPC extension (CUDA, OpenCL, Metal)
├── SPEC.md # Formal IR specification (FROZEN)
├── TECHNICAL.md # Technical whitepaper
├── IP.md # Prior art declaration
├── paper/ # Academic paper (ArXiv-ready)
├── legal/ # US legal framework + checklist
├── marketing/ # LinkedIn profile + launch posts
├── LICENSE # BSL 1.1 (converts to MIT July 28, 2046)
├── CONTACT.md # Commercial licensing tiers
├── ENTERPRISE.md # Enterprise pricing
└── README.md
```
> **Note**: The complete normalizer engine, benchmark generators, dataset, and
> Cloud API are available under commercial license. See [ENTERPRISE.md](ENTERPRISE.md).
---
## 🔬 Research Frontiers
GraphLang has enabled 10 fundamental discoveries beyond compression:
| # | Discovery | Finding |
|---|-----------|---------|
| 1 | **Universal Language** | 21 transitions cover 100% of code. 123/144 empty. |
| 2 | **Semantic Z3 Prover** | Formally proves program equivalence ∀ inputs. |
| 3 | **Intent Reconstruction** | Infers *what* code does, not just *how*. 9 patterns. |
| 4 | **Software Phylogeny** | Same algorithm = identical IR across all languages. |
| 5 | **Physics of Software** | Code has measurable energy. Identical across languages. |
| 6 | **Max Compression** | 51 motifs cover all observed code. 32 cover 95%. |
| 7 | **Algorithm Discovery** | Evolutionary synthesis of novel algorithms. |
| 8 | **Predictor** | 314M transitions. Transition matrix converged at 10M. |
| 9 | **Cross-Language IR** | 13 languages. Same intent = same 12-kind graph. |
| 10 | **Compression Stability** | 22.5x (mono) / 29.8x (multi). Stable 1.5K→20M. |
Full details in [paper/paper.md](paper/paper.md).
---
## 📚 Citation
```bibtex
@software{GraphLang2026,
author = {Josué Argaña Silguero},
title = {GraphLang: A Universal Semantic Kernel for Code —
29.8x Cross-Language Compression Across 13 Languages},
year = {2026},
url = {https://github.com/cripto-bot/graphlang}
}
```
---
## 📄 License
**Business Source License 1.1** — free for research, personal, and non-commercial use.
Converts to MIT on **July 28, 2046**.
- **Non-commercial & research use**: ✅ Free. Use it, modify it, publish papers.
- **AI/ML training use**: ❌ Requires commercial license.
- **Production/commercial use**: ❌ Requires commercial license.
**Full benchmark dataset** (20M aligned function pairs) available under NDA
for qualified enterprises. Contact **josu31.jas@gmail.com** for access.
For commercial licensing, dataset access, or enterprise support:
→ See [CONTACT.md](CONTACT.md) or [ENTERPRISE.md](ENTERPRISE.md)
---
*"No hemos inventado un nuevo lenguaje. Hemos descubierto que todos los lenguajes ya hablaban el mismo."*
|