Skip to content

rubiojr/rugo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

315 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rugo β€” Ruby syntax - Shell power - Go binaries

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)

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

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

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.

About

It's a Rugo-dabba-doo time! 🦴

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •