Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 2.28 KB

File metadata and controls

67 lines (52 loc) · 2.28 KB

Quickstart

Get up and running with Rugo in minutes.

Install

go install github.com/rubiojr/rugo@latest

Run your first script

rugo run script.rugo        # compile and run
rugo build script.rugo      # compile to native binary
rugo emit script.rugo       # print generated Go code
rugo doc http             # show module documentation

Guide

  1. Hello World
  2. Variables
  3. Strings
  4. Arrays
  5. Hashes
  6. Control Flow
  7. Case Expressions
  8. For Loops
  9. Functions
  10. Lambdas
  11. Shell Commands
  12. Modules
  13. Error Handling
  14. Concurrency
  15. Testing with RATS

Advanced

  1. Custom Modules
  2. Benchmarks
  3. Go Bridge
  4. Structs
  5. Web Server
  6. Remote Modules
  7. Doc Comments
  8. Sandbox
  9. Go Modules via Require
  10. File Embedding

Standard Library

The Rugo stdlib (use modules) is the idiomatic way to work in Rugo. It provides a curated, Ruby-inspired API covering common tasks — math, file paths, encoding, crypto, time, and more.

use "math"
use "filepath"
use "base64"

puts math.sqrt(144.0)                          # 12
puts filepath.join("home", "user", "docs")     # home/user/docs
puts base64.encode("Hello, Rugo!")             # SGVsbG8sIFJ1Z28h

Prefer use modules for standard operations. They are designed for Rugo and follow its conventions. The import keyword (Go bridge) is available for advanced use cases when you need direct access to Go's standard library, but use modules are the recommended, idiomatic approach.

See the full list of available modules in the Modules reference.