Author
Topic: OT Basic (Read 11153 times)

We're all familiar with TI-Basic. I think there should be a similar language for OT calculators. OT basic is not a final name. That can be discussed later. However, if you agree there should be a basic-like language, what are commands and features you would like to see? Named variables? Compiled rather than interpreted? I want radical ideas, things you wish you could do. However, I have one condition. Please no features that are gaming specific!! This is for math programs mainly. No requests for sprite routines or the like obviously targeted for gaming. Command suggestions will be edited in regardless of feasibility.

Note: This topic should have extremely little discussion. Do not shoot down anyone's idea. Don't speculate on whether hardware can handle it or not. We can discuss fine details after the calculators hardware is planned. I ask this so this thread is as uncluttered as possible! Thank you.

Math Functions:-Every math function in the OTz80 calc that can be used outside a program on the "homescreen"-include sorting lists

Language Design:-Two languages, one interpreted, one compiled? -Syntax highlighting! (great suggestion willrandship)-Search function (ctrl+f)-Numbered lines in the GUI-SkipTo command, to skip to a programmer-defined place in the code, or waypoints like 1/4, 1/2, 3/4 through the code.-Descriptive error messages when a program errors.-Key to break execution of programs (like [On])-Copy/Paste sections of code-Undo/Redo function.-Token based/Non-token based, still needs to be decided.-Access to foreign characters and lowercase.

From what I remember, I think they wanted to include a language similar to TI-83+ BASIC. Something faster as well.

That said, while the language must be aimed towards maths, let's not limit itself like the TI-Nspire did. Let's not do the same mistake as TI did by removing Getkey and even Input.

The language needs to be interpreted, so the user immediately can run it like other calc BASIC languages, stable, so no crashes/data loss occurs while testing, error checking, to make it easy for the user to track errors, like in TI-BASIC, easy to use language, possibly similar to TI-BASIC but not too close to not get sued and tokenized, so it won't take considerable amounts of memory like TI-86 BASIC programs..

For data structures, I think it should have more standard data type support, aka, instead of lists and matrices, have multidimensional arrays. It should also of course have things like strings and numbers, not sure whether it would be advantageous to have separate int types, etc, but I would guess not.

Logged

Spoiler For Random signess:

You can not beat my skills.Trust me.So don't even try.And remember never to trust someone who says, "Trust me."

It needs to be intuitive enough to still be easily usable in class (yes we did actualy write some programs in all of my math classes) and it needs needs neeeds all the advanced trig and statistical functions that the 84 has, if not more. If we are to hope to better TI, we will need to 1up them in every way.

For data structures, I think it should have more standard data type support, aka, instead of lists and matrices, have multidimensional arrays. It should also of course have things like strings and numbers, not sure whether it would be advantageous to have separate int types, etc, but I would guess not.

I don't think we should have different number types, rather, just a float that applies to all numbers, like in TI-basicStrings are fine, they could be used in say, a dictionary program.For variables, I think they should be done similar to C, where they are declared, and can have any name, and be any type (number, string, list, matrix, etc.)Control statements: If, Else Elseif, For, While, Break, Try (executes block of code, error code, if any, stored in a variable), Goto, and anything else useful.Operators: +-*/, negative sign, exponent carat, <>=, assignment, not, and, or, xor, not-variants.I/O: Getkey, Link(sends/recieves 1-byte codes on the link port), pixel-commands, line, circle, polygon, draw function, draw sprite, scroll screen, and so on and so forth.

The language really needs to be as simple as possible. I already found getting used to For() loop syntaxes very hard at first back in 2001. We need to not use a more complicated language, so people bother to learn to use it, but at the same time, the language needs to not be too complicated for the average student.

I suggest making two languages, the easy one, basic should be interpreted. The harder one should be compiled. We could make some sort C-like language on it where every variable needs to be declared (I suggest any variable may be max. 8 char long?). I do think the basic version should be like Visual-Basic. Easy to use.

I do think having similarities is good but there may be some extra's to it. I'd love to develop a whole new language which takes the best of both worlds, the speed (or near it) of assembly yet the ease of use of basic. I am not talking about something Axe like hear because personally I don't find Axe that easy to use, especially because all the similar tokens confuse me. I suggest delivering this second language with a on-calc SDK and Compiler (all in one) as a external download. This so that newbs can't damage their calculator by playing around with the language (if it were pre-installed).

I'd say for the Advanced level (which i will from now on refer to as AOT: Advanced OmniTech) language to support a difference between data types to save space. This in contradiction to the Basic language which I suggest can have 8 char length varaibles that can be a string or a matrix or anything else just by assigning values like so:

MyVar = "ABCD"MyVar = 10MyVar = [[1,2][3,4]]

This does cause gaps in memory filled with garbage because you switch between types but I think it is easy. A other way would be doing a prefix like so:

sMyVar = "ABCD"rMyVar = 10mMyVar = [[1,2][3,4]]

The prefix doesn't count as character in the variables name. The AOT will (in my idea of it) declare variables like so:

New String MyVar = "ABCD"

or:

New String MyVar;Myvar = "ABCD"

Aot will see the difference between Shorts, Doubles, Int's and Reals (and floats) as long as the type is declared (which is a must). For a Short it will reserve less space in memory so a advanced programmer can declare the types he needs.

Ok here I think is some keydifferences between Ti-Basic and OTBasicFirst off all since there is more space we can use more descriptive tokens then par example: expr(). Secondly since the screen will hopefully be bigger there isn't a problem in making tokens longer in terms of displaying them.

definetely make indents for loops, very useful when young programmers get into more advanced PC languages, if they used OTB before (and they probaly will) then the gap between these languages would be smaller.

= assigns, no more sto token. This means assignments can be done in strings. Which means You can do subprograms in strings.

Custom named vars! Hopefully >5 chars long. Most likely with a pre- or suffix to define its type (int, real, mtrx, string etc)though but we will have to see about that later. This allows to create manual vars so different programs won't overwrite your variables. This does take up space but with a simple new command:

Undeclare All(int)This undeclares/ removes all vars of the type integer

Edit: Here are some more thoughts about AOT (not OTBasic as the above) syntax

Operators:

= is the assignment operator== is the equal operator/= (i can't do the non-equal sign here) is the non-equal operator+ is plus- is negative (I don't know if we need to make a distinction between - and (-) as the Ti calc does but I assume not)* is multiply/ is division: is a logical and so you could have If A:B=1 (which tests if a=1 and b=1)| is a logical or so you could have If A|B=1 (which tests if a=1 or b=1)++ Increment with one stores to itself-- decrement with one stores to itself+= Increment with one assign to a new varaible or itself (which would be rather stupid considering the availability of ++ and --)-= Decrement with one assign to a new varaible or itself (which would be rather stupid considering the availability of ++ and --)

IO:

Print [text | string | variable],[text | string | variable], [etc..] print a text, string or variable or a combination of those at the current cursorpositionWriteX-location, Y-location, [text | string | var], [text | string | var], [text | string | var] , [etc] print a text, string or variable or a combination of those at the specified x and y positionMprint[equation] writes out the specified eqaution in a pretty-print style.

How about Mosaic for the harder language? z80 assembly is pretty straightforward in terms of support And Mosaic is already planned on being bundled in KOS.

That isn't a bad idea. But I do think the gap between Z80 and this OTBasic would be too big. This is why I recommend making a golden midway that isn't pre-installed but externally downloadable. Going from basic to asm is a steep learning curve going through AOT first eases you in since it will support inline asm and will have some pretty advanced funtionalities (like flag manipulation), don't worry though It won't be by far a replacement for Mosaic. I guess that adds the counter up to three languages of which I suggest only the Basic Language is preinstalled.

How about Mosaic for the harder language? z80 assembly is pretty straightforward in terms of support And Mosaic is already planned on being bundled in KOS.

This isn't KOS, this is OTZ80. I doubt Mosaic supports eZ80 anyway

True but KOS is very likely to be implented into this system though...Altough I still personally prefer to see a whole new OS for it (which can also be KOS but is specifically written for the eZ80 to take full advantage of speed increases and new commands)