Overview
BudgetLang programs create accounts (checking, savings, credit, cash), record deposits and withdrawals with a category and date, and show account info or filter transactions by category. The project includes a context-free grammar, an abstract syntax tree, a pretty-printer that shows programs in the language's own syntax, and an evaluator that runs them and catches errors like insufficient funds or duplicate accounts.
Three example programs show different uses: a household budget, a freelancer tracking client payments, and a college student on a tight budget.
Challenge
My first version had a lot of features: date-range filters, budgets, transfers. I realized the language had become hard to explain, so I cut it down to the essentials. After my midterm presentation, I took my professor's feedback to remove a redundant Log statement. Deposits and withdrawals now record transactions automatically, which made the language simpler and cleaner.
What's next
- Add a parser so programs can be written directly in the language's own syntax
- Store money as integer cents to avoid floating-point rounding
- Give credit accounts real behavior (negative balances up to a limit)
AI use
I planned and directed this project: choosing the domain, deciding which features to build and cut, and applying my professor's feedback. I used an AI assistant to help explain Haskell concepts and write code, and I worked through each part until I understood it.