SpiralIDE

SpiralIDE is a coding platform used to easily create simple to understand, well functioning TI-BASIC code. You can access SpiralIDE at www.spiralide.cf. SpiralIDE includes a load features that aren't available in vanilla TI-BASIC. These range from special tokens and loops, to named variables and even objects! With SpiralIDE you can take a complicated TI-BASIC program and write it in a matter of minutes. Because of SpiralIDE's simple and relaxed syntax bust out code quicker than ever before. SpiralIDE also includes Saving and Loading, so you can work on a project later, with out generating files that just make clutter, and take up space. so if your looking to take TI-BASIC a little further than SpiralIDE is for you.

Screenshots:

COMING SOON!!


Example:


Code:

var key = 0
while key == 0
key = getKey
end

If key == 24
Then
@PLAYER.move(-2,0)
end

If key == 25
Then
@PLAYER.move(0,-2)
end

If key == 26
Then
@PLAYER.move(2,0)
end

If key == 34
Then
@PLAYER.move(0,2)
end

sprite(playx, playy, "       ")
@PLAYER.draw()



@@(PLAYER)

attribute init
var playx = 1
var playy = 1
end

attribute draw
sprite(playx, playy, "fffffff")
end

attribute move
playx = playx + &1
playy = playy + &2
end

attribute goto
playx = &1
playy = &1
end

attribute position
[playx,playy]
end

/@@


Compiles to:

Main File:

Code:

6->dim(|LSPIRL)
0->|LVARS(0)
while |LVARS(0) = 0
getKey->|LVARS(0)
End

If |LVARS(0) = 24
Then
{-2,0}->|LINPUT
"move"
prgmPLAYER
Ans
End

If |LVARS(0) = 25
Then
{0,-2}->|LINPUT
"move"
prgmPLAYER
Ans
End

If |LVARS(0) = 26
Then
{2,0}->|LINPUT
"move"
prgmPLAYER
Ans
End

If |LVARS(0) = 34
Then
{0,2}->|LINPUT
"move"
prgmPLAYER
Ans
End

For(PV,0,length( "       ")-1
Text( |LVARS(2),|LVARS(1)+PV,sub( "       ",PV+1,1
End
Text( |LVARS(2),|LVARS(1)+PV,"   "
{0}->|LINPUT
"draw"
prgmPLAYER
Ans



PLAYER Object File:

Code:

If Ans="init":Then
1->|LVARS(1)
1->|LVARS(2)
End

If Ans="draw":Then
For(PV,0,length( "fffffff")-1
Text( |LVARS(2),|LVARS(1)+PV,sub( "fffffff",PV+1,1
End
Text( |LVARS(2),|LVARS(1)+PV,"   "
End

If Ans="move":Then
|LVARS(1) + |LINPUT(1)->|LVARS(1)
|LVARS(2) + |LINPUT(2)->|LVARS(2)
End

If Ans="goto":Then
|LINPUT(1)->|LVARS(1)
|LINPUT(1)->|LVARS(2)
End

If Ans="position":Then
{|LVARS(1),|LVARS(2)}
End
What is the grammar definition of this language? How does it handle commands it doesn't know about (for example, SampZTest() or something like that)? It appears that you're trying to come up with something vaguely Pythonic, but I'm not convinced that TI-BASIC actually is complicated enough to require another layer of abstraction. Convince me of this use case of this language.
Well Kerm as for commands it doesn't know, I made it so it assumes that it is a BASIC command so you can use commands that I might have missed. As for the reason to use it, I'm going to add commands that can do stuff like text sprites, graphical effects and maybe even some xlib or dcslib support. It also helps condense code quite a bit by using one command for things that would usually be multiple lines of code. Also, yes it is very pythonic. I did this because I love the python syntax and find it is easy for beginners to use.
Okay, that's a sane fallback for commands. The stuff you're describing sounds better-suited to a library than to a new programming language to me, personally. Condensing code, in my experience, generally leads to hidden bloat on the backend in exchange for more simplicity in the programmer-facing code. However, when the underlying language is already as simple as TI-BASIC, I'm not sure that I see the point. If you were to write something Pythonic that would directly compile into z80 assembly, I might (might) see that point, but I'm always a skeptic when it comes to new languages for what in my view falls under "ain't broke".
KermMartian wrote:
I'm always a skeptic when it comes to new languages for what in my view falls under "ain't broke".


This phrase doesn't apply to TI-Basic Wink That said...I'm not sure this fixes any of the things that are broken, besides simplifying a few idioms, like list iteration.

It also sounds like this a more of a preprocessor than a proper language. It only rewrites a few specific tokens based on a regular grammar, and doesn't do anything fancy that would require a parser.
elfprince13 wrote:
KermMartian wrote:
I'm always a skeptic when it comes to new languages for what in my view falls under "ain't broke".


This phrase doesn't apply to TI-Basic Wink That said...I'm not sure this fixes any of the things that are broken, besides simplifying a few idioms, like list iteration.
And even for that, I suspect that judicious use of seq() or even list-wise operations (sum(), max(), min(), =, etc) might be good things to use, and unless there's an extremely intelligent backend to this, it won't detect those cases. For example, X = 0 / For I in L2 / X = 2I + X / End should definitely become 2sum(L2->X, whereas a different loop body should stay a For() loop.
If he's going for a Pythonic feeling, it seems like it would be better to provide a list-comprehension-esque syntax for that case.
See this is why I never finish any of my projects. You guys are always skeptical from the beginning and it makes me feel like its not worth the time. No offence but I think a lot more projects would get completed (and maybe grow into bigger things) if you guys would provide support and not skepticism.

PS. What i just did is called constructive criticism, take a hint.
spud2451 wrote:
See this is why I never finish any of my projects. You guys are always skeptical from the beginning and it makes me feel like its not worth the time. No offence but I think a lot more projects would get completed (and maybe grow into bigger things) if you guys would provide support and not skepticism.

PS. What i just did is called constructive criticism, take a hint.
Us too, we worked through to recommending you implement list comprehensions, and we also recommended considering assembling this language directly to ASM. Those both sound constructive to me.
Ok Yes there was some constructive criticism, but when you also use that much negativity it makes some people feel like what they are doing isn't worth the community's time and effort to recognize. So all I'm saying is that you should just increase the constructiveness and decrease the skepticism in your posts with new projects. I was not saying that you guys weren't constructive in some way, I was saying that you need to tone down the criticism in "Constructive Criticism".
On Omnimaga, when people post on a topic, it's either to answer a question, or to say that something is wrong according to them and saying how they would see it better, or just saying "Awesome Very Happy" even when your project is a useless piece of bad coded ****, because it's against the rules to say bad things there.

On Cemetech, it's true that it is a little less friendly, when people think your project is useless, either they say it or they don't say anything and you lose interest by yourself.

I am not saying that one is better than the other, one can lead to some time wasting if you keep on working on an "awesome" useless project, and the other one can lead you to give up on something that was useless but could improve your coding skills. I am just saying that if you want only constructive criticism, without being flooded with "awesome", Cemetech is the place to be. If you want more motivation than constructive criticism (not saying that people are not constructive, saying that they are even more motivating), then you should probably visit Omnimaga too.

The best idea obviously being on both sites Wink
Thank you Hayleia. That was some very good insight to the differences between cemetech and omnimaga. As for how the project is going, I reciently added the option to use text sprites and to use the "++" operator on variables, along with some minor changes to the way variables and other tokens are handled.
Hayleia wrote:
On Omnimaga, when people post on a topic, it's either to answer a question, or to say that something is wrong according to them and saying how they would see it better, or just saying "Awesome Very Happy" even when your project is a useless piece of bad coded ****, because it's against the rules to say bad things there.

On Cemetech, it's true that it is a little less friendly, when people think your project is useless, either they say it or they don't say anything and you lose interest by yourself.

I am not saying that one is better than the other, one can lead to some time wasting if you keep on working on an "awesome" useless project, and the other one can lead you to give up on something that was useless but could improve your coding skills. I am just saying that if you want only constructive criticism, without being flooded with "awesome", Cemetech is the place to be. If you want more motivation than constructive criticism (not saying that people are not constructive, saying that they are even more motivating), then you should probably visit Omnimaga too.

The best idea obviously being on both sites Wink
Actually this isn't 100% true anymore, because on Omni, when somebody posts source code there is often somebody who will criticize parts that needs optimizing and for non-game projects, although that is more frequent with Axe code, and I did see some replies questioning the usefulness of a project before (including rougher comments like in this topic, but again from late 06 to early 08 the community was pretty much a war zone x.x). It's just not as frequent and is more kept an eye on if reported or if people's karma levels start dropping. On Cemetech, on the other hand, I noticed it happens less often than it used to, probably because the only people that usually blatantly told someone that his project is useless are no longer active or have mellowed out.


I would say that the issue about this particular project is that people probably wonder what does it offers as unique feature that competitors such as Axe, Grammer and Batlib lack and what would make people switch to your language (other than slow TI-BASIC speed and not liking low level languages)?
spud2451 wrote:
Ok Yes there was some constructive criticism, but when you also use that much negativity it makes some people feel like what they are doing isn't worth the community's time and effort to recognize. So all I'm saying is that you should just increase the constructiveness and decrease the skepticism in your posts with new projects. I was not saying that you guys weren't constructive in some way, I was saying that you need to tone down the criticism in "Constructive Criticism".


this sounds like a great learning opportunity for you, finding out about grammars, syntax trees, etc. however, you're choosing to share this project with others, so the things that have been said thus far are definitely constructive criticism. if you actually want anybody to use this language, implementing direct compilation to asm (with bcalls for float ops, probably), is a must. adding list comprehensions is also a good idea that would give you something unique to differentiate your language from the others already available.
DJ_O wrote:
when somebody posts source code there is often somebody who will criticize parts that needs optimizing

Haha ! Why do I feel like this was aimed to me ? Razz
But what I do is not criticizing, it's helping them code better. I am not giving them Runer code as in "here's how you should code you Axe noob", I am just pointing at opts that should be obvious so that they can understand how Axe works instead of writing Basic-like code, and discover the other opts themselves (and I am a Axe noob compared to Runer so I will probably never say that someone is a Axe noob).
Moreover, I think that if they posted the source code, it's for people to have a look at it, right ? Wink
Btw, I've added simple list comprehension and text sprites. Here's an example of both:

List comprehension:

Code:

Spiral:
L1 = [1,2,3]
L2 = [I+2 for I in L1]

//L2 now equals [3,4,5]

//The compiled code is:

{1,2,3}->L1
ClrList L2
For(Y,1,dim(L1
L1(Y)->I
I+1->L2(1+dim(L2
End


Text Sprites

Code:

Spiral:
Sprite(1,2,"H---n")

//The first argument is the x and the second is the y

//This compiles to:

For(Z,0,length("H---n")-1)
Text(2,1+Z,sub("H---n",Z+1,1))
End
Text(2,1+Z,"   ")


Well that's pretty much the latest update. Thanks for the ideas!
You should have your code compile to more optimized code--such as not including close parens at the end of the line.

Additionally, it seems you've used theta, Z, and Y as loop variables. You should stick to just using one so that people don't lose out on more variables, and can predict more consistently which variables are being used.
I would love to stick to just using one variable in loops, but the problem comes when you use nested for loops. See when you use the same variable in nesed for loops it will destroy the loops from the inside out (literally). I'll probably use a list to correct this this. This way they only loose out on one variable but I can use it for multiple iterators.
Note: In your first example, L2 could be evaluated simply as L1+2. This is probably the kind of optimization that would be very useful to make.
!!!Major Update!!!!
So I've been working on a major update for Spiral. This update includes something I've wanted to see in TI-BASIC for a while but no one has implemented in any way. This update now adds... ... ... CLASSES!!!! Well sorta. you can only define functions and constants for the classes. It limited but it works for the most part. One other down side is that each call is a different file. Here's a screenie to show the general idea.



So as you can see it's not perfect but as far as classes in TI-BASIC go it's definitely a good start!
  
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 2
» 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