Skip to content

Ditto-OS/Ditto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ditto

The Universal Translator & Package Manager

Go Report Card

A single, portable ~10MB binary that runs code from any language AND manages packages from any registry 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 Rust compiler needed
βœ… No external dependencies
βœ… Built-in offline package manager
βœ… UNIVERSAL package manager (PyPI, npm, RubyGems, crates.io, Go)
βœ… WASM runtime support (downloadable)

Just Ditto β€” a single binary with embedded interpreters AND package managers.

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

Install Packages (Universal)

# Search for embedded packages
Ditto search requests
Ditto search lodash --lang js
Ditto search rails --lang ruby   # NEW: Ruby support
Ditto search tokio --lang rust   # NEW: Rust support

# Install packages from ANY registry
Ditto install requests        # Python (PyPI)
Ditto install lodash          # JavaScript (npm)
Ditto install rails --lang ruby        # Ruby (RubyGems) - NEW!
Ditto install tokio --lang rust        # Rust (crates.io) - NEW!
Ditto install github.com/gorilla/mux --lang go  # Go modules - NEW!

# List installed packages (all languages)
Ditto packages

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
install <package> Install a package (offline from embedded)
uninstall <package> Remove an installed package
packages List all installed packages
search <query> Search for embedded packages
languages List all supported languages
version Show version
help Show help

🎯 Unified Workflow (Go Report Card: A+)

Ditto provides a single unified workflow for all programming languages:

# 1. Install packages from ANY registry
Ditto install <package> --lang <language>

# 2. Run code with smart language detection
Ditto run <file>

# 3. Bundle into standalone executables
Ditto bundle <file> -o <output>

# 4. Manage all packages
Ditto packages        # List installed packages
Ditto uninstall <pkg> # Remove packages
Ditto search <query>  # Search packages

🌍 One Command, All Languages

# Python workflow
Ditto install requests --lang python
Ditto run script.py

# JavaScript workflow
Ditto install lodash --lang javascript
Ditto run app.js

# Ruby workflow (NEW!)
Ditto install rails --lang ruby
Ditto run app.rb

# Rust workflow (NEW!)
Ditto install tokio --lang rust
Ditto run main.rs

# Go workflow (NEW!)
Ditto install github.com/gorilla/mux --lang go
Ditto run main.go

Supported Languages & Package Managers

Language Extension Interpreter Package Manager Status
Python .py βœ… Pure Go VM βœ… PyPI 🟒 Fully Working
JavaScript .js, .ts βœ… Pure Go VM βœ… npm 🟒 Fully Working
Ruby .rb βœ… Pure Go VM βœ… RubyGems 🟒 NEW: Integrated
Rust .rs βœ… Pure Go VM βœ… crates.io 🟒 NEW: Integrated
Go .go βœ… Pure Go VM βœ… Go Modules 🟒 NEW: Integrated
Lua .lua βœ… Pure Go VM (Basic) 🟑 Working
SQL .sql βœ… Pure Go SQLite (None) 🟑 Working
C/C++ .c, .cpp βœ… Pure Go VM (None) 🟑 Working

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
Embedded Packages βœ… Offline package manager
import requests βœ… Embedded Python package
require('lodash') βœ… Embedded JavaScript package
Universal Package Manager βœ… NEW: PyPI, npm, RubyGems, crates.io, Go
gem install rails βœ… NEW: RubyGems support
cargo add tokio βœ… NEW: crates.io support
go get github.com/... βœ… NEW: Go modules support
Cross-language packages βœ… NEW: Manage all languages in one tool

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Ditto Binary (~10MB)                     β”‚
β”‚          The World's First Universal Package Manager          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚              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                             β”‚   β”‚
β”‚  β”‚  β€’ Ruby VM      (NEW: 520 lines pure Go)            β”‚   β”‚
β”‚  β”‚    - Ruby stdlib: kernel, fileutils                  β”‚   β”‚
β”‚  β”‚    - require() support                              β”‚   β”‚
β”‚  β”‚    - Class definitions                              β”‚   β”‚
β”‚  β”‚  β€’ Rust VM      (NEW: 480 lines pure Go)            β”‚   β”‚
β”‚  β”‚    - Cargo-like package management                 β”‚   β”‚
β”‚  β”‚    - Async/await support                            β”‚   β”‚
β”‚  β”‚  β€’ Go VM        (NEW: 450 lines pure Go)            β”‚   β”‚
β”‚  β”‚    - Basic go.mod support                           β”‚   β”‚
β”‚  β”‚    - Package imports                                β”‚   β”‚
β”‚  β”‚  β€’ 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           β”‚   β”‚
β”‚  β”‚  β€’ Ruby: kernel, fileutils (NEW)                    β”‚   β”‚
β”‚  β”‚  β€’ Rust: std, async (NEW)                           β”‚   β”‚
β”‚  β”‚  β€’ Go: fmt, os, net (NEW)                           β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚       UNIVERSAL PACKAGE MANAGER (NEW!)               β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  βœ… PyPI Client      - pip install equivalent        β”‚   β”‚
β”‚  β”‚  βœ… npm Client       - npm install equivalent        β”‚   β”‚
β”‚  β”‚  βœ… RubyGems Client  - gem install equivalent        β”‚   β”‚
β”‚  β”‚  βœ… crates.io Client - cargo add equivalent         β”‚   β”‚
β”‚  β”‚  βœ… Go Proxy Client  - go get equivalent             β”‚   β”‚
β”‚  β”‚  βœ… GitHub Downloader - direct repo downloads       β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚          Embedded Packages (Offline)                 β”‚   β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€   β”‚
β”‚  β”‚  Python: requests, numpy, flask                     β”‚   β”‚
β”‚  β”‚  JavaScript: lodash, express, axios                 β”‚   β”‚
β”‚  β”‚  Ruby: rails, sinatra (NEW - planned)               β”‚   β”‚
β”‚  β”‚  Rust: tokio, serde (NEW - planned)                β”‚   β”‚
β”‚  β”‚  Go: gin, gorilla/mux (NEW - planned)              β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

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
β”‚   β”œβ”€β”€ packager/           # Embedded package manager
β”‚   β”‚   β”œβ”€β”€ packager.go     # Package installation (PyPI/npm)
β”‚   β”‚   └── embed.go        # Embedded packages (offline)
β”‚   └── runner/             # Execution engine
β”œβ”€β”€ examples/               # Test scripts
β”œβ”€β”€ scripts/                # Build scripts
└── go.mod

Total: ~4,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")

Python with Embedded Packages

# Install first: Ditto install requests
import requests

# Make HTTP requests (embedded implementation)
response = requests.get("https://api.example.com/data")
print(response.text)

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

JavaScript with Embedded Packages

// Install first: Ditto install lodash
const _ = require('lodash');

const arr = [1, 2, 3, 4, 5];
const chunked = _.chunk(arr, 2);
console.log(chunked); // [[1,2], [3,4], [5]]

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

πŸ“¦ Universal Package Manager

Ditto includes the world's first universal package manager that supports ALL major programming languages in a single binary!

🌍 Supported Package Registries

Registry Language Command Example Status
PyPI Python Ditto install requests --lang python βœ… FULLY WORKING
npm JavaScript Ditto install lodash --lang javascript βœ… FULLY WORKING
RubyGems Ruby Ditto install rails --lang ruby βœ… INTEGRATED
crates.io Rust Ditto install tokio --lang rust βœ… INTEGRATED
Go Proxy Go Ditto install github.com/gorilla/mux --lang go βœ… INTEGRATED
GitHub Any Ditto install github.com/user/repo --lang github βœ… INTEGRATED

πŸš€ Universal Installation Examples

# Python - Install from PyPI
Ditto install requests --lang python
Ditto install numpy --lang py
Ditto install flask --lang python

# JavaScript - Install from npm
Ditto install lodash --lang javascript
Ditto install express --lang js
Ditto install axios --lang npm

# Ruby - Install from RubyGems (NEW!)
Ditto install rails --lang ruby
Ditto install sinatra --lang rb
Ditto install json --lang ruby

# Rust - Install from crates.io (NEW!)
Ditto install tokio --lang rust
Ditto install serde --lang rs
Ditto install rand --lang rust

# Go - Install modules from GitHub (NEW!)
Ditto install github.com/gorilla/mux --lang go
Ditto install github.com/gin-gonic/gin --lang golang
Ditto install github.com/user/repo --lang go

# GitHub - Direct repository installation (NEW!)
Ditto install github.com/user/amazing-project --lang github
Ditto install github.com/org/repo --lang github

πŸ”§ Package Management Commands

# Search for packages
Ditto search web --lang ruby        # Search Ruby web frameworks
Ditto search async --lang rust      # Search Rust async libraries
Ditto search http --lang py         # Search Python HTTP packages

# Install packages
Ditto install <package> --lang <language>

# List installed packages (all languages)
Ditto packages

# Uninstall packages
Ditto uninstall <package> --lang <language>

# Check installed packages
Ditto packages

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

Ruby Standard Library (NEW!)

  • kernel: require, load, puts, print
  • fileutils: mkdir_p, rm_rf, cp_r
  • json: parse, generate

Rust Standard Library (NEW!)

  • std: vec, option, result
  • async: futures, tokio integration
  • serde: serialization support

Go Standard Library (NEW!)

  • fmt: Printf, Sprintln
  • os: File operations
  • net/http: Basic HTTP client

Embedded Python Packages (Offline)

  • requests: HTTP library (get, post, put, delete)
  • numpy: Numerical computing (array, zeros, ones, math functions)
  • flask: Web framework (Flask app, routes, request, jsonify)

Embedded JavaScript Packages (Offline)

  • lodash: Utility library (chunk, compact, map, filter, etc.)
  • express: Web framework (Express app, routes, middleware)
  • axios: HTTP client (get, post, put, delete)

Embedded Ruby Packages (Planned)

  • rails: Web framework
  • sinatra: Lightweight web framework
  • json: JSON parsing

Embedded Rust Crates (Planned)

  • tokio: Async runtime
  • serde: Serialization
  • rand: Random number generation

Embedded Go Modules (Planned)

  • gin: Web framework
  • gorilla/mux: HTTP router
  • gorm: ORM

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
  • More embedded packages
  • WASM runtime integration (MicroPython, QuickJS)