### Author Topic: OT Basic  (Read 12262 times)

0 Members and 1 Guest are viewing this topic.

#### nemo

• LV9 Veteran (Next: 1337)
• Posts: 1203
• Rating: +94/-11
##### OT Basic
« on: August 08, 2010, 02:00:04 pm »
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.

Data Structures and Variable Types:
-Lists
-Matrices
-Multidimensional arrays
-Strings
-Character arrays
-Declared Variables
-Int, Float, Bool etc. types
-Prefixed variables to define their types. (ex. sVAR would be a string)
-Vectors

Variable Commands:
-ToUpperCase/ToLowerCase
-Pic recalling/storing
-Undeclare/Delvar function to free up memory
-Conversions between data types (i.e. list>Matrix, String>Number, Number>String etc.)
-Sum/Mean/Median of a List/Matrix/Array
-Random numbers, integers, matrices, lists, other data types

Graphical Commands:
-Pxl-On/Off/Change
-Pt-On/Off/Change
-Line
-Circle
-Polygon
-Graph Function
-Clear Screen
-3-D support and polygons
-Operating System GUI elements, like DCS libs.

Control Statements:
-If (File/Variable Exists)-Else-End
-If-Else-End
-For
-While
-Break
-Try/Catch
-Goto/Lbl

I/O Commands:
-Getkey (multiple keypress getkey)
-Prompt/Input
-Disp/Output/Print

Operators:
-Multiplicative
-Subtraction
-Negativity
-Division
-Modulus
-Assignment
-Equality
-Inequality operators (greater than, less than etc.)
-Exponent
-Logical not()
-Logical and
-Logical or
-Logical xor
-Increment command (+= in C)
-Decrement commmand (-= in C) same with multiply, divide, modulus.

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.

« Last Edit: September 05, 2010, 09:36:30 pm by nemo »

#### DJ Omnimaga

• CodeWalrus staff & retired Omni founder
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55811
• Rating: +3145/-232
• Remember when the walrus started to fly
##### Re: OT Basic
« Reply #1 on: August 08, 2010, 02:29:33 pm »
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..
In case you are wondering where I went, I am still regularly active in the TI community. I just left Omnimaga several months ago for various reasons. You can now reach me on CodeWalrus at http://codewalr.us . Sorry for the inconveniences.

#### program4

• LV4 Regular (Next: 200)
• Posts: 158
• Rating: +15/-0
##### Re: OT Basic
« Reply #2 on: August 08, 2010, 02:31:23 pm »
I think it should be interpreted, with an option to compile, in case you need to brute force something.

#### cooliojazz

• Support Staff
• LV7 Elite (Next: 700)
• Posts: 618
• Rating: +66/-9
• I omnoms on your soul
##### Re: OT Basic
« Reply #3 on: August 08, 2010, 02:38:38 pm »
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.
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."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

#### calc84maniac

• Epic z80 roflpwner
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2881
• Rating: +455/-17
##### Re: OT Basic
« Reply #4 on: August 08, 2010, 02:43:24 pm »
I assume this is for OTZ80? Cause for OTARM, it would be simple to load Python, for example, among many other languages. One of the perks of using Linux
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### program4

• LV4 Regular (Next: 200)
• Posts: 158
• Rating: +15/-0
##### Re: OT Basic
« Reply #5 on: August 08, 2010, 02:46:19 pm »
It might have arrays of strings, unless that is too much towards gaming.

#### Builderboy

• Physics Guru
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: OT Basic
« Reply #6 on: August 08, 2010, 03:26:36 pm »
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.

#### fb39ca4

• LV10 31337 u53r (Next: 2000)
• Posts: 1750
• Rating: +60/-3
##### Re: OT Basic
« Reply #7 on: August 08, 2010, 03:27:18 pm »
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-basic
Strings 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.

#### DJ Omnimaga

• CodeWalrus staff & retired Omni founder
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55811
• Rating: +3145/-232
• Remember when the walrus started to fly
##### Re: OT Basic
« Reply #8 on: August 08, 2010, 03:46:13 pm »
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.
In case you are wondering where I went, I am still regularly active in the TI community. I just left Omnimaga several months ago for various reasons. You can now reach me on CodeWalrus at http://codewalr.us . Sorry for the inconveniences.

#### matthias1992

• LV6 Super Member (Next: 500)
• Posts: 408
• Rating: +33/-5
##### Re: OT Basic
« Reply #9 on: August 08, 2010, 04:15:13 pm »
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 = 10
MyVar = [[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 = 10
mMyVar = [[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 OTBasic
First 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:
Code: [Select]
UndeclareYou can remove the vars you don't need to be saved and keep the ones that say, store level/player data. So you could do:
Code: [Select]
Undeclare Myvar1, Myvar2, Myvar3or:
Code: [Select]
Undeclare All()The parenthesis behind All could then contain nothing which litteraly deletes all declared vars or it could contain a type as, int, string, mtrx, real.
Code: [Select]
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 cursorposition
Write X-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 position
Mprint [equation] writes out the specified eqaution in a pretty-print style.
« Last Edit: August 08, 2010, 05:00:05 pm by matthias1992 »
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

#### SirCmpwn

• Guest
##### Re: OT Basic
« Reply #10 on: August 08, 2010, 04:41:49 pm »
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.

#### matthias1992

• LV6 Super Member (Next: 500)
• Posts: 408
• Rating: +33/-5
##### Re: OT Basic
« Reply #11 on: August 08, 2010, 04:47:32 pm »
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.
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

#### willrandship

• Omnimagus of the Multi-Base.
• LV11 Super Veteran (Next: 3000)
• Posts: 2954
• Rating: +98/-13
• Insert sugar to begin programming subroutine.
##### Re: OT Basic
« Reply #12 on: August 08, 2010, 04:48:57 pm »
I think compiling should be implemented very visibly, so it's obvious that you can speed up your programs very easily.

Also, any chance for syntax highlighting and bolding? We'll be using a greyscale screen, right? I figure we'll have quite a bit of room for fancier effects like that.

#### calc84maniac

• Epic z80 roflpwner
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2881
• Rating: +455/-17
##### Re: OT Basic
« Reply #13 on: August 08, 2010, 04:56:30 pm »
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
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### matthias1992

• LV6 Super Member (Next: 500)
• Posts: 408
• Rating: +33/-5
##### Re: OT Basic
« Reply #14 on: August 08, 2010, 05:01:59 pm »
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)
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-