ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Community :: Articles :: Is it Time to Replace TI-BASIC?
Is it Time to Replace TI-BASIC?

Posted on 21 February 2005

The following text was written by George Limpert:

Anyone who remembers coding in TI-BASIC on the TI-81 or TI-85 and has then has coded for a more modern calculator knows the language has made great strides. Many of these changes have been influenced by the collection of nerds and gamers we affectionately refer to as the TI community. When TI created their original graphing calculator models, they never envisioned they would be used for the purposes we have found for them. A large portion of the changes to the language reflect the ideas of students over a decade ago who envisioned their calculators entertaining them during boring lectures. Despite the many changes to TI-BASIC, the language is still looked upon by the best game programmers as inadequate at best.

The complaint of many programmers about TI-BASIC is its speed, or the lack thereof. Unfortunately this issue is unlikely to be addressed anytime soon. When TI designed the language, they envisioned a way of adding new math functionality to the calculator, but with safeguards in place to prevent harmful behavior by programs. Speed of program execution is nice but doesn't appear to have been one of TI's primary objectives when creating the language.

Some people will suggest any serious programming ought to be done in assembly language. Compared with programming in TI-BASIC, it's like going hunting with a rifle instead of a pocket knife; it's faster, more powerful, and there's nothing to stop you from aiming that rifle squarely at your foot. If you make an error programming in TI-BASIC, you get an error message awaiting you to press a key. A mistake programming in assembly might give you a sudden boost of free RAM in exchange for your valued programs, equations, and notes. It's probably best to do serious game programming in assembly, but what about other types of programs?

Not too long ago, a fellow with a fine idea for calculator programming visited the flagship IRC channel for discussing TI calculators. Instead of compiling TI-BASIC programs so they run faster, he proposed replacing the language altogether. While he was met with ridicule, the idea is worthy of further discussion.

Last semester, I took a course on data compression techniques. One project assigned was to implement a Huffman encoder and decoder in C or Java. The discussion in class about Huffman coding went in one ear and out the other. Instead of struggling with C, I decided to implement the project first on my TI-89 because I expected TI-BASIC to be simpler. After about five minutes into coding, however, I hit a roadblock; there's no easy way to implement any sort of trees. Sure, it's possible, but to many programmers it's not obvious how to create or manipulate trees. The solution is to represent each node as a list; the first element is the value and the second and third elements are the names of child nodes within the binary tree. The child nodes are then accessed using a wonderful feature of the language known as indirection. On the TI-83 line of calculators, however, indirection isn't possible, and one would have to use a matrix, instead. Manipulating a matrix is slow and makes the programming involved even more complicated.

A tree is one of the fundamental techniques used in programming. It's applicable to many algorithms including searches and sorts. Unfortunately it can't easily be done within TI-BASIC.

This discussion also addresses another major limitation of TI-BASIC. What if, instead of storing the name of a child node, I want to store another data structure, such as a list, in one of those spots? The answer, of course, is it's not possible. One might ask why anyone would want to do this. Consider, for example, if a programming task involved pushing an integer and a list to a stack. While no such task readily comes to mind, it's a reasonable proposition. Stacks are another fundamental technique of programming. And, of course, complex data structures alone are useful at times.

There are many other such examples of why TI-BASIC is inadequate. Even if it will never be a fast language, simple programming techniques in the language ought to be exactly that -- simple. These limitations make TI-BASIC useless to many applications that are not at all related to gaming.

Programming in assembly can be difficult and dangerous to your data. It also usually requires a computer, a link cable, and a lot of patience. If that's not the best option and TI-BASIC is inadequate, maybe another programming language isn't so absurd of an idea after all.

The obvious question then becomes what features should such a language have. If a language is to truly replace TI-BASIC, it ought to have all the features that TI-BASIC currently has with some additions to fix the limitations with TI-BASIC. It's likely a replacement for TI-BASIC would need to be interpreted instead of compiled. One might assume that if we're creating a new interpreted language that has more features than TI-BASIC that it would be even slower. This is not necessarily the case.

The architecture of compilers and interpreters are very similar. The first step in either is referred to as a lexical scanner. This scans through the program text for keywords and symbols. The output generated is a series of tokens which represent the text of the original program. TI-BASIC does this as well; on some calculators, programs are always represented as tokens, but on others you will notice a delay when running a program for the first time due to this conversion. The next step of a compiler or interpreter is a parser. This deals with the syntax of the language, converting the string of tokens to a tree structure. A tree in an accurate representation of how a language is actually evaluated. Following this step is semantic analysis. A statement in a language may be syntactically correct but still make no sense to the compiler or interpreter. At this step, actions such as checking type and scope of variables are performed. At this point, compilers and interpreters diverge. An interpreter will evaluate the parse tree and execute the statements while a compiler will output another language such as assembly language or machine code.

This discussion on the architecture of interpreters is relevant because the implementation of TI-BASIC is not necessarily the most efficient scheme. Most likely, TI-BASIC stores programs merely as a stream of tokens because of the space required to store a representation of a parse tree. A parse tree, however, can be converted back to plain text just as the stream of tokens can. If parsing is only done once instead of being done constantly during execution, greater speed can be realized. One need not stop after parsing, however. Much of the semantic analysis step can also be performed at this time without modifying the parse tree. One may view this as a trade-off between program size and execution speed, but it need not be the case. A parse tree, when outputted to a file, can be compressed and then uncompressed at runtime, which may gain back some or all of the space lost to representing the program as a parse tree.

Another major change to such a new language is in the area of variables. There is no method within TI-BASIC to store a reference to another variable. Therefore any reference variables will necessarily be local to the interpreted program. Such a language, however, would still need to provide easy access to variables from TI-BASIC. This means that any variables that are to use the additional features of this language will need to be declared within the program. If this is the case, it allows for a few other enhancements to the language. One potential enhancement is the concept of aggregate data types.

Dealing with variables is a major slow point of TI-BASIC. The language on some calculators provides two very useful features for programmers -- dynamic types and dynamic resizing of variables. Dynamic types mean that if I have an variable currently storing an integer and I choose to store a string it it, the variable becomes a string variable. Dynamic resizing of variables means that the space used to store a variable is automatically expanded or contracted depending on how much space is needed to store the data. While these are very useful enhancements, they are also slow. A new language could make these features optional to programmers, providing an additional speed boost.

In spite of these and other possible enhancements, some tasks are better suited for assembly language. Furthermore, programmers shouldn't have to reinvent the wheel every time they write a program. PHP had a good idea when it allowed modules to be added to the interpreter that extend the functionality of the language. While a new calculator language may be at the core a replacement for TI-BASIC, the ability to extend the language through modules instead of writing a new interpreter makes the language far more powerful than it would be otherwise.

TI-BASIC is a fine language suitable for many tasks. Assembly has many advantages over TI-BASIC and has many uses as well. There are, however, many programming tasks that for one reason are another are not suited well to either language. A replacement for TI-BASIC, if sufficiently enhanced, can make TI calculators a far more powerful tool. The question of a new programming language shouldn't be a question of if but of how and what.

  Reply to this item

Re: Is it Time to Replace TI-BASIC?
TI84Rox  Account Info

NO!

I agree with some points the author makes: TI Basic is woefully slow and produces inadequate graphics. Any game requiring the getkey function usually runs so slow it is worthless. However, TI Basic is an excellent "first language". Unlike C and Asm, Basic can be programmed and run using only the calculator; no link cable and TI Graphlink required. It is easy to understand, and is great for text-only games.

Reply to this comment    28 May 2007, 19:08 GMT

Re: Is it Time to Replace TI-BASIC?
Jeffrey Button  Account Info
(Web Page)

i have seen some interesting points, i have written a few simple ti basic programs, the problem being there is a difference in compatibility between models, such as the 82 and the 86, not to mention a limited amount of memory, however a solution would be to create a cross compiler that compiles c or c++ code on a computer for the ti calclulator then use the graph link to xfer it, not the best solution but it could be used for any model (simply make the compiler to take the target model as a switch in the command and generate the proper asm code) that way it could also be debugged BEFORE transfering to the calculator

Reply to this comment    12 February 2008, 02:40 GMT

Is it Time to Replace TI-BASIC yet?
The_One_Guy  Account Info

It's November 2008, and this is still an issue. I understand both sides of the arguement, and think TI needs to make a comprimise. Keep the average calculator as it is, but create a series of programming calculators that has the capibilites of the basic (no pun intended) graphing calculators, while offering more programming options, including a possible new language, good (posibly color) screen resolution, more BASIC commands, and various other inprovements. That way, the strictly math oriented could have the standard type, and the programmers could have one more oriented tword their tastes, while still being able to use it for math.

Reply to this comment    13 November 2008, 00:33 GMT

Re: Is it Time to Replace TI-BASIC?
Tony Cagliano  Account Info

TI-Basic does have its limitations, but it is good for beginners. And, with the latest addition of Axe to the available languages, it eliminates the need for assembly.

For those of you who don't know, Axe Parser is an on-calc assembler. It allows you to create Axe source files on your calculator, using the OS program editor. Once you are done, you open the Axe app and compile your program. Axe language has a syntax very similar to TI-Basic, but it compiles into an assembly executable. It is a beta at the moment and currently supports basic system commands, multiple keypresses, contrast, access to pointers, free RAM areas, and all TI-OS variables. It also allows direct I/O linking. Axe can also compile to an APP, but that involves glitchy code and should be avoided. Details can be found at www.omnimaga.org.

Reply to this comment    3 October 2010, 15:42 GMT

Re: Is it Time to Replace TI-BASIC?
JBB Account Info

Actually it is time to cancel this site. Can someone tell me what the purpose is of a site where there is little or no discussion going on. Yeh, sure, nspire is a bummer and that is the only new product out of TI in many years, but how about some discussion on Casio stuff. Like what would it take for you to switch to the new Casio Prizm with its bright color, yes I said "color" screen?

Reply to this comment    20 January 2011, 03:09 GMT


Re: Re: Is it Time to Replace TI-BASIC?
JBB Account Info

That is a post responding to an initial post in 2005 and I bet there will be no response. Looks like everyone that used to post on this site died and left this automatic software behind. Ge-i-s-h!

Reply to this comment    20 January 2011, 03:12 GMT

Re: Is it Time to Replace TI-BASIC?
Some_Guy_In_A_Tank  Account Info

The thing is that TI Basic is good for beginners yet it is not good for those who expect fucking high damn speeds.

A Basic might look like A->9 while asm might be ld 0,A

Asm nearly always deletes thy RAM when you type one char wrong and it's really painstaking to have to redownload all of the crap

Reply to this comment    13 June 2013, 09:16 GMT

Re: Is it Time to Replace TI-BASIC?
daixtr  Account Info

BASIC and C are different languages intended to solve different kinds of problems. BASIC can hit more entry level new programmers because it is easy to learn. The expression of C does not reflect the problem domain clearly because C is a system-level language. Only BASIC can express that.

Reply to this comment    17 April 2014, 04:51 GMT

Re: Is it Time to Replace TI-BASIC?
princetonlion  Account Info

Is this a necropost?

If TI BASIC was replaced, we wouldn't be able to play games in class (I don't) and Ticalc would lose most of its files.

Reply to this comment    8 June 2014, 23:44 GMT


Re: Re: Is it Time to Replace TI-BASIC?
amy chen  Account Info
(Web Page)

i think its a real good

Reply to this comment    27 October 2018, 12:28 GMT

Re: Is it Time to Replace TI-BASIC?
slotviadana Account Info
(Web Page)

Actually it is time to cancel this site. Can someone tell me what the purpose is of a site where there is little or no discussion going on. Yeh, sure, nspire is a bummer and that is the only new product out of TI in many years, but how about some discussion on Casio stuff. Like what would it take for you to switch to the new Casio Prizm with its bright color, yes I said "color" screen?

Reply to this comment    29 August 2021, 02:47 GMT


Re: Re: Is it Time to Replace TI-BASIC?
Travis Evans  Account Info

You apparently haven't discovered the file archives. :-) You'd take down the entire program archives and all the other information on this site just because someone hasn't responded to a 16-year-old news post that long since ran its course?

Reply to this comment    30 August 2021, 16:23 GMT

Re: Is it Time to Replace TI-BASIC?
slotviadana Account Info
(Web Page)

i have seen some interesting points, i have written a few simple ti basic programs, the problem being there is a difference in compatibility between models, such as the 82 and the 86, not to mention a limited amount of memory, however a solution would be to create a cross compiler that compiles c or c++ code on a computer for the ti calclulator then use the graph link to xfer it, not the best solution but it could be used for any model (simply make the compiler to take the target model as a switch in the command and generate the proper asm code) that way it could also be debugged BEFORE transfering to the calculator

Reply to this comment    29 August 2021, 02:48 GMT


Re: Re: Is it Time to Replace TI-BASIC?
daftarjudislotDANA Account Info
(Web Page)

We often remove comments that stray from these guidelines. We do this not to "censor" your feedback, but to keep replies on-topic. Other users want to read replies relevant to a particular article, and general discussion should be kept to other areas

Reply to this comment    30 October 2021, 06:39 GMT

Re: Is it Time to Replace TI-BASIC?
slotviadana Account Info
(Web Page)

I agree with some points the author makes: TI Basic is woefully slow and produces inadequate graphics. Any game requiring the getkey function usually runs so slow it is worthless. However, TI Basic is an excellent "first language". Unlike C and Asm, Basic can be programmed and run using only the calculator; no link cable and TI Graphlink required. It is easy to understand, and is great for text-only games.

Reply to this comment    29 August 2021, 02:49 GMT

Re: Is it Time to Replace TI-BASIC?
slotviadana Account Info
(Web Page)

I totally agree. Basic is a very good starting language and after all this is a calculator we are talking about.
All my programming when my friend showed me a loop that no buttons(except the on) would stop it.
Because of that I now program in many other languages(c, c++) and script with torque.
Anyways its a calculator, we dont need to do mass programs and games and stuff, I have made games and programs and yes they could run faster but other than that the language is fine.
If you want to do ASM or C or w/e do it on a computer.
The main purpose I think of programs is for making the program solve equations, etc.
The calculator does not need to become a portable computer(although that would be nice)
If you are that into programming on a calculator DO IT ON A COMPUTER!

Reply to this comment    29 August 2021, 02:50 GMT

Re: Is it Time to Replace TI-BASIC?
slotviadana Account Info
(Web Page)

Another major change to such a new language is in the area of variables. There is no method within TI-BASIC to store a reference to another variable. Therefore any reference variables will necessarily be local to the interpreted program. Such a language, however, would still need to provide easy access to variables from TI-BASIC. This means that any variables that are to use the additional features of this language will need to be declared within the program. If this is the case, it allows for a few other enhancements to the language. One potential enhancement is the concept of aggregate data types.

Reply to this comment    29 August 2021, 02:50 GMT

Re: Is it Time to Replace TI-BASIC?
daftarjudislotDANA Account Info
(Web Page)

It's November 2008, and this is still an issue. I understand both sides of the arguement, and think TI needs to make a comprimise. Keep the average calculator as it is, but create a series of programming calculators that has the capibilites of the basic (no pun intended) graphing calculators, while offering more programming options, including a possible new language, good (posibly color) screen resolution, more BASIC commands, and various other inprovements. That way, the strictly math oriented could have the standard type, and the programmers could have one more oriented tword their tastes, while still being able to use it for math.

Reply to this comment    30 August 2021, 22:16 GMT


Re: Re: Is it Time to Replace TI-BASIC?
Travis Evans  Account Info

Well, the 89/V200 series was the closest you could get to a “programmer's” calculator compromise on the TI side. The BASIC language on those was far ahead of what the 83+/84+ family ever offered. But then I guess they decided the real market was the educational sector, not professional users, and so TI went in the direction of designing calculators for classrooms and standardized testing, which doesn't care for advanced programming but rather teacher and administrator control over what the students are allowed to do on the devices and when.

Hewlett Packard used to offer the 48g/49g/50g series, the latter especially of which was practically a programmer's dream: extensive user customizability; a built-in development tool/debugger for not just the user language but the system language and ASM as well; and a built-in SD card slot for easy backup/transfer of data. But since the 50g was built upon legacy hardware and software of the previous models, its specs were somewhat limited by today's standards.

After the discontinuation of the 50g, that left the HP Prime, which does have a color LCD and is probably the most powerful calculator model currently on the market in terms of performance. Built-in programming is decently powerful, though it doesn't officially allow native code execution. But it's also had to appease the educational sector, which means no IR, no SD, and no sound. I'd say this is probably the best compromise still available today if you're willing to go non-TI.

There sadly doesn't really seem to be such a big market for “advanced programmer” calculators anymore, so it's no longer a priority with calculator makers. It seems those users have since turned to other devices.

Reply to this comment    31 August 2021, 16:31 GMT

Re: Is it Time to Replace TI-BASIC?
RichardRat Account Info
(Web Page)

YES! The TI Basic has GOT TO GO!!!!!! Newer calculators have far better calculationing abilities and they look really cool. On the newest TI-84, you can play Fortnite and hit the griddy. CHAO!

Reply to this comment    11 October 2023, 15:46 GMT
1  2  3  4  5  6  7  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer