rugo

command module
v0.26.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 24 Imported by: 0

README

Rugo

Ruby syntax - Shell power - Go binaries.

In a world of software aboundance, agents create your favorite languages.

Will they work? maybe.

Will it burn the planet? perhaps, in the meantime, we'll have great companies.

Can we escape this? In a world currently dominated by software, unlikely.

In a future where code will be written by agents, do we even care about languages? maybe not.

[!WARNING] Rugo is an agent product, driven by Opus 4.6. Treat it like a ☢️ experiment, breakage and rough edges expected. Having said that, the language spec is mostly stable now, and I'm working towards stabiliizing the core and strengthening the test suite.

Features

Influences

Rugo stands on the shoulders of giants:

  • Ruby (syntax, blocks)
  • Go (compilation, structs)
  • Crystal (spawn concurrency)
  • V (try/or error handling)
  • Zig (inline catch)
  • Bash (shell fallback, pipes)
  • BATS (test runner)
  • Rust (inline tests alongside code).
  • Elixir (Lambdas)
  • Landlock (kernel-native sandboxing)

Install

go install github.com/rubiojr/rugo@latest

Usage

rugo script.rugo            # compile and run
rugo build script.rugo      # compile to native binary
rugo rats script.rugo       # run inline tests
rugo emit script.rugo       # print generated Go code
Ruby-like syntax
def greet(name)
  puts "Hello, #{name}!"
end

greet("World")

def
scores = [90, 85, 72]
for score in scores
  if score >= 90
    puts "#{score} → A"
  else
    puts "#{score} → B"
  end
end
Shell fallback
ls -la | head -3
name = `whoami`
puts "I'm #{name}"
Lambdas
double = fn(x) x * 2 end
puts double(5)

add = fn(a, b) a + b end
puts add(2, 3)
Modules
use "str"
use "conv"

puts str.upper("hello rugo")
puts conv.to_i("42") + 8
Go stdlib bridge
import "math"
import "strings"

puts math.sqrt(144.0)
puts strings.to_upper("hello")
Error handling
import "strconv"

hostname = try `hostname` or "localhost"
puts "Running on #{hostname}"

n = try strconv.atoi("nope") or 0
puts n
Concurrency
a = spawn 2 + 2
b = spawn 3 * 3

puts a.value
puts b.value
Structs
struct Dog
  name
  breed
end

rex = Dog("Rex", "Labrador")
puts rex.name
puts rex.breed
Inline tests
use "test"

def add(a, b)
  return a + b
end

rats "add works"
  test.assert_eq(add(2, 3), 5)
end
Sandboxing
# Restrict filesystem and network with Linux Landlock
sandbox ro: ["/etc"], rox: ["/usr", "/lib"], connect: [443]

result = `cat /etc/os-release`
puts result
# Writing to /tmp or connecting to port 80? Denied.

Or from the CLI, without modifying the script:

rugo run --sandbox --ro /etc --rox /usr script.rugo
Declarative UIs

With the experimental, Qt backed, Cute module:

require "github.com/rubiojr/cute@v0.3.1"

cute.app("Counter", 400, 300) do
  count = cute.state(0)

  cute.vbox do
    lbl = cute.label("Clicked: 0 times")
    count.on(fn(v) lbl.set_text("Clicked: #{v} times") end)

    cute.button("Click Me") do
      count.set(count.get() + 1)
    end

    cute.hbox do
      cute.button("Reset") do
        count.set(0)
      end
      cute.button("Quit") do
        cute.quit()
      end
    end
  end

  cute.shortcut("Ctrl+Q", fn() cute.quit() end)
end

Documentation


Built by someone who's not a compiler expert — just a curious developer dusting off compiler theory notes from 25 years ago, learning as he goes. Rugo is a labor of love, not a production tool.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
dev
Package dev implements developer tooling subcommands for Rugo.
Package dev implements developer tooling subcommands for Rugo.
Package doc extracts documentation from Rugo source files.
Package doc extracts documentation from Rugo source files.
examples
modules/slug/custom-rugo command
Custom Rugo binary with the slug module.
Custom Rugo binary with the slug module.
Package gobridge provides the Go standard library bridge registry for Rugo.
Package gobridge provides the Go standard library bridge registry for Rugo.
ast
cli
fmt
hex
os
re
str
web
Package preprocess provides the Rugo source preprocessing pipeline.
Package preprocess provides the Rugo source preprocessing pipeline.
rats

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL