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.
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
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
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
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
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.
Defaults favor safety over throughput. Adjust per use case.
Handpicked examples that highlight the language's native features — all runnable in your browser.
Model a release workflow with typed enums, time-aware scheduling, and structured status reporting.
Price a subscription invoice with typed plan enums and semantic money values.
Build a retry schedule with typed enum policies and Duration-based exponential backoff.
Quote delivery windows with enum-based shipping speeds, money totals, and Duration math.