R2D2 is a programming language designed for building modular JavaScript applications using a clear, explicit, and structured syntax.
It is written in Go and compiles to JavaScript, embracing a module-based architecture where each module can contain variables and functions. These modules are compiled into native JavaScript objects, making it easy to integrate with existing frontend or backend projects.
R2D2 introduces the concept of pseudo-functions — a special type of function that can only contain calls to other functions. This enforces composability and encourages building code through reusable, isolated behaviors.
The language is built with simplicity and clarity in mind. It avoids hidden behavior and favors explicit patterns, making it approachable for those who want to write structured, maintainable code that compiles directly to JavaScript.
You can start using R2D2 by executing the following command on your system.
Linux/macOS:
curl -fsSL https://raw.githubusercontent.com/ArturC03/r2d2-cli/main/install.sh?nocache | bashWindows (PowerShell):
iwr -useb https://raw.githubusercontent.com/ArturC03/r2d2-cli/main/install.ps1?nocache | iexThis will:
- 🚀 Download the appropriate installer for your platform
- 🎨 Launch a beautiful TUI installer with R2D2 branding
- 📦 Install R2D2 CLI to your system automatically
- 🧹 Clean up temporary files when done
Simple and fast - just one command!
If you prefer to download manually:
- Go to Releases
- Download
r2d2-installer-{your-os}-{your-arch}.tar.gz - Extract:
tar -xzf r2d2-installer-*.tar.gz - Run:
./r2d2-installer
- Linux/macOS:
curlandtar - Windows: PowerShell 3.0+ and Windows 10 1903+ (for tar)
Just use WSL, believe me. I'm doing you a favor.To verify the installation, try executing r2d2, if it returns something you're good to go!
Let's try to make a hello world program!
- Create a
.r2d2file such ashelloworld.r2d2 - Put the following content in the file
module HelloWorld {
export fn main() {
console.log("Hello World!");
}
}- Now you can choose to compile, run or even convert it into a js file by using on of the following commands
r2d2 build helloworld.r2d2r2d2 run helloworld.r2d2r2d2 js helloworld.r2d2For more information go to the site. Any doughts just make an issue.
The installation process is designed to be simple and automatic:
- Platform Detection: Automatically detects your OS and architecture
- Download: Gets the right installer binary from GitHub releases
- TUI Installer: Launches a beautiful terminal interface
- Installation: Installs R2D2 CLI and dependencies automatically
- Cleanup: Removes temporary files
- 🎨 R2D2 Branding: Purple R, Green D, adaptive colors
- 📱 Responsive: Adapts to any terminal size
- 🔄 Progress Tracking: Real-time installation progress
- ✨ Error Handling: Clear messages and troubleshooting
- Linux: x86_64, ARM64, i386
- macOS: Intel and Apple Silicon
- Windows: x86_64, i386
- FreeBSD: x86_64
The installer will:
- Install Git, Go, and Deno if needed
- Build and install the R2D2 CLI
- Add R2D2 to your system PATH
- Verify the installation works