Anyone know开发者_Go百科 what it would take to get .NET or Mono to run on a TI graphing calculator? I know the full framework probably wouldn't fit on the device, but a subset would probably server very well.
Update: When I say ".NET / Mono," what I am really meaning is to get a C# or VB.NET application to compile for the device so it could execute. I know that the .NET Framework is HUGE and wouldn't fit on the device, but that's not what is necessary. All you'd need is a .NET style API that exposes the devices native functionality to the C# or VB.NET programming languages.
I'm just curious if anyone has looked into this. I don't know what practical applications it would really have, but would definitely be interesting.
I would very seriously doubt it. 24K of RAM. Even a subset would barely fit.
Edit: It would be possible to implement a ".NET-like" API, as asked by the OP, but to be honest, the point would be a little bit hard to see. The value of .NET is not in its "amazingly well structured API" (because it's not particularly amazingly structured); it's in the usage of the CIL and managed code, and some interesting features that fundamentally depend on those (generics, lambda functions, delegates, etc.).
This imaginary embedded .NET platform - we could call it "D2ME", would be to .NET (and Mono) what J2ME is to Java. Notably, however, the J2ME standard calls for a device with at least 512K ROM and 256K RAM. Keep in mind we can probably not change the TI-84 ROM, which means what in J2ME is in ROM, would also have to fit in the 48K of RAM of the calculator.
Even this could probably be achieved, if almost all .NET classes and help functions are omitted, thus negating most of the .NET benefits.
Also, if you want "the features of .NET but not the runtime", what are you asking for? A C# to native compiler? Of course doable, but what about those coding for VB.NET? Then you would have to create a native compiler for VB.NET as well. Of course, doable, but hard. One point of the CIL is to avoid that.
Which brings us to the matter of compilation, specifically the target of the compiler. The TI-84 has an 8-bit processor, the Z80, while pretty clever for its size, has severe constraints. I think it would be hard to do anything resembling the C# type system with native Z80 instructions. Of course, it could emulate a 16-bit CPU like Steve Wozniak's SWEET16, but that would almost bring us back to a CIL.
All in all, I think this is one of those "probably possible but very improbable" napkin projects. And I haven't even touched upon the issue of performance. It's a nice thought experiment, but I would never have the motivation to build something like that. :-)
You'd have to specifically design even native applications to fit that space. There's no way that managed code could fit in 24k.
Edit: The languages? First, you'd have to port the BCL. That alone probably takes up more than 48kb.
There's pretty close to no point to trying that, especially since a VM on such a limited system is just barely practical (you might get UCSD Pascal running on a TI-84Ag if you're a glutton for punishment and you have the pcode compiler running on the desktop instead of the calculator, but even that's stretching it). The OO stuff is almost entirely out of the question; even Apple, who was likely the first to mainstream OO frameworks on the desktop, needed the Mac Plus, a 16/32-bit processor, and 512K of memory to pull it off, over a year after the first Macs shipped, still using a single-tasking OS. And mind you that's with native 68000 code on a system with 3x the memory of a TI-89.
You might be able to pull it off on an Nspire though, if you know enough about low-level hacking (the caveat being that I'm not sure there's really anyone who does outside TI). The Nspire is vaguely in the same class as the Nintendo DSi (albeit with only one processor instead of two), so it's powerful enough to make getting involved in the hacking community and creating things like a .NET clone worthwhile.
I think you would be better off just using TI-GCC.
Vala is probably your only hope to do anything like C# http://live.gnome.org/Vala
精彩评论