Recent Activity

Blog

Inlining Branches and Sharing Metatables - 17 Jul 2016

 

What It Is

Brat is a little toy language that just doesn’t care. It is dynamically typed with objects, first-class functions, and simple syntax.

Where It Is

Brat may be obtained using any of the following methods:

or, try it in your browser!

How It Looks

Here is the Brat ‘hello world’ program:

p "Hello, world!"

Here is a slightly more interesting, object-oriented ‘hello world’:

world = new
world.hello! = { p "Hello, world!" }
world.hello!

Here’s one to say hello to you:

world = new
world.greet = { name | p "Hello, #{name}!"}
print "What is your name? "
your_name = g
world.greet your_name

A growing number of examples are also available on Rosetta Code.

Why You Should Use Brat

An arbitrary number of reasons to use Brat:

  1. Plenty of sharp knives
  2. No rigid class hierarchies
  3. No classes at all
  4. No pointless restrictions, only pointful ones
  5. No keywords to learn
  6. No one is going to tell you ‘no’
  7. No one else is

Who Should Use Brat

You should use Brat if:

Who Probably Shouldn’t Use Brat

You should steer clear of Brat if:

Who Doesn’t Care Either Way

Fork me on GitHub