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:
# 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:
Alias | Description |
---|---|
python, py, py3, python3 | Python programming language |
javascript, js, node, nodejs | JavaScript (Node.js runtime) |
typescript, ts, ts-node, deno | TypeScript with type checking |
rust, rs | Rust systems programming language |
go, golang | Go programming language |
c, gcc, clang | C programming language |
cpp, c++, g++ | C++ programming language |
java | Java programming language |
csharp, cs, dotnet | C# (.NET) |
ruby, rb, irb | Ruby programming language |
bash, sh, shell, zsh | Bash shell scripting |
lua, luajit | Lua scripting language |
perl, pl | Perl programming language |
php, php-cli | PHP scripting language |
haskell, hs, ghci | Haskell functional language |
elixir, ex, exs, iex | Elixir functional language |
julia, jl | Julia scientific computing |
dart, dartlang, flutter | Dart language (Flutter) |
swift, swiftlang | Swift programming language |
kotlin, kt, kts | Kotlin (JVM/Native) |
r, rscript, cran | R statistical computing |
crystal, cr, crystal-lang | Crystal language |
zig, ziglang | Zig systems language |
nim, nimlang | Nim programming language |
ocaml | OCaml functional language |
clojure, clj | Clojure Lisp dialect |
Installation
Installing run is straightforward. Choose the method that works best for your system:
# 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 .
# 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:
# 1. Full syntax with --lang and --code
run --lang rust --code "fn main() { println!("hello from rust"); }"
# 2. Shorthand flags (-l for --lang, -c for --code)
run -l rust -c "fn main() { println!("hello from rust"); }"
# 3. Omit --code flag (auto-detected)
run --code "fn main() { println!("hello from rust"); }"
# 4. Shorthand - just the code
run "fn main() { println!("hello from rust"); }"
# 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:
# 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!)
# ❌ Ambiguous - may choose wrong language
run "print('hello')"
# ✅ 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
$ 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!
# 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)}")
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
# 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):
$ 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:
Alias | Description |
---|---|
:help | Show available REPL commands |
:quit or :q | Exit the REPL |
:clear or :c | Clear the screen |
:reset | Reset 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:
cargo install --path .
This builds the run binary using your active Rust toolchain. The project targets Rust 1.70 or newer.
run --version
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:
run --lang rust --code "fn main() { println!("hello from rust"); }"
hello from rust
run --code "fn main() { println!("hello from rust"); }"
hello from rust
run "fn main() { println!("hello from rust"); }"
hello from rust
run rust "fn main() { println!("hello from rust"); }"
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
run "print('hello')" # Could be Python, Ruby, Lua, etc.
hello # But which language was used?
run --lang python "print('hello')"
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
$ 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!
$ 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>>> 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).
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:
: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:
: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:
# 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)"
Hello, World!
4
0
1
2
# 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
# 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:
✓ 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:
run python "print('Quick test')"
Quick test
run python my_script.py
echo "print('From stdin')" | run python
From stdin
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:
# 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
# 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
# Inside REPL, toggle automatic language detection
run
>>> :detect on # Enable auto-detection per snippet
>>> :detect off # Disable auto-detection
>>> :detect toggle # Toggle current state
# 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