Loading repository data…
Loading repository data…
anamta-JINX / repository
BRUT Compiler is a VS Code extension + compiler for BRAT, my English-like programming language that keeps coding clean, readable, and lowkey iconic. It supports `.brt` files, syntax highlighting, snippets, a Run button, and BRAT programs that actually run. Basically: less chaos, more aura.
BRUT Compiler is a Visual Studio Code extension for writing, checking, and running BRAT .brt files directly inside VS Code.
BRAT is an English-like beginner-friendly programming language designed to feel simple, readable, and fun while still supporting real programming concepts like variables, input, conditions, loops, arithmetic, and logic.
BRAT is not meant to feel boring or robotic. It is built with personality: clean syntax, readable logic, easy loops, and funny GenZ-style compiler error messages that still explain the real issue clearly.
BRAT is the programming language.
BRAT files use the extension:
.brt
Example:
show("Hello from BRAT!");
BRUT stands for:
Base Runtime Unified Translator
BRUT is the compiler system that reads BRAT code, checks it, translates it, and runs it.
Simple meaning:
BRAT = the language you write
BRUT = the compiler that runs it
This extension adds BRAT support to VS Code.
.brt file recognitionask(...)while loopsrepeat ... times loopsBefore using this extension, make sure Python is installed.
Python 3.10 or higher
Visual Studio Code
Check Python installation:
python --version
If Python is installed correctly, it should show something like:
Python 3.10.x
After building the extension, you will get a file like:
brut-compiler-0.0.1.vsix
To install it:
Install from VSIX
brut-compiler-0.0.1.vsix
Create or open a BRAT file:
calculator.brt
main_test.brt
hello.brt
repeat_test.brt
When the file opens, VS Code should detect it as:
BRAT
You should see a Run button at the top-right of the editor.
Click:
▶ Run
The extension will run the file using the BRUT Compiler.
You can also use the Command Palette.
Open Command Palette:
Ctrl + Shift + P
Search:
BRUT
Available commands:
BRUT: Run
BRUT: Check BRAT File
This section explains the currently supported BRAT language syntax.
Use show(...) to print something.
show("Hello, BRAT!");
Output:
Hello, BRAT!
You can print text, numbers, variables, or expressions.
let name = "JINX";
show(name);
let total = 10 + 5;
show(total);
BRAT supports variables using let and mut.
letUse let to create a variable.
let language = "BRAT";
let score = 100;
let active = aura.true;
Example:
let x = 10;
let y = 20;
show(x + y);
mutUse mut when the value should be changed later.
mut count = 0;
count = count + 1;
show(count);
Example:
mut points = 10;
points = points + 5;
show(points);
BRAT supports the following basic values.
let age = 20;
let price = 99.5;
Strings are written inside double quotes.
let name = "Anam";
show("Welcome to BRAT!");
BRAT uses aura-style booleans.
let isRunning = aura.true;
let isFinished = aura.false;
Meaning:
aura.true = true
aura.false = false
Use ask(...) -> variable; to take input from the user.
ask("Enter your name") -> name;
show(name);
Example:
show("Welcome!");
ask("Enter first number") -> a;
ask("Enter second number") -> b;
show("Answer:");
show(a + b);
The BRUT compiler automatically tries to understand numeric input.
If the user enters:
10
BRAT treats it as a number.
If the user enters:
Anam
BRAT treats it as text.
BRAT supports common arithmetic operations.
| Operator | Meaning | Example |
|---|---|---|
+ | Addition | a + b |
- | Subtraction | a - b |
* | Multiplication | a * b |
/ | Division | a / b |
% | Remainder | a % b |
** | Power | a ** b |
Example:
let a = 10;
let b = 3;
show(a + b);
show(a - b);
show(a * b);
show(a / b);
show(a % b);
show(a ** b);
Comparison operators are used in conditions.
| Operator | Meaning |
|---|---|
== | Equal to |
!= | Not equal to |
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
Example:
let score = 85;
if score >= 50 {
show("Passed");
}
else {
show("Failed");
};
BRAT supports logical conditions.
| Operator | Meaning |
|---|---|
and | Both conditions must be true |
or | At least one condition must be true |
not | Reverses the condition |
Example:
let score = 90;
let attendance = 80;
if score >= 50 and attendance >= 75 {
show("Allowed");
}
else {
show("Not allowed");
};
Example with or:
let choice = 1;
if choice == 1 or choice == 2 {
show("Valid choice");
}
else {
show("Invalid choice");
};
Use if and else to make decisions.
if condition {
show("Condition is true");
}
else {
show("Condition is false");
};
Example:
ask("Enter your marks") -> marks;
if marks >= 50 {
show("You passed!");
}
else {
show("You failed.");
};
Use while to repeat code while a condition is true.
mut count = 1;
while count <= 5 {
show(count);
count = count + 1;
};
Output:
1
2
3
4
5
Use while when you want the loop to keep running until a condition becomes false.
Use repeat ... times when you want a loop that is easy to read.
This is one of the main reasons BRAT exists: loops should feel understandable.
repeat 3 times {
show("BRAT repeat is working");
};
Output:
BRAT repeat is working
BRAT repeat is working
BRAT repeat is working
You can also use a variable as the repeat count.
ask("How many times should BRAT repeat") -> repeatCount;
repeat repeatCount times {
show("This line is repeating.");
};
Important:
times is a BRAT keyword.
So do not use times as a variable name.
Do not write this:
ask("How many times") -> times;
repeat times times {
show("hi");
};
Use this instead:
ask("How many times") -> repeatCount;
repeat repeatCount times {
show("hi");
};
show("========================================");
show(" BRAT REPEAT LOOP TEST ");
show("========================================");
ask("How many times should BRAT repeat") -> repeatCount;
repeat repeatCount times {
show("🔥 BRAT repeat loop is working!");
};
show("");
show("Done. Loops are finally readable.");
Variables can be updated after creation.
mut x = 10;
x = 20;
show(x);
Example:
mut total = 0;
total = total + 5;
total = total + 10;
show(total);
BRAT uses curly braces for blocks.
Blocks are used in:
if
else
while
repeat
Example:
if aura.true {
show("This runs");
}
else {
show("This does not run");
};
Example with repeat:
repeat 2 times {
show("Inside repeat block");
};
Most BRAT statements end with a semicolon.
show("Hello");
let x = 10;
x = x + 1;
Blocks also end with a semicolon after the closing brace.
while x < 5 {
show(x);
x = x + 1;
};
if x > 5 {
show("big");
}
else {
show("small");
};
repeat 3 times {
show("looping");
};
BRAT’s error system is designed to be useful, but not boring.
Instead of plain robotic compiler errors, BRAT gives readable error messages with personality.
A BRAT error can include:
Line number
Column number
Error code
Actual issue
Fix suggestion
A funny BRAT-style roast
Example missing semicolon error:
BRAT had a breakdown at line 3 💀
You probably forgot a semicolon `;`, shawty.
Error Code : BRAT_PARSE_003
Line : 3
Column : 1
Issue : Expected `;` after show/say statement.
Fix it, fineshyt. BRAT is watching 👀
BRAT does not display every roast line every time. The messages are distributed across different types of errors so the compiler feels more natural.
Possible BRAT-style error lines include:
BRAT had a breakdown at line 4 💀
it couldn't pass the vibe check
Bestie, this is not giving.
Bruh… didn’t expect such an error from you.
This is not a bug. This is a cry for help.
You probably forgot a semicolon `;`, shawty.
Fix it, fineshyt. BRAT is watching 👀
Different error types can trigger different messages.
| Error Type | Example BRAT Message |
|---|---|
| Missing semicolon | You probably forgot a semicolon ;, shawty. |
| Missing syntax | This is not a bug. This is a cry for help. |
| Parser error | Bestie, this is not giving. |
| Lexical error | it couldn't pass the vibe check |
| Semantic error | Bruh… didn’t expect such an error from you. |
| General compiler error | This is not a bug. This is a cry for help. |
The goal is simple:
Make errors funny, memorable, and still helpful.
show("========================================");
show(" BRAT DEMO PROGRAM ");
show("========================================");
ask("Enter your name") -> name;
ask("Enter your score") -> score;
show("");
show("Welcome:");
show(name);
if score >= 50 {
show("You passed.");
}
else {
show("You failed.");
};
show("");
show("Repeat celebration:");
repeat 3 times {
show("BRAT is running with aura.");
};
mut count = 1;
while count <= 3 {
show("While loop running...");
show(count);
count = count + 1;
};
show("========================================");
show(" BRAT SMART CALCULATOR ");
show("========================================");
show("Not just a calculator."