Skip to content

GrownPlanet/tila

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TI-lang

A simple, compiled language for the ti83+/ti84+.

This program compiles a program in a small language to assembly, which needs to be compiled using spasm-ng.

Running

Requirements:

To build: dune build

To run: dune exec tila [program] [output.s], test.tp is a small reference program you can use. You need to use spasm-ng to compile the generated assembly to a 8xp file (example: spasm out.s out.8xp).

Usage

The language is still in relatively early stages, you can see the things I want to implement in reference.tl. The currently existing features are outlined below. Keep in mind that this language has no semicolons.

You can use comments using //.

You can create a global variable using global [type] [name] = [value]. The types are string, u8, and u16. For example: global u16 x = 140.

You can create a function using fn [name]() { ... code ... }. Arguments aren't supported yet, so you will need to use global variables for now. The main function is the starting point for the program.

You can call a function using [name]().

You can use conditionals using if [expression] { ... code ... } with an optional else { ... code ... }. For now you can check for equality.

There are a few built in functions:

  1. print([string variable])
  2. go_home() put the cursor for text printing on 0, 0
  3. clear_lcd() clear the lcd

Todo

Short term:

  • parse the program
  • build an ast
  • generate the assembly
  • output the assembly
  • write a script to compile the assembly
  • test it!
  • add more features
    • mutating variables
    • if/else statements
      • ==
      • fix variables: they are 8bit instead of 16bit
      • >, <, >=, <=
    • for/while loops
    • math (+, -, >, <, ==, ...)
    • stack allocated sprites
    • variables
    • more default functions: getkey, ...
    • advanced math (*, /, ...; this is more difficult to implement on the ti84)

Long term:

  • output an executable instead of assembly
  • better error messages
  • arguments for functions
  • asyncio multithreading

About

A simple, compiled language for the ti83+/ti84+

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages