A new, easy-to-use programming language for making calculator apps and games!

Why Did I make this? The Problem:

First, some history: Texas Instruments previously supported two routes for making calculator programs:

  1. Use TI-BASIC, the builtin scripting language, or
  2. Using Z80 assembly or C with a compatible compiler

However, post 2020, Texas Instruments calculators no longer support native assembly programs, leaving TI-Basic as the only option. This is unfortunate because TI-BASIC is (no offense to TI) an awful programming language to use.

Limitations of TI-BASIC:

Some of TI-BASIC’s key limitations include (but are not limited to):

  1. No support for functions
  2. Only 27 pre-named variables (the letters A-Z, and Theta)
  3. Terrible readability (no indentation, and problems 1 and 2 inevitably lead to ugly spaghetti code)

These limitations of TI-BASIC create a terrible developer experience. TI-BASIC++ is the solution!

How TI-BASIC++ is the Solution

The goal of TI-BASIC++ is to solve some of the limitations of TI-BASIC. Some improvements include:

  • An easy to ready syntax, like a mix between Python and C
  • Custom variable names (and the ability to use more than 27)
  • Defining custom functions (not fully implemented yet)
void function(Number a, Number b) {
  Disp(a + b)
}

void main() {
  function(5 + 5, 2)
  String mystring = "My Calculator runs TI-BASIC++!"
  Disp(mystring)
}

How I built it

The TI-BASIC++ compiler was written completely in C99 using no third party libraries except for a dynamic array and HashMap implementation.

Challenges I ran into

As it turns out, programming a compiler is quite challenging. This project took the full 24 hours to complete. Programming the Lexer and the Parser was probably the most difficult part and took the majority of the time.

Accomplishments that I'm proud of

It mostly works! The compiler can build simple programs and send them to the calculator! I'm particularly proud of some of the smaller aspects of the compiler too, such as the fancy error messages and the versatility of the command line interface. I'm proud of the parser, which was especially challenging to make.

What I learned

I learned a ton about compiler programming and all the stages of real compilers. I definitely plan on making more compilers in the future based on how fun this experience was!

What's next for TI-BASIC++

  • Custom functions still need some work and are still a bit buggy
  • Adding support for more models of TI calculators. I've only tested this on the TI-84 Plus CE

Built With

Share this project:

Updates