Open source · MIT Licensed

An embeddable Ruby-like language for safe, AI-friendly apps in Go.

Vibescript is a constrained scripting environment where users express custom logic through Ruby-like syntax, gradual typing, enums, duration and money primitives, and Go-style embeddability — all within safe, predictable bounds.

Gradual typing

Optional annotations, nullable ?, enums, positional and keyword args, return type checks.

def shipping_quote(speed: ShippingSpeed, subtotal: money) -> hash
  fee = shipping_fee(speed, subtotal)
  transit = transit_time(speed)

  {
    speed: speed.name,
    fee: fee,
    total: subtotal + fee,
    transit: transit.iso8601
  }
end

Enums

First-class enums with member access, symbol comparison, and cross-enum equality.

enum AccountStanding
  Current
  Grace
  Delinquent
end

def standing_for(overdue: duration) -> AccountStanding
  if overdue <= 3.days
    AccountStanding::Current
  elsif overdue <= 15.days
    AccountStanding::Grace
  else
    AccountStanding::Delinquent
  end
end

Duration & money primitives

Built-in literals, arithmetic, comparisons, and formatting for time and currency.

def transit_time(speed: ShippingSpeed) -> duration
  if speed == ShippingSpeed::Economy
    5.days
  elsif speed == ShippingSpeed::Priority
    2.days
  else
    6.hours
  end
end

def net_after_fee(cents)
  gross = money_cents(cents, "USD")
  fee = money("1.75 USD")
  gross - fee
end

Ruby-like syntax

Blocks, ranges, zero-paren defs, yield, and symbol hashes — familiar and readable.

def benchmark
  start = Time.now
  result = yield
  elapsed = Time.now - start
  { result: result, elapsed: elapsed }
end

def transform_keys(hash)
  result = {}
  hash.keys.each do |key|
    new_key = yield(key)
    result[new_key] = hash[key]
  end
  result
end
Designed for AI

Easy to read. Easy for AI to vibe code.

As vibe coding grows, many domains need to narrow what users can build. Instead of a blank canvas, Vibescript offers an opinionated set of well-defined primitives that combine into predictable, safe applications.

Think of it less like traditional software development and more like HyperCard: flexible, but within bounds. The Ruby-like syntax mirrors patterns familiar to language models, making it a natural target for AI-generated code.

Vibescript embeds directly into any Go application. Scripts expose functions callable from host code, and the host controls exactly what capabilities each script can access.

Sandbox guardrails

Defaults favor safety over throughput. Adjust per use case.

  • Step quotaCaps execution steps (default 50k) to prevent unbounded loops.
  • Recursion limitBounds call depth (default 64) to prevent stack blowups.
  • Memory quotaLimits allocations (default 64 KiB) with runtime errors instead of OOM.
  • Effects controlRequire explicit capabilities for side-effecting operations.
  • Module pathsOnly approved directories are searched by require.
  • Capability gatingHost injects safe adapters — scripts only touch what you expose.
Featured

See what idiomatic Vibescript looks like.

Handpicked examples that highlight the language's native features — all runnable in your browser.