Aggie ++ Write Up
Yup, as in C++. The Barnest & Noble has Aggie themed shirts, shoes, cups, towels, and even underwear. It's only fitting that the best university in the world get it's own programming language.
Introducing Aggie++.
Inspiration
The name Aggie++ pays homage to C++, which was created by TAMU professor Bjarne Stroustrup.
This project is intended as a parody/commentary of the rapidly changing landscape of programming languages. New langauges like Rust, Go, Carbon, Dart, and Kotlin pop up nearly every month. The JS framework landscape is even more disastrous with new frameworks spawning faster than ever before.
Nowadays, it feels like everyone is making their own language of framework just because they feel like it. So I fullfilled my duty as an Aggie and created Aggie++
What it Does
Aggie Script is a fully functional programming language that is capable of solving every programming assignment in ENGR 102. Except... it's Aggie themed!!!
It is capable of running in interpreted mode (like Python) or can even be compiled to a binary using LLVM.
Files: .rev extension
Reveille is the proud mascot of our school and it's only fitting that we continue the rich tradition in the file extension for our code.
Print Whoop!
We don't speak at Aggieland, we scream!!!!! It's only fair that our print statement, shows just how passionate we are!
Whoop! "Howdy, world!";
Variables Aggies
Aggies are the individual people that make up our great university. Just like variables are the individual pieces of data that make up a program.
Aggie x IS 4;
Aggie x IS 10 / 2;
Aggie x is "Howdy, world!";
Aggie isHappy IS good_bull;
Notice how the type is inferred automatically.
Special Note: Booleans Good Bull and Bad Bull
Every time something good happens, we say "good_bull". So our booleans are called that because... "bull" sounds like "bool"... (Insert laughter)
Functions Yells
At TAMU football games, the crowd executes a predefined set of actions to cheer on the team. Just like a function! So in Aggie++, we have Yells!
At Aggie games, people "pass it back" to tell people what the next yell is. As a result, our code uses pass_back to execute our yells.
YELL myfunc_one
Whoop! "Hello from myfunc_one!";
AGGIE ix IS 100;
Whoop! "returning ix =" ix "to main";
RETURN ix;
WILDCAT
pass_back myfunc_one
HOWDY
Thanks and Gigem
Every Yell ends with a wildcat at games, so it's only fitting that our Yells ends with that too.
Main Function Howdy/Thanks and Gigem
At A&M, we greet fellow aggies with a "Howdy" and we end our speeches with a "Thanks and Gigem". As a result, the langauge follows the same convention!
Howdy
Whoop! "5 + 5 =" 5+5;
Thanks and Gigem
Comments t.u.
Comments are useless pieces of text that don't matter to the actual code. Similarly, texas university is a useless college that doesn't matter to Texas. Thus, comments in Aggie++ start with t.u.
t.u. I'm a useless comment that doesn't matter
Howdy
Whoop! "Hello, World!";
Thanks and Gigem
Control Flow
All of these mostly mirror normal programming languages. However, note that after every curly brace, a Gigem must be placed to properly close the block in an Aggie function. This is important for um... efficiency?
Conditionals
t.u. if statement.
Whoop! "Example: If Statement";
IF x > 10{
Whoop! "x (" x ") is larger than 10!";
} Gigem;
Loops
AGGIE x IS 5;
Whoop! "Before loop: X =" x;
Whoop! "Running loop from 1...10";
FOR 1 IN 10 START{
x TRANSFORM x + 1;
}Gigem;
AGGIE ix IS 1;
WHILE GoodBull{
Whoop! ix;
ix TRANSFORM ix + 1;
IF ix > 5{
Whoop! "breaking out of loop...";
BTHO;
}Gigem;
}Gigem;
Expressions
Aggie++ has full support for normal mathematical expressions and binary operators.
t.u. declaring x and y.
AGGIE x IS 5.5;
AGGIE y IS 15;
AGGIE a IS x;
AGGIE b IS y;
Whoop! "Addition Output:" x "+" y "=" x+y;
Whoop! "Assigning new value to y. Setting y = 100";
y TRANSFORM 100;
Whoop! "New y = " y;
t.u. declaring a boolean variable.
AGGIE boolvar IS GoodBull;
Whoop! "boolvar = " boolvar;
t.u. testing logical ops
Whoop! "x: " x "y: " y;
Whoop! "a: " a "b: " b;
Whoop! "x > y: " x > y;
Whoop! "x >= y: " x >= y;
Whoop! "x < y: " x < y;
Whoop! "x <= y: " x <= y;
Whoop! "x == a: " x == a;
Whoop! "x != b: " x != b;
The operators are pretty simillar to normal programming languages because I couldn't come up with any Aggie related phrases for them. 😔
How I Built It
Compilers are tough. But also cool. But mainly tough

The code is broken into three main components:
- The Lexer - Reads through the code and breaks it into special tokens
- The Parser - Reads the tokens and builds an Abstract Syntax Tree (AST) that models how the code should be run
- The Executor - Traverses the DFS and either executes the code directly, or writes to a binary.
Here's an example of what each step looks like:
The Input Code
Howdy
Whoop! "5 + 5 =" 5+5;
Thanks and Gigem
The parser extracted the following tokens: | Operator | Value | |----------------------------|-----------| | Howdy_ENTRYPOINT | | | Whoop! | | | OPEN_QUOTE | | | STRING | "5 + 5 =" | | CLOSE_QUOTE | | | NUMBER | 5 | | OPERATOR_PLUS | | | NUMBER | 5 | | SEMICOLON | | | Thanks and Gigem_EXITPOINT | |
The tokens were then parsed into the following tree:

Afterwards, Aggie++ will either output that tree as an LLVM IR that compiles to assembly or will directly interpret it depending on the mode.
The great news is that the challenge of lexing and parsing languages is really well defined and there are a lot of great tools that I used to aid the process:
- re/flex - Auto generates a highly optimized C++ lexer based on a configuration file
- bison - Auto generates a highly optimized C++ parser based on a configuration file
- rply - Python library that can parse, lex, and even execute with configuration. >Seems like a most of the work was really in configuration files. Was any actual code written? 🤔🤔🤔
Challenges
This is my first time being exposed to compiling and programming langauges. A large portion of the event was spent learning.
A lot of the tools I used were based on deep configuration files. There was a steep learning curve to understand how to properly define my language.
Accomplishments
It works! And it is faster than Python in compiler mode. Furthermore, because parts of the parser and lexer are in C++, the code is able to beat Python is certain benchmarks.
With that being said, more can be done to optimize the execution of the AST.
Whats Next
Corps of Cadets standard library that safeguards our traditions
old_army block which lets me run C++ code for when I need more flexibility.
Add unit tests to our yells, a.k.a yell practice
12th_man multhreading library
Get ENGR 102 to start teaching Aggie++ instead of Python
Log in or sign up for Devpost to join the conversation.