The Universal Translator
A single, portable ~10MB binary that runs code from any language without requiring users to install runtimes.
Zero-Config Polyglot Execution
β
No Python installation needed
β
No Node.js installation needed
β
No Ruby installation needed
β
No Go toolchain needed
β
No external dependencies
Just Ditto β a single binary with embedded interpreters.
# Smart detection - just run it
Ditto run script.py # Auto-detects Python
Ditto run app.js # Auto-detects JavaScript
Ditto run program.lua # Auto-detects Lua
Ditto run query.sql # Auto-detects SQL
Ditto run main.c # Auto-detects C# Bundle into a single binary
Ditto bundle script.py -o myapp
Ditto bundle app.js -o myappDitto languages| Command | Description |
|---|---|
run <file> |
Run code with smart language detection |
bundle <file> -o <name> |
Create standalone executable |
languages |
List all supported languages |
version |
Show version |
help |
Show help |
| Language | Extension | Interpreter | Features |
|---|---|---|---|
| Python | .py |
Pure Go VM | print, import, classes, math, os, sys |
| JavaScript | .js, .ts |
Pure Go VM | console, require, async/await, fs, path |
| Lua | .lua |
Pure Go VM | print, tables, functions, loops |
| SQL | .sql |
Pure Go SQLite | CREATE, INSERT, SELECT, JOIN, WHERE |
| C/C++ | .c, .cpp |
Pure Go VM | printf, variables, loops |
| Ruby | .rb |
(Planned) | π Coming |
| Go | .go |
(Planned) | π Coming |
| Feature | Status | Implementation |
|---|---|---|
import os (Python) |
β | Embedded stdlib |
import math (Python) |
β | Embedded stdlib |
from os import getcwd |
β | Embedded stdlib |
| Classes (Python) | β | Class definitions supported |
require('fs') (Node) |
β | Embedded stdlib |
require('path') (Node) |
β | Embedded stdlib |
async/await |
β | Syntax support |
console.log |
β | Embedded console |
| Complex SQL JOINs | β | Full JOIN support |
| SQL WHERE clauses | β | Comparison operators |
| SQL INSERT/UPDATE/DELETE | β | Full CRUD |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Ditto Binary (~10MB) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Embedded Interpreters β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β β’ Python VM (670 lines pure Go) β β
β β - Standard library: math, os, sys β β
β β - Class definitions β β
β β - Import statements β β
β β β’ JavaScript VM (600 lines pure Go) β β
β β - Node.js stdlib: fs, path, os, console β β
β β - require() support β β
β β - async/await syntax β β
β β β’ Lua VM (470 lines pure Go) β β
β β β’ SQL Engine (560 lines pure Go) β β
β β - JOIN queries β β
β β - WHERE clauses β β
β β β’ C VM (320 lines pure Go) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Standard Library (400 lines pure Go) β β
β β β’ Python: math, os, sys builtins β β
β β β’ Node.js: fs, path, os, console, events β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Ditto/
βββ cmd/ditto/ # CLI entry point
βββ internal/
β βββ config/ # Configuration
β βββ interpreter/ # Embedded interpreters
β β βββ interpreter.go # Engine (110 lines)
β β βββ python.go # Python VM (670 lines)
β β βββ javascript.go # JS VM (600 lines)
β β βββ lua.go # Lua VM (470 lines)
β β βββ sql.go # SQL engine (560 lines)
β β βββ c.go # C VM (320 lines)
β βββ stdlib/ # Standard libraries
β β βββ stdlib.go # Python + Node stdlib (400 lines)
β βββ runtime/ # WASM runtime management
βββ pkg/
β βββ archive/ # Bundle creation
β βββ bundler/ # Standalone creator
β βββ runner/ # Execution engine
βββ examples/ # Test scripts
βββ scripts/ # Build scripts
βββ go.mod
Total: ~3,500 lines of pure Go code
# Windows
.\scripts\build.ps1
# Linux/macOS
./scripts/build.sh
# Manual
go build -o Ditto.exe ./cmd/dittoimport math
import os
print("sqrt(16) =", math.sqrt(16))
print("Current dir:", os.getcwd())
class Person:
def __init__(self, name):
self.name = name
p = Person("Alice")const fs = require('fs');
const path = require('path');
console.log("Current dir:", path.resolve('.'));
async function fetchData() {
await Promise.resolve("data");
console.log("Done!");
}
fetchData();CREATE TABLE users (id INTEGER, name TEXT);
CREATE TABLE orders (id INTEGER, user_id INTEGER, product TEXT);
SELECT users.name, orders.product
FROM users
JOIN orders ON users.id = orders.user_id;| Tool | Size | Languages | Dependencies |
|---|---|---|---|
| Ditto | ~10MB | 5+ | None |
| pyinstaller | ~50MB | Python only | Python |
| pkg | ~80MB | Node.js only | Node.js |
| Docker | ~500MB+ | Any | Docker Desktop |
- math: sqrt, pow, ceil, floor, abs, sin, cos, tan, pi, e
- os: getcwd, chdir, mkdir, remove, exists, getenv, name, sep
- sys: version, platform, argv, exit, maxsize
- fs: readFileSync, writeFileSync, existsSync, mkdirSync
- path: join, resolve, dirname, basename, extname
- os: platform, arch, homedir, tmpdir, hostname
- console: log, info, warn, error, debug
- process: argv, env, cwd, exit, pid, version
MIT
Contributions welcome! Areas for improvement:
- Complete Python class method support
- Full async/await runtime
- More Node.js modules (http, crypto, events)
- Ruby interpreter
- Go interpreter