Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => Topic started by: qazz42 on September 06, 2010, 03:12:20 pm
-
(I hope I am in the right forum)
Well, I was wondering if this was possible, I really like C# and it would be awsome for it to be ported to the nspire
Though I don't know the possibility of this happening because C# is not compiled, it is interpreted..
Discuss
(my 333'rd post)
-
Woah... Wut?
I didn't think C# was interpreted, I could have sworn it was compiled... You might be thinking of java which is interpreted on the fly (as it is being run). Python is also interpretted.
Regardless, I think C# would be ok for the Nspire. I'd personally stick with C.
-
Player.. uhh.. It is interpreted..
-
Yeah, C# is interpreted, though the .NET VM and Mono, just like the JVM, have some form of JIT-ing.
For completeness: both C# and Java can be compiled [Ahead Of Time], but then you lose portability, and some capabilities.
[EDIT: making the second sentence more precise]
-
thanks Lionel
Now back to the topic!
Can C# be ported to the nspire once we get the proper libraries, this will make programming on the nspire alot easier for us .NET framework users (Like SirCmpwn)
-
The .NET framework takes 850 MB of disk space. You couldn't fit it on 26 Nspires.
-
Crap. perhaps we can make our own C# interpriter?
-
Someone would most likely have to write a dumbed-down version of it, assuming it's interpreted, meaning a lot of stuff would be missing.
Maybe someone could write a similar language but compiled, though. At the same time, it would be nice to have Axe Parser for Nspires
-
I agree DJ, I think that could work, it could do without things like Web applications and such
-
C#, well how about C++
-
Let's go for C++ support first. The Nspire is slow enough without the overhead of an interpreter.
It's probably possible though, since Java runs on slow, ARM platforms.
-
i am sure it could be possible. I am certain it can't be any worse than TI-BASIC interpreter source code
-
For c++, isn't it just a matter of using g++ rather than gcc?
-
We don't have a standard library, and it is doubtful that the OS contains a C++ standard library.
-
Isn't c++ backwrds compatible with C code?
-
I know that C++ should be first, but I still want to try and expand the idea of C# on the nspire if it is humanly possible
-
It is certainly possible; however, its uses probably will be limited by the overhead of the interpreter.
It is *much* harder than C++. We already have a C++ cross-compiler, but there isn't a complete C# interpreter for ARM devices yet.
-
Bwang, good point, perhaps I could work with someone to port C# to the nspire....
out of curiosity, what would it take to build your own interpreter?
-
Not much, (imo). In TI-Basic, an interpreter is as easy as:
"sub(str1,A,1->v
For(A,1,Length(str1
If v="command
Do stuff
If v="other command
Do other stuff
End
It would be about the same thing in C, might be fun to write if I knew how to access files on the calc. I'd be happy to help you :) (although other people would probably be better suited to the job)
-
of cousre, I wish TI-Basic had a To.Upper method :P
and thats interesting player, if we get further on this, I would love to work with you
-
I've been thinking about doing this, although it would probably be easier to port one.
_player1537, you access files by using filesize() (in the utils.h in skeleton.zip attached to the first post on the Routines thread) to get the size, the fread to read it into an array, like so:
FILE* f;
int fsize;
char* buf;
f = fread("/documents/Examples/thegame.tns");
fsize = filesize(f);
buf = (char*) malloc(fsize);
fread(buf, 1, fsize, f);
close(f);
-
Isn't c++ backwrds compatible with C code?
C++ is partially backwards-compatible with C (in various situations, e.g. some forms of typecasts, a C++ compiler will refuse code that is valid in C), and it is interoperable with C (within a given ABI scheme, that is) through "extern C { }" blocks.
-
I've been thinking about doing this, although it would probably be easier to port one.
_player1537, you access files by using filesize() (in the utils.h in skeleton.zip attached to the first post on the Routines thread) to get the size, the fread to read it into an array, like so:
...
f = fread("/documents/Examples/thegame.tns");
...
close(f);
I'm sure these were typos, but those should be fopen and fclose. Just so nobody gets confused :)
-
*facepalm* C# isn't interpreted...
At compile-time, it is compiled almost all the way. Then, at run-time, it is JIT compiled (Just-In-Time) the rest of the way. You can do the second step whenever you like and save the binary, thus making it not interpreted.
I have been planning for a while to make a .NET Framework-like thing and object oriented C# based language for the TI-83+/84+ (SE).
-
I assume that would be for KnightOS?
I wonder how easy it would be? Would it take like most of the calc memory?
Also no facepalming at people who are learning Sir. We do not want to lose members.
-
Microsoft made a .NET Compact Framework made to fit on most handheld devices with low disk space, such as phones running Windows CE. According to Wikipedia, it takes up 12 MB, which could fit on the nspire. There is also the .NET Micro Framework, which takes no more than 300KB of space and doesn't need an OS to run, it could even fit on a TI-84. So C# on the nspire should be possible with at least the .NET Micro Framework. Plus the fact Microsoft announced they will release the .NET Micro Framework 4.0 source code under an Apache License 2.0, it would be awesome if someone manages to run some C# on the nspire.
Sources:
http://en.wikipedia.org/wiki/.NET_Compact_Framework
http://en.wikipedia.org/wiki/.NET_Micro_Framework
-
Mhmm, if it's 12 MB and cannot be shrinked in size, it would take pretty much all of the Nspire mem or close. I think the original OS 1.1 leaves you with like 14-17 MB free x.x
Will the .NET Micro Framework thing be smaller?
EDIT: Nvm checked Wikipedia and it seems pretty small for the Nspire.
-
*facepalm* C# isn't interpreted...
At compile-time, it is compiled almost all the way. Then, at run-time, it is JIT compiled (Just-In-Time) the rest of the way. You can do the second step whenever you like and save the binary, thus making it not interpreted.
I have been planning for a while to make a .NET Framework-like thing and object oriented C# based language for the TI-83+/84+ (SE).
D: IT ISNT?!!?!?! I did not know that.... my C# book says it is
-
SirCmpwn, I already mentioned early in this topic that there are JITs in the .NET interpreters ;)
(and I have just edited the corresponding post to make "AOT" explicit)
-
Lionel, okay. I'm just pointing out that it doesn't have to be interpreted.
DJ, probably, KOS is better suited to object oriented programming.
-
Well, the resulting .exe's are so well integrated in Windows you can mistake them for actual binaries. .NET is interpreted because you can run the same binary on all OSes with mono, much like Java. But sometimes, some executables uses Windows .dll's so you can't run it in mono.
-
Is mono something like Wine? I remember certain programs like RPG Maker VX database editor would not work in it.
-
No, Wine emulates the whole Windows while Mono is only the open source version of .NET Framework.
-
Ah ok thanks for the info :)
-
Wine Is Not an Emulator.
Just had to point that out :D
-
What is it, then? X.x
-
It's a compatibility layer that tricks Windows programs into thinking they are on Windows - a re-implementation of the Windows API, essentially.
-
Wine is more of a plug that converts a north american outlet into a european outlet. The european device thinks it's on a european outlet, when it's actually on a north american one.
Does that make any sense? My mind is shutting off for the day.
-
Ah ok I see, thanks for the clarification :)
-
Mono is only the open source version of .NET Framework.
Well, technically speaking, there's no open source version of the .NET framework ;)
Mono is a reimplementation of the .NET Virtual Machine and of many classes that form the C#/VB.Net/whatever CLI-based language.
I don't know whether Mozilla contributors have fixed the causes of the fact that Windows Firefox running under Wine under Linux is faster than Linux Firefox on Linux. It's not a matter of the compiler used for compiling the respective versions, it's a testimony to the lesser optimization of Firefox on non-Windows (because 1) the Linux memory management is better than Windows' and 2) the Wine infrastructure adds a bit of weight on top of Linux, too).
-
O_O
I leave this topic for a while, and ow I dont understand what is going on... 0x5
-
i just came back to it, i think they're moving into the details of .net framework or something, qazz 42. so now it's more like .NET framework for the nspire, not just C#. btw any progress? im confused also.
-
ah, ok, I get it
anywho, Nah, this is more about if it is possible, there is no physical work done YET