RXB Posted June 23, 2021 Share Posted June 23, 2021 3 hours ago, TheBF said: I guess that could happen with someone who is not familiar with how VMs work. Is it correct to say that the TI BASIC interpreter is written in GPL? Yes TI Basic and XB along with most TI Carts are written in GPL. Disk Manager, TE2, Diagnostics, Editor Assembler, Mini Memory, P-Code Card, TI LOGO just to name a few. Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 3 hours ago, Count9929A said: Let me give my impression, not knowing anything about GPL or BASIC internals, but knowing something about computer science in general. For me, "interpreter" is a program (written in language A) that reads tokens of a language B and executes them, i.e. modifies the state of the memory according to the intended semantics of language B. From what I read in this thread (and others) I think that this is what happens with TI BASIC, which is executed by an interpreter, written in GPL. To me, "BASIC is interpreted by GPL" would not mean that BASIC tokens are translated to GPL tokens. I would have called this hypothetical process "BASIC is compiled into GPL". Therefore if (as I think to have understood here in the forum) GPL instructions are themselves executed by a TMS9900 interpreter, (in the same sense as BASIC is interpreted in GPL) for me to say that BASIC is "doubly interpreted" makes sense: it is obviously a quick (and possibly inaccurate) way of describing the above process Sorry NO TI Basic itself is written in GPL, but the code TI Basic runs is written in TI Basic Tokenized code thus: Step 1 the Basic Tokenized code is loaded Step 2 the Basic Tokenized code is run from GPL Step 3 GPL that is built into the Console runs the Assembly routines to process the commands in GPL for Basic. I do not know how to explain it more plain then that. Forth does exactly the same thing in interpreter mode, Forth is called that runs Assembly to function. GPL = Forth in how they work. Quote Link to comment Share on other sites More sharing options...
Casey Posted June 23, 2021 Share Posted June 23, 2021 ^^ This is what I was essentially typing when Rich's post showed up. TI BASIC commands are tokenized and interpreted by the TI BASIC interpreter program, which is written in GPL. The TI BASIC interpreter program has GPL instructions (compiled) to do the statements of a TI BASIC program, which the GPL interpreter executes as needed by the TI BASIC program. Is this accurate? (feels like it, but want to make sure). 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 Yes Casey you got it! Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted June 23, 2021 Share Posted June 23, 2021 "My first three consoles had this GARBAGE COLLECTION bug..." This is not a bug. It is necessary for string handling in BASIC/XB. XB has its own garbage collection written in assembly, and my XB compiler also has a garbage collection routine. The garbage collection routine is in the console ROM at G51A9. According to Heiner Martin there are no known variants of that GROM. If you were using XB that could explain why your more recent efforts worked better. Or maybe it was changed for the emulators? 2 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted June 23, 2021 Share Posted June 23, 2021 15 minutes ago, RXB said: Sorry NO TI Basic itself is written in GPL, but the code TI Basic runs is written in TI Basic Tokenized code thus: Step 1 the Basic Tokenized code is loaded Step 2 the Basic Tokenized code is run from GPL Step 3 GPL that is built into the Console runs the Assembly routines to process the commands in GPL for Basic. I do not know how to explain it more plain then that. Forth does exactly the same thing in interpreter mode, Forth is called that runs Assembly to function. GPL = Forth in how they work. With one very important difference. Forth is written in assembly. This cuts out the GPL middle man that plagues XB, which leads to much higher speeds. 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted June 23, 2021 Share Posted June 23, 2021 (edited) Casey: TI BASIC commands are tokenized and interpreted by the TI BASIC interpreter program, which is written in GPL. The TI BASIC interpreter program has GPL instructions (compiled) to do the statements of a TI BASIC program, which the GPL interpreter executes as needed by the TI BASIC program. Is this accurate? (feels like it, but want to make sure). RXB: Yes Casey you got it! ------------------------------------------------------------------------------------------------------- Rich, I'm glad to see that you finally have come to admit that XB is double interpreted! Edited June 23, 2021 by senior_falcon 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 1 hour ago, senior_falcon said: With one very important difference. Forth is written in assembly. This cuts out the GPL middle man that plagues XB, which leads to much higher speeds. Hmm dude GPL is written in Assembly too! Look at TI Intern please. You could write TI Basic in Forth so do you think it would run faster? Not likely as GPL has many commands that unlike Forth require the order to be such as GPL and Basic and XB commands are similar. Example: CALL CLEAR is the ALL command in GPL and calls a Assembly OS in console to do it. A problem would be commands with multiple variables as Forth uses Reverse Polish Notation unlike GPL or Basic or XB. Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 1 hour ago, senior_falcon said: Casey: TI BASIC commands are tokenized and interpreted by the TI BASIC interpreter program, which is written in GPL. The TI BASIC interpreter program has GPL instructions (compiled) to do the statements of a TI BASIC program, which the GPL interpreter executes as needed by the TI BASIC program. Is this accurate? (feels like it, but want to make sure). RXB: Yes Casey you got it! ------------------------------------------------------------------------------------------------------- Rich, I'm glad to see that you finally have come to admit that XB is double interpreted! Pilot, LOGO and many others are also. But no one complains about them as hardly anyone uses them. I think GPL was a good selling point as look at how much work it takes in Commodore to just load a file. Thanks to GPL devices work much better and are much more easy to use, straight Assembly can not even agree on much of anything. Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted June 23, 2021 Share Posted June 23, 2021 (edited) 30 minutes ago, RXB said: Hmm dude GPL is written in Assembly too! Look at TI Intern please. You could write TI Basic in Forth so do you think it would run faster? Not likely as GPL has many commands that unlike Forth require the order to be such as GPL and Basic and XB commands are similar. Example: CALL CLEAR is the ALL command in GPL and calls a Assembly OS in console to do it. A problem would be commands with multiple variables as Forth uses Reverse Polish Notation unlike GPL or Basic or XB. Why on earth would you write TI BASIC in Forth? That would be silly. I would write it in assembly, If it were written in assembly by a competent coder, it would blow the doors off any GPL based BASIC. That is not an opinion. It is a fact!! Edited June 23, 2021 by senior_falcon 1 1 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted June 23, 2021 Share Posted June 23, 2021 16 minutes ago, senior_falcon said: Why on earth would you write TI BASIC in Forth? That would be silly. I would write it in assembly, and it would blow the doors off any GPL based BASIC. That is not an opinion. It is a fact!! That's been done once too, although it sees very little use as the code is somewhat quirky/buggy. Myarc Extended BASIC II was written entirely in Assembly, and it is a LOT faster than the TI variants coded mostly in GPL. The problem with it is the need for a Myarc (or modified Foundation) memory card and the bugs/aspirational features that Myarc never fixed. The Geneve's Advanced BASIC is a somewhat distant descendant, fully functional and with all of the missing features implemented. 2 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted June 23, 2021 Share Posted June 23, 2021 About the BUG... I'm not certain of when the issue was corrected. My feeling is that TI continued distributing the buggy consoles even after the fix was in. I seem to recall/believe my first V2.2 console, still had the issue. I first noticed it while running MARKET SIMULATION, before I really knew much about programming(I was about 12). The printing to display would freeze for a second or two at random points in the text. This program uses V or HCHAR, to slowly print to specific positions on the display, in a manner similar to DISPLAY AT. At the time I assumed TI chose this way of doing things merely to speed up execution for periods of time by clearing memory at non-symmetrical intervals. This is the only issue that caused untimely BASIC statement execution. Which could seemingly occur randomly at any LINE, defying any programming based solution. I remember thinking ...if only they(TI) had provided a way to force the collection at will, I could have perhaps found a way to exclude the key scans from this horrible penalty. This is the only explanation I have found to date that well fits the observed behavior. P.S. My program, referred to previously, was as large as CS1 would accommodate. 2 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted June 23, 2021 Share Posted June 23, 2021 Based on the date of that code change, the correction would have been present in all 99/4A machines made--although the error might have been found in every 99/4 made. The address places the code in GROM2--and that GROM is different between the /4 (CD2005) and the /4A (CD2157). I seem to have found a useful quick reference in the GROM listing I made a while back. Finding this was a snap. . . 2 Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 1 hour ago, senior_falcon said: Why on earth would you write TI BASIC in Forth? That would be silly. I would write it in assembly, If it were written in assembly by a competent coder, it would blow the doors off any GPL based BASIC. That is not an opinion. It is a fact!! Did not say to do it just that it would be just like GPL as a result as double interpeted. I get sick of attacks on GPL constantly like some how they can magically fix the TI99/4A by avoiding it, yet it is BUILT INTO THE CONSOLE to even boot! And I dare anyone to pull this off, if not then it is just you thinking not fact. I am living in REALITY not some forgone fantasy land. Quote Link to comment Share on other sites More sharing options...
RXB Posted June 23, 2021 Share Posted June 23, 2021 1 hour ago, Ksarul said: That's been done once too, although it sees very little use as the code is somewhat quirky/buggy. Myarc Extended BASIC II was written entirely in Assembly, and it is a LOT faster than the TI variants coded mostly in GPL. The problem with it is the need for a Myarc (or modified Foundation) memory card and the bugs/aspirational features that Myarc never fixed. The Geneve's Advanced BASIC is a somewhat distant descendant, fully functional and with all of the missing features implemented. Myarc XB 2 was not very backward compatible with normal Basic or XB either, yes it was way faster, but way buggy and way to many strange quirks. If people help me convert XB to Assembly that I am presently working on I can make sure bugs are at a minimum as I have been using XB / GPL for over 30 years. It is going to take a long time for me to do it ALONE! 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 23, 2021 Share Posted June 23, 2021 On 6/22/2021 at 1:33 PM, OLD CS1 said: I keep forgetting about that because it does not make any damn sense. Look at the Amiga, as an example, and you will find 8-bit peripherals on the 16-bit buss with no such encumbrance. Admittedly, I am not an engineer and I have never designed a full computer system, but I did stay at a Holiday Inn Express last night. It gets better than that, the VDP /is/ on the 16-bit bus. 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 23, 2021 Share Posted June 23, 2021 On 6/22/2021 at 2:15 PM, Airshack said: One step vs two because the design started with another CPU in mind on the 99/4A? We don't know, but TI'ers are passionate about their lore. 2 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 23, 2021 Share Posted June 23, 2021 8 hours ago, mizapf said: I find this list misleading to some extent. It suggests (to the inexperienced reader) that the BASIC programs (tokens) are translated to GPL, which is not the case. Hence, I usually disagree with a description like "double interpretation". "Double interpretation" is accurate. Interpretation is not translation, it has specific meaning in computing (or at least it used to. Kids have been changing all the words around lately ). GPL is an interpreted byte code. BASIC is also an interpreted byte code. The BASIC interpreter is written in GPL. Since it's a literal industry term, the understanding of an inexperienced reader isn't really necessary to bring into play. There are lots of computing terms which may be misleading to an inexperienced reader. Not sure why this is a hot point. 3 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 23, 2021 Share Posted June 23, 2021 Wrt the Forth comments - it's true there are some similarities. Forth words are converted to values. It's often called compilation but it's actually the same mechanical steps as tokenizing. However, there are two differences to the TI BASIC debate. First, there's only one layer. The Forth tokens are executed directly. Secondly, it's not interpreted. As I understand it, the tokens are literally already the jump addresses of the machine instructions. It's not assembly and it's not interpreted byte code, it really is its own thing. 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 24, 2021 Share Posted June 24, 2021 1 hour ago, Tursi said: Secondly, it's not interpreted. As I understand it, the tokens are literally already the jump addresses of the machine instructions. It's not assembly and it's not interpreted byte code, it really is its own thing. One could say that "threaded' Forth is still interpreted but since the tokens are addresses the interpreter is very small. If you use literal machine code addresses or direct threading, the interpreter is just two 9900 instructions. This is the same mechanism used by the BASIC compiler and Camel99 DTC. If you use the native sub-routine mechanism of the machine (sub-routine threaded) there is no interpreter but the code is two times bigger since every token is a BL @xxxx For small memory machines indirect threading is best where the tokens are a pointer to machine code. This interpreter is three 9900 instructions. (TI-Forth, FbForth, Turbo Forth Camel99) You can also make byte code Forth where the tokens are the indices of an array that contains either direct addresses or indirect addresses or even addresses that are called with BL. (OpenBoot, Openfirmware) (I have it on the stack to make a Forth with byte codes because the 9900 has excellent instructions for doing this.) Everything you needed to know but were afraid to ask. 3 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted June 24, 2021 Share Posted June 24, 2021 3 hours ago, RXB said: Did not say to do it just that it would be just like GPL as a result as double interpeted. I get sick of attacks on GPL constantly like some how they can magically fix the TI99/4A by avoiding it, yet it is BUILT INTO THE CONSOLE to even boot! And I dare anyone to pull this off, if not then it is just you thinking not fact. I am living in REALITY not some forgone fantasy land. Yes, I guess it was just a silly fantasy of mine to think that something like The Missing Link could possibly be developed that allows real time full bit mapped graphics in Extended BASIC. Another foolish dream was thinking that something like XB256 could be programmed so XB could use all 256 characters with another 112 characters for sprites, plus the ability to toggle between two distinct screens. And I must have really had my head in the clouds to think there was any way to incorporate 40 column text mode and 80 column text mode into XB Clearly, only someone living in LaLa land could dream up something like XB2.8 G.E.M. which rolls all the above into a super powerful version of XB with many additional enhancements that go far beyond XB 2.7 People complained for years about how slow XB was and dreamed of a compiler that could handle XB. And silly me, I was too dumb to know it couldn't be done, so I just went ahead and did it. And now you can compile an XB program so it runs 25x faster. So yes, I guess it would be accurate to say that I live in some forgone fantasy land. 3 2 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted June 24, 2021 Share Posted June 24, 2021 Haha... I've been known to dance away to computer fantasyland occasionally myself... 1 Quote Link to comment Share on other sites More sharing options...
+Ksarul Posted June 24, 2021 Share Posted June 24, 2021 I'm not sure that I've ever even visited Realityland. I definitely don't live there. Fantasy is just too much fun. Oh, and Rich, I'm busy building something nice for you--I think you will like it. 4 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted June 24, 2021 Share Posted June 24, 2021 So... do we have this topic sussed out, yet? 1 Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted June 24, 2021 Share Posted June 24, 2021 4 minutes ago, OLD CS1 said: So... do we have this topic sussed out, yet? I think we may need to bring in an interpreter. 2 6 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.