Overview - Universal Multi-Language Runner

A powerful command-line tool for executing code in 25 programming languages

What is run?

run is a universal multi-language runner and smart REPL (Read-Eval-Print Loop) written in Rust. It provides a unified interface for executing code across 25 programming languages without the hassle of managing multiple compilers, interpreters, or build tools.

Whether you're a beginner learning your first programming language or an experienced polyglot developer, run streamlines your workflow by providing consistent commands and behavior across all supported languages.

Who is this for?

• Beginners: Learn programming without worrying about complex setup procedures. Just install run and start coding in any language.

• Students: Quickly test code snippets and experiment with different programming paradigms across multiple languages.

• Developers: Prototype ideas rapidly, test algorithms, and switch between languages seamlessly without context switching.

• DevOps Engineers: Write and test automation scripts in various languages from a single tool.

• Educators: Teach programming concepts across multiple languages with a consistent interface.

Why was run created?

Traditional development workflows require installing and configuring separate tools for each programming language. This creates several problems:

• Time-consuming setup: Installing compilers, interpreters, package managers, and configuring environments for each language.

• Inconsistent interfaces: Each language has different commands and flags for compilation and execution.

• Cognitive overhead: Remembering different commands and workflows for each language.

• Barrier to entry: Beginners struggle with setup before writing their first line of code.

run solves these problems by providing a single, unified interface that handles all the complexity behind the scenes. You focus on writing code, and run takes care of the rest.

Why Rust?

run is built with Rust for several compelling reasons:

• Performance: Rust's zero-cost abstractions and efficient memory management ensure run starts instantly and executes with minimal overhead.

• Reliability: Rust's strong type system and ownership model prevent common bugs like null pointer dereferences and data races, making run stable and crash-resistant.

• Cross-platform: Rust compiles to native code for Windows, macOS, and Linux, providing consistent behavior across all platforms.

• Memory safety: No garbage collector means predictable performance without unexpected pauses.

• Modern tooling: Cargo (Rust's package manager) makes building and distributing run straightforward.

• Future-proof: Rust's growing ecosystem and industry adoption ensure long-term maintainability.

Supported Languages

run supports 25 programming languages out of the box, covering a wide range of paradigms and use cases:

bash
# Scripting Languages
Python, JavaScript, Ruby, Bash, Lua, Perl, PHP

# Compiled Languages
Rust, Go, C, C++, Java, C#, Swift, Kotlin, Crystal, Zig, Nim

# Typed & Functional Languages
TypeScript, Haskell, Elixir, Julia

# Specialized Languages
R (Statistical computing)
Dart (Mobile development)

Complete Language Aliases Reference

Every language in run has multiple aliases for convenience. Use whichever feels most natural to you:

AliasDescription
python, py, py3, python3Python programming language
javascript, js, node, nodejsJavaScript (Node.js runtime)
typescript, ts, ts-node, denoTypeScript with type checking
rust, rsRust systems programming language
go, golangGo programming language
c, gcc, clangC programming language
cpp, c++, g++C++ programming language
javaJava programming language
csharp, cs, dotnetC# (.NET)
ruby, rb, irbRuby programming language
bash, sh, shell, zshBash shell scripting
lua, luajitLua scripting language
perl, plPerl programming language
php, php-cliPHP scripting language
haskell, hs, ghciHaskell functional language
elixir, ex, exs, iexElixir functional language
julia, jlJulia scientific computing
dart, dartlang, flutterDart language (Flutter)
swift, swiftlangSwift programming language
kotlin, kt, ktsKotlin (JVM/Native)
r, rscript, cranR statistical computing
crystal, cr, crystal-langCrystal language
zig, ziglangZig systems language
nim, nimlangNim programming language
ocamlOCaml functional language
clojure, cljClojure Lisp dialect

Installation

Installing run is straightforward. Choose the method that works best for your system:

Terminal
# Install from crates.io
cargo install run-kit

# Or build from source
git clone https://github.com/Esubaalew/run.git
cd run
cargo install --path .
Terminal
# Verify installation
run --version

Command Variations - Flexible Syntax

run supports multiple command formats to fit your workflow. You can be explicit with --lang or let run auto-detect the language:

Terminal
# 1. Full syntax with --lang and --code
run --lang rust --code "fn main() { println!("hello from rust"); }"
Terminal
# 2. Shorthand flags (-l for --lang, -c for --code)
run -l rust -c "fn main() { println!("hello from rust"); }"
Terminal
# 3. Omit --code flag (auto-detected)
run --code "fn main() { println!("hello from rust"); }"
Terminal
# 4. Shorthand - just the code
run "fn main() { println!("hello from rust"); }"
Terminal
# 5. Language first, then code
run rust "fn main() { println!("hello from rust"); }"

Command-Line Flags Reference

run provides both long-form and short-form flags for convenience:

Terminal
# Language specification
--lang, -l          Specify the programming language
run --lang python "print('hello')"
run -l python "print('hello')"

# Code input
--code, -c          Provide code as a string
run --code "print('hello')"
run -c "print('hello')"

# Combined usage
run -l python -c "print('hello')"
run --lang python --code "print('hello')"

⚠️ When to Use --lang (Important!)

While run can auto-detect languages, ambiguous syntax can cause confusion. For example, print('hello') looks similar in Python, Ruby, Lua, and other languages. Always use --lang for correctness when the syntax is ambiguous or when you need deterministic behavior.
Terminal
# ❌ Ambiguous - may choose wrong language
run "print('hello')"
Terminal
# ✅ Explicit - always correct
run --lang python "print('hello')"

Main Function Flexibility

For compiled languages (Rust, Go, C, C++, Java, etc.), run is smart about main functions:

• Write complete programs with main functions

• Write code without main functions (run wraps it automatically)

• Both approaches work in REPL mode and inline execution

Terminal
$ run go
run universal REPL. Type :help for commands.

go>>> package main
import "fmt"
func main() {
    fmt.Println("Hello, world!")
}
Hello, world!

go>>> fmt.Println("Hello, world!")
Hello, world!

Interactive REPL - Line by Line or Paste All

The REPL mode is incredibly flexible. You can:

• Type code line by line interactively

• Paste entire programs at once

• Mix both approaches in the same session

This works for ALL supported languages!

python
# Paste entire program
def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

for i in range(10):
    print(f"F({i}) = {fibonacci(i)}")
Output
F(0) = 0
F(1) = 1
F(2) = 1
F(3) = 2
F(4) = 3
F(5) = 5
F(6) = 8
F(7) = 13
F(8) = 21
F(9) = 34
Terminal
# Or type line by line
python>>> x = 10
python>>> y = 20
python>>> print(x + y)
30

Variable Persistence & Language Switching

Variables persist across REPL commands within the same session. You can also switch languages on the fly using the :lang command (e.g., :c, :py, :go):

Terminal
$ run go
go>>> x := 10
go>>> x
10

go>>> :c
switched to c

c>>> int x = 10;
c>>> x
10
c>>> 10 + 10
20

c>>> :py
switched to python

python>>> y = 10
python>>> y
10
python>>> print(y)
10
python>>> z = 4
python>>> z is y
False
python>>> z == y
False

REPL Commands

The REPL supports several built-in commands for managing your session:

AliasDescription
:helpShow available REPL commands
:quit or :qExit the REPL
:clear or :cClear the screen
:resetReset the session (clear all variables)
:lang <language>Switch to a different language
:py, :js, :go, etc.Quick language switch shortcuts

Installation

Installing run is straightforward:

Build from Source
cargo install --path .
Output
This builds the run binary using your active Rust toolchain. The project targets Rust 1.70 or newer.
Verify Installation
run --version
Output
run 0.2.0

Command Variations - Flexible Syntax

run supports multiple command formats to fit your workflow. You can be explicit with --lang or let run auto-detect the language:

1. Full Syntax with --lang and --code
run --lang rust --code "fn main() { println!("hello from rust"); }"
Output
hello from rust
2. Omit --code flag (auto-detected)
run --code "fn main() { println!("hello from rust"); }"
Output
hello from rust
3. Shorthand - Just the code
run "fn main() { println!("hello from rust"); }"
Output
hello from rust
4. Language first, then code
run rust "fn main() { println!("hello from rust"); }"
Output
hello from rust

⚠️ When to Use --lang (Important!)

While run can auto-detect languages, ambiguous syntax can cause confusion. For example, print('hello') looks similar in Python, Ruby, Lua, and other languages.

RECOMMENDATION: Always use --lang for correctness when:

• The syntax is ambiguous across multiple languages

• You want to ensure the exact language is used

• You're writing scripts or automation that must be deterministic

Ambiguous Example - May Choose Wrong Language
run "print('hello')"  # Could be Python, Ruby, Lua, etc.
Output
hello  # But which language was used?
Explicit Example - Always Correct
run --lang python "print('hello')"
Output
hello  # Guaranteed to use Python

Main Function Flexibility

For compiled languages (Rust, Go, C, C++, Java, etc.), run is smart about main functions. You can:

• Write complete programs with main functions

• Write code without main functions (run wraps it automatically)

• Both approaches work in REPL mode and inline execution

Go Example - With main function
$ run go
run universal REPL. Type :help for commands.
go>>> package main
import "fmt"
func main() {
    fmt.Println("Hello, world!")
}
Hello, world!
Go Example - Without main function
go>>> fmt.Println("Hello, world!")
Hello, world!

Interactive REPL - Line by Line or Paste All

The REPL mode is incredibly flexible. You can:

• Type code line by line interactively

• Paste entire programs at once

• Mix both approaches in the same session

This works for ALL supported languages!

Python Example - Paste entire program
$ run python
python>>> def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

for i in range(10):
    print(f"F({i}) = {fibonacci(i)}")
F(0) = 0
F(1) = 1
F(2) = 1
F(3) = 2
F(4) = 3
F(5) = 5
F(6) = 8
F(7) = 13
F(8) = 21
F(9) = 34
Python Example - Line by line
python>>> x = 10
python>>> y = 20
python>>> print(x + y)
30

Variable Persistence & Language Switching

In REPL mode, variables persist across commands within the same language session. You can also switch languages on the fly using :lang commands.

When you switch languages, variables from the previous language do NOT carry over (each language has its own isolated session).

Variable Persistence Example
go>>> :c
switched to c
c>>> int x = 10;
c>>> x
10
c>>> 10 + 10
20
c>>> :py
switched to python
python>>> y = 10
python>>> y
10
python>>> print(y)
10
python>>> z = 4
python>>> z is y
False
python>>> z == y
False

Language Switching Commands

Switch between languages instantly in REPL mode using colon commands:

Available Language Switch Commands
:py or :python    → Switch to Python
:js or :node      → Switch to JavaScript
:rust or :rs      → Switch to Rust
:go or :golang    → Switch to Go
:c                → Switch to C
:cpp or :c++      → Switch to C++
:java             → Switch to Java
:rb or :ruby      → Switch to Ruby
:bash or :sh      → Switch to Bash
:ts               → Switch to TypeScript
... and more for all 25 languages!

REPL Commands Reference

The REPL provides several built-in commands for managing your session:

Built-in REPL Commands
:help              → Show help and available commands
:languages         → List all supported languages
:clear             → Clear the screen
:exit or :quit     → Exit the REPL
:lang <language>   → Switch to a different language
Ctrl+D             → Exit the REPL (Unix/Linux/macOS)
Ctrl+C             → Cancel current input

Quick Start Examples

Get started with run in seconds:

1. Inline Code Execution
# Execute Python code directly
run python "print('Hello, World!')"

# Or use language aliases
run py "print(2 + 2)"

# Language can be the first argument
run python "for i in range(3): print(i)"
Output
Hello, World!
4
0
1
2
2. File Execution
# Execute a Python file
run python script.py

# Or let run detect the language from extension
run script.py

# Works with any supported language
run app.js
run main.go
run program.rs
Terminal
# Start a Python REPL
run python

# Start with no language (you can switch later)
run

# Inside REPL, switch languages with :lang
python>>> :go
switched to go
go>>> :python
switched to python
python>>> :rust
switched to rust

Key Features

run provides powerful features that make multi-language development seamless:

Core Features
25+ Programming Languages
✓ Unified Command Interface
✓ Flexible Command Syntax (--lang optional)
✓ Inline Code Execution
✓ File-based Execution
✓ Piped Input Support (stdin)
✓ Interactive REPL Mode
✓ Stateful Sessions (Python, Bash, JS, etc.)
✓ Language Auto-detection
✓ Language Switching in REPL
✓ Variable Persistence per Language
✓ Main Function Auto-wrapping
✓ Cross-platform Support
✓ Zero Configuration Required
✓ Fast Startup Time
✓ Minimal Memory Footprint

Execution Modes

run supports multiple execution modes to fit your workflow:

Inline Execution
run python "print('Quick test')"
Output
Quick test
File Execution
run python my_script.py
Piped Input
echo "print('From stdin')" | run python
Output
From stdin
REPL Mode
run python
>>> x = 10
>>> print(x * 2)
20

Language Detection

run automatically detects languages using file extensions and heuristic snippet matching. This means you often don't need to specify --lang:

Extension-based Detection
# Automatically detects Python from .py extension
run script.py

# Detects JavaScript from .js extension
run app.js

# Detects Rust from .rs extension
run main.rs
Heuristic Pattern Matching
# run analyzes code patterns to detect language
run "console.log('hello')"  # Detected as JavaScript
run "println!("hello")"    # Detected as Rust
run "fmt.Println("hello")" # Detected as Go
Control Auto-detection in REPL
# Inside REPL, toggle automatic language detection
run
>>> :detect on      # Enable auto-detection per snippet
>>> :detect off     # Disable auto-detection
>>> :detect toggle  # Toggle current state
Force Specific Language
# Override detection with explicit language
run --lang python script.txt

# Useful when extension doesn't match content
run --lang javascript code.py

Next Steps

Now that you understand the basics, explore the documentation for specific languages:

• Click any language in the sidebar to see detailed usage examples

• Learn about language-specific features and REPL behavior

• Discover advanced use cases and troubleshooting tips

• Each language page includes comprehensive examples with expected outputs