-
Notifications
You must be signed in to change notification settings - Fork 0
Philosophy
Tae Lim Kook edited this page Jan 15, 2014
·
1 revision
I wanted to invent a language that followed the path of TI-Basic. In October, I wrote an initial attempt at Java (named Labyrinth, since it was supposed to be difficult to understand), but it quickly became messy, so I left the project for a while, until I rewrote it in Scala at the beginning of December (and named it Amethyst).
I made some choices to fulfill the TI-Basic philosophy:
- The interface consists of a top screen (implemented by a BufferedImage, similar to how calculator graphics are implemented) for graphics and a bottom screen resembling the TI-89 homescreen (with the input allowing multiple lines.
- Unclosed parentheses, brackets, braces, quotes, and guillemets are permitted.
- "Global variables" are actually persistent files.
- No optimization is performed for you, especially not tail-call optimization. Do it yourself.
- No objects or even structures. Use lists or maps.
- There is a last-answer variable: one accounting for Void return values, and one not.
- There is no passing by reference; only value.
However, I deviated from typical calculator programming languages in order to reduce the annoyance of using it:
- First class functions and lists, including lambdas (You can pass functions as arguments, as well as nest lists as much as you want, or at least as much as your computer can handle).
- A built-in map type, since maps are frequently used, especially in this code.
- Three numerical types: arbitrary-precision, 64-bit integers, and 64-bit IEEE floating-points (a. k. a. doubles).
- Two list types: arrays (like 83+) and linked lists (like 89), because each has its strengths and weaknesses. Plus, their dimensions are limited only by memory.
- Programs are planned to be stored using bytecode, with an option to compile without running (I think the TI-89's inability to do so was a big annoyance).
- A Void type and value.
- Zero-based, rather than one-based, indexing for lists.
This language is still in its infancy; many commands are still not implemented. However, they will eventually exist.