Skip to content

Ditto-OS/Ditto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ditto

The Universal Translator

A single, portable ~10MB binary that runs code from any language without requiring users to install runtimes.

The Magic

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.

Quick Start

Run Code Directly

# 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

Create Standalone Executables

# Bundle into a single binary
Ditto bundle script.py -o myapp
Ditto bundle app.js -o myapp

List Supported Languages

Ditto languages

Commands

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

Supported Languages

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 Matrix

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

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    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           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Structure

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

Building

# Windows
.\scripts\build.ps1

# Linux/macOS
./scripts/build.sh

# Manual
go build -o Ditto.exe ./cmd/ditto

Examples

Python with Standard Library

import 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")

JavaScript with require()

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();

SQL with JOINs

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;

Comparison

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

What's Embedded

Python Standard Library

  • 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

Node.js Standard Library

  • 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

License

MIT

Contributing

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

About

Run anything with Ditto.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors