Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: SirCmpwn on May 25, 2011, 07:36:24 pm

Title: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 07:36:24 pm
Hello,
I've never successfully gotten an Nspire dev environment working, so I won't be able to do this myself.  But I found an open source, loosely licensed .NET virtual machine implementation written in C that should be easily portable called Dot Net Anywhere (http://dotnetanywhere.org/).  What this means is that you could code in C# for the TI-Nspire, if one were so inclined (or VB.Net, or any other selection of CIL languages).
When I glanced at the source, it looked like it could probably happen on Nspire, if only someone spent some time on it.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 07:40:31 pm
sounds like it would need ndles to run which is unfortunately available n the new OS's yet
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 07:42:35 pm
sounds like it would need ndles to run which is unfortunately available n the new OS's yet
I never upgrade my OS until Ndless works on it, personally.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: pianoman on May 25, 2011, 07:43:58 pm
YES!!! A C# EDITOR!!!
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 07:44:14 pm
same with me now. I like 2.0.1 and OSLauncher. plus so many fun games

EDIT: Its just that chances are that not many people will develop for ndless till it is brought to the new OS
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 07:44:59 pm
YES!!! A C# EDITOR!!!
*Interpreter
You'd still need to compile off-calc and such.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 07:46:44 pm
YES!!! A C# EDITOR!!!
*Interpreter
You'd still need to compile off-calc and such.
we don't know if it will work on an Nspire yet though
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: pianoman on May 25, 2011, 07:49:51 pm
Darn :(
Oh well. If it doesn't work, I get some motivation to learn C. :P
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: AngelFish on May 25, 2011, 07:51:14 pm
Good luck, SirCmpwn. Hopefully the existing infrastructure will make it a lot easier to write, because doing a full interpreter from scratch is pretty difficult.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 07:52:27 pm
Good luck, SirCmpwn. Hopefully the existing infrastructure will make it a lot easier to write, because doing a full interpreter from scratch is pretty difficult.
Not if you write a script to generate the interpreter code.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 07:54:17 pm
Good luck, SirCmpwn. Hopefully the existing infrastructure will make it a lot easier to write, because doing a full interpreter from scratch is pretty difficult.
Not if you write a script to generate the interpreter code.
that sounds like cheating
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 08:00:10 pm
Good luck, SirCmpwn. Hopefully the existing infrastructure will make it a lot easier to write, because doing a full interpreter from scratch is pretty difficult.
Not if you write a script to generate the interpreter code.
that sounds like cheating
I call it efficiency.  Every time I have a lot of tedious code to write, I write a program to do it for me.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 08:01:04 pm
I like that idea. I should do that. XML no more manual copy/paste
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: AngelFish on May 25, 2011, 08:03:57 pm
Good luck, SirCmpwn. Hopefully the existing infrastructure will make it a lot easier to write, because doing a full interpreter from scratch is pretty difficult.
Not if you write a script to generate the interpreter code.

That strategy doesn't always work very well, particularly for non-"tedious" code.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 08:04:45 pm
you generate the original code then optimize/improve it.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 08:05:03 pm
Usually, you can find the occasional mishaps and fix them manually, but it still saves enormous amounts of time.  In addition to that, hand typing lots of code causes the same problems.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: AngelFish on May 25, 2011, 08:07:19 pm
If it wasn't implied by my last post, the search space of solutions to a general programming problem is almost unfathomably massive. Scripts might generate functional code most of the time, but there will always be some situations in which they can't generate functional code and even more situations in which the produced program is not efficient at runtime.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 08:08:31 pm
If it wasn't implied by my last post, the search space of solutions to a general programming problem is almost unfathomably massive. Scripts might generate functional code most of the time, but there will always be some situations in which they can't generate functional code and even more situations in which the produced program is not efficient at runtime.
This is true.  However, in most situations, the generated code works great, it works efficiently, and it was finished days before the hand-written code was.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: AngelFish on May 25, 2011, 08:10:43 pm
I think you generally produce good code, so if that's how you do it, more power to you. It's an interesting (read: cool) method, I'll admit.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 08:12:01 pm
I think you generally produce good code, so if that's how you do it, more power to you. It's an interesting (read: cool) method, I'll admit.
Give it a try next time you have something big to write, you'll be pleasantly surprised.  The emulation code in Stetson is generated by such means, for example.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 08:15:31 pm
so how do you make a script that does all of this for you? It seems like an interesting idea
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: SirCmpwn on May 25, 2011, 08:17:58 pm
so how do you make a script that does all of this for you? It seems like an interesting idea
The same way I write any other program.  Each script is custom-made to suit an individual purpose.  If your scripting language/programming language of choice has string manipulation, you just make it write code into a string and display it.  Sometimes I pull in external data, such as an instruction set.
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: ruler501 on May 25, 2011, 08:41:27 pm
That sounds liek a complicated idea for programming an interpreer form. It also sounds very fun. I'll have to try it sometime
Title: Re: CIL (C#) Interpreter for TI-Nspire
Post by: AngelFish on May 25, 2011, 08:47:34 pm
I think you generally produce good code, so if that's how you do it, more power to you. It's an interesting (read: cool) method, I'll admit.
Give it a try next time you have something big to write, you'll be pleasantly surprised.  The emulation code in Stetson is generated by such means, for example.

I have a genetic algorithm that does generate code for me, but frankly I could beat it without too much effort.