Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: DJ Omnimaga on February 28, 2010, 12:06:04 am

Title: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on February 28, 2010, 12:06:04 am
With the release of the Nspire exploit, I thought in the future it would be cool if somebody written a new programming language for the TI-Nspire where the syntax is exactly the same as Axe. Of course it wouldn't be editable in the TI-BASIC editor of the Nspire, the concept would be the same as other languages. An editor/converter would be made for the PC or the calculator, and it would convert the code to ARM assembly format. It would probably have to be done by somebody else who knows ARM ASM but I thought it could be an idea since not only it would provide an alternative to TI-Nspire BASIC, ASM and C, but it would be even easier to program (and learn) than the TI-Nspire native BASIC language.

Another thing that could be done is something similar to Axe where you type programs similar to TI-BASIC in the program editor built-in the calc, but the syntax would completly change, as for example, the TI-Nspire has no Input, Output nor Text commands. Different random unrelated commands would have to be found, altough since Nspire programs aren't token-based on editing, people could just write Output( anyway then the Nspire Axe parser would interpret them fine.

Such project would probably need to be started only when it is certain Axe parser syntax will not change anymore, though.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: calc84maniac on February 28, 2010, 12:17:23 am
With the release of the Nspire exploit, I thought in the future it would be cool if somebody written a new programming language for the TI-Nspire where the syntax is exactly the same as Axe. Of course it wouldn't be editable in the TI-BASIC editor of the Nspire, the concept would be the same as other languages. An editor/converter would be made for the PC or the calculator, and it would convert the code to ARM assembly format. It would probably have to be done by somebody else who knows ARM ASM but I thought it could be an idea since not only it would provide an alternative to TI-Nspire BASIC, ASM and C, but it would be even easier to program (and learn) than the TI-Nspire native BASIC language.

Another thing that could be done is something similar to Axe where you type programs similar to TI-BASIC in the program editor built-in the calc, but the syntax would completly change, as for example, the TI-Nspire has no Input, Output nor Text commands. Different random unrelated commands would have to be found, altough since Nspire programs aren't token-based on editing, people could just write Output( anyway then the Nspire Axe parser would interpret them fine.

Such project would probably need to be started only when it is certain Axe parser syntax will not change anymore, though.
Would it have to be compatible with the z80 version though? I mean, it would probably be preferable to take advantage of the extra screen space/colors and the 32-bit processor.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on February 28, 2010, 12:24:58 am
it could be different, not necessarly compatible. It could simply be similar to the point where all you have to do is copy your code from SourceCoder to notepad or the Axe Nspire editor then all you need to do is change code to use all the screen.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: Quigibo on February 28, 2010, 01:35:32 am
That would be pretty cool!  But Axe syntax is really designed around the limitations of the tokens available to Basic programmers as well as z80 itself.  If the Nspire is not token based and uses ARM assembly, it would be easier just to create a C language or something well defined since its more universal and there would be more support for it.  You would have to start from scratch either way since this isn't something that would be "portable" since it is so heavily dependent on z80 and token parsing.

I might get an Nspire myself after its finally cracked, but until then, I'm just going to stick with z80.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on February 28, 2010, 01:44:12 am
well C is alerady possible, but C is much harder than TI-BASIC. I suggested a Axe-like syntax, since it would be easier for people who hate complex languages and like the simplicity of TI-BASIC and Axe. Maybe you don't find C hard, but I myself do. I tried learning it before and gave up.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: Quigibo on February 28, 2010, 02:00:25 am
It is possible to have a language with C syntax, but still Basic style.  The biggest reason I found C difficult when I first learned it was due to all the external calls you have to make.  Like printf() had a bizarre way of displaying stuff and if you want to draw a picture to the screen, you have to import tons of libraries and use all these weird functions to communicate with different drivers, do all this initialization stuff, and it was just so frustrating!

All you have to do to make C easier is just have a built in library that supports all the essential functions like DrawXor(X,Y,Sprite) for instance.  If a sufficient built in library is created, then it becomes extremely easy to program regardless of the actual syntax.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: theUnnamed on April 13, 2010, 04:32:55 pm
I don't think you realize that toughs libraries that you have to import can't be made part of the language because c interfaces to the processor not the OS so OS calls become library calls
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: bwang on April 13, 2010, 08:20:00 pm
I think what Quigibo means is that we can have a single header file with wrappers for the commonly used functions (so for example, double buffering would be as simple as pixelOn(x,y) followed by a refresh()).
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: tensuke on April 13, 2010, 08:46:03 pm
A custom language that translates to ARM assembly would be really nice because it would open up a whole lot of developers that don't have the time to/can't learn C or asm. It would be a huge undertaking though given the Nspire's more advanced capabilities/architecture.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: bwang on April 13, 2010, 08:51:43 pm
I think what would be more feasible would be a Basic-like language that "compiles" into C.
I think C is already fairly easy to code in, though, other than a couple of annoying things (lots of headers and arrays that don't know how long they are come to mind).
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on April 13, 2010, 09:11:54 pm
well I personally found C to be rather hard when I tried it on 68k calcs. I would rather have an easier language like TI-BASIC. Axe could do.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: willrandship on April 13, 2010, 10:51:40 pm
Don't the 68Ks already have NewProg? It's basically the same thing as AXE, isn't it?
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on April 13, 2010, 11:18:28 pm
Yeah it came out after I started this thread, quite ironically. Idk if it's like Axe, though. I heard it was like 68k BASIC meaning the syntax is slightly harder than some Axe commands but easier than others.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: theUnnamed on April 24, 2010, 11:52:21 am
why not make a header file called something like "z80 lib common.h" and do this
Code: [Select]
#ifndef Z80_LIB_COMMON_H
#define Z80_LIB_COMMON_H
//all the libraries you normally need

//functions to do common tasks with inline directive on each.

#endif

and your done write it once and it works every time no needless complexity.
At the beginning of every file put #include "z80 lib common.h" and your done it all works.
I'm honestly surprised it doesn't already exist.
and you don't have to worry too much about making really efficient code cause any decent optimizing compiler will rewrite your code in to something more efficient then you could ever possibly come up with anyway so all that matters is the algorithm you use for the most part.

someone make it weeks project I would do it but I don't have the time with other stuff.  :)
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: DJ Omnimaga on April 24, 2010, 11:59:43 am
I am confused, would this be used to write some sort of macros, instructions that looks like Axe Parser, for example, becoming some sort of new language, but in the end it converts back to ASM?

Also there's still the issue of on-calc programmability. This is what is nice about TI-BASIC, Axe Parser, BBC Basic, MLC on the TI-86/AFX and 68k languages like NewProg, GFA BASIC (french) and its 68k TI-BASIC: you can program them directly on calc, meaning when in the school bus or between classes, you can still code fine. It would be nice to have a Nspire language like Axe for example that was programmable directly on the Nspire, then running a program that compiles it into ARM assembly.
Title: Re: Axe language for the TI-Nspire and 68K calcs?
Post by: Galandros on April 24, 2010, 12:42:22 pm
and your done write it once and it works every time no needless complexity.
At the beginning of every file put #include "z80 lib common.h" and your done it all works.
I'm honestly surprised it doesn't already exist.
and you don't have to worry too much about making really efficient code cause any decent optimizing compiler will rewrite your code in to something more efficient then you could ever possibly come up with anyway so all that matters is the algorithm you use for the most part.

someone make it weeks project I would do it but I don't have the time with other stuff.  :)
I am not understanding. Maybe if you give a example of usage?
The few z80 compilers don't produce very good code and that I know there is no optimizer for z80.
If you mean an API consisting of macros for z80, it does exist. :)

And I was starting to do a z80 lib with common routines like multiplication and division, so if you have some ideas I would like to know.