Since Ti-Basic is an interpreted language would it speed up the program if everything is compiled first and then run instead of it being interpreted?

If it does speed it up is it possible to make such a compiler?
It certainly would speed things up (the current TI-BASIC interpreter is more or less just a expression evaluator that has had various things haphazardly bolted on to it over the years to turn it into a usable language- lots of things are done that are nothing short of silly), and yes it would be possible to make such a compiler, especially if you make it a standalone tool instead of something run on-calculator.

Is it worth it? Probably not, for as much work as it would be.

You may be interested in PT_'s IndiumCE project, which aims to write a faster interpreter that pre-parses the program (similar to how Python and many modern interpreters work), among other significant optimizations. It currently exists in more of a prototype stage, if I'm not mistaken, so don't expect it to work on most programs.
What he said.
Axe and ICE were both initially spawned from a similar idea of compiling basic to make it faster. They both ended up being quite different from TI-Basic, mostly because TI-Basic is a pretty clunky/clumsy language, but they are more or less what you described.
I think complaints about TI-BASIC being slow tend to underestimate the amount of work the calculator actually does when running a program, as well. I would expect the parser itself to be a bit of a mess simply due to how irregular the language itself is, but it's also worth remembering that almost every operation you do requires it to manipulate floating-point numbers (because it has no sense of an integer).

While you probably could build an interpreter of some sort that achieves better performance, I agree that it doesn't seem very worthwhile- I'm personally more interested in being able to run programs in a different (more portable) parser than in making it run faster on calculators, which could in turn be run on a faster machine to achieve faster execution.
The closest we have is ICE. ICE is the bridge between C and TI−Basic.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement