Recent Activity
Some Big Recent Changes - 28 Jun 2020
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:
- Clone with Git:
git clone git://github.com/presidentbeef/brat
- Download it as a zip file
- Browse around the source
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:
- Plenty of sharp knives
- No rigid class hierarchies
- No classes at all
- No pointless restrictions, only pointful ones
- No keywords to learn
- No one is going to tell you ‘no’
- No one else is
Who Should Use Brat
You should use Brat if:
- No one is the boss of you
- You just don’t care
- You do what you wanna
- You don’t have a thing to prove
- You eat your candy with your pork and beans
Who Probably Shouldn’t Use Brat
You should steer clear of Brat if:
- You need to know what ‘type’ something is
- “Monkey patching” scares you
- You are Enterprisy™
- You want backtraces
- You have heart conditions
- You do not enjoy cryptic error messages
- You want to write Real™ programs
Who Doesn’t Care Either Way
- Presidents
- Goldfish
- Ninjas
- Guitar heroes
- Indiana Jones
- Most everyone else