#67468 - dusda - Wed Jan 18, 2006 9:20 am
Does anybody know if it is possible to get some form of the .NET framework functional on a DS? I have not done any homebrew on one yet, but I am about to gather all the hardware (the proper wireless card, a flash cart, etc) to do so. I can manage coding in C or C++, but I would much prefer C#.
Were I able to utilize .NET on a DS, well, my head swims with the possibilities :).
EDIT: After searching the forums, it looks like this has been brought up once before. However, that was back in late 2003, so I figure this topic thread has some validity.
#67471 - NoMis - Wed Jan 18, 2006 9:32 am
I doubt that the DS could handle a .NET runtime. Garbage collection and Just in Time compilation are just to costly for the DS to handle.
I advise you to stick with C/C++. It shares much of the syntax with C# but you have to learn to use pointers and memory management.
NoMis
_________________
www.gamedev.at - The austrian gamedev site
hde.gamedev.at - The Handheld Dev Env plugins for Eclipse
#67472 - dusda - Wed Jan 18, 2006 9:36 am
NoMis wrote: |
I doubt that the DS could handle a .NET runtime. Garbage collection and Just in Time compilation are just to costly for the DS to handle.
|
There is a tool called ngen.exe that compiles .NET code from the Intermediate Languge (MSIL) to machine code; in theory, couldn't ngen be used to compile directly to an ARM processor, like it does for x86?
EDIT: Garbage collection can also be directly managed by using specific using blocks, and calling Dispose() at key points.
Quote: |
I advise you to stick with C/C++. It shares much of the syntax with C# but you have to learn to use pointers and memory management.
|
You can use the 'unsafe' feature in .NET to directly manage these things; I have not done this personally, but it can be done.
Basically I'm just interested in this for curious research more than actual performance. Performance is not of great concern to me.
#67477 - JaJa - Wed Jan 18, 2006 10:35 am
ngen.exe would have to be rewritten to output ARM machine code though.
#67479 - NoMis - Wed Jan 18, 2006 11:08 am
ngen msdn entry
ngen does only precompile the IL and puts the resulting code in a cache. This eleminates the need to JIT compile the code every time it gets executed. The runtime can just take the cached compiled code.
There are still other runtime features like the garbage collection that need to be performed.
FYI, dispose is not actually destroing an object. It just makes it available for garbage collection. You have no control when the object is actually deleted.
I'm not familiar with the unsave feature though.
Theoretically someone needs to write a compiler that acutally takes the C# code and generates an ARM binary while you need to do any memory management yourself. You could basically look at it as a reimplementation of the language.
Questions is if this is of any use because doing so would actually take away any advantage C# and the .NET Framework has (JIT, Garbage collection, all the cool classes, ...) so you can code in C++ right away.
NoMis
_________________
www.gamedev.at - The austrian gamedev site
hde.gamedev.at - The Handheld Dev Env plugins for Eclipse
#67483 - Lupin - Wed Jan 18, 2006 1:16 pm
In case you really want to port .Net FW to DS you better get a 512mb memory upgrade for your DS :P
This idea is just stupid... you could go for java VM though (if this wasn't already done)
_________________
Team Pokeme
My blog and PM ASM tutorials
#67495 - brian33x51 - Wed Jan 18, 2006 5:16 pm
Lupin wrote: |
In case you really want to port .Net FW to DS you better get a 512mb memory upgrade for your DS :P
This idea is just stupid... you could go for java VM though (if this wasn't already done) |
Not enough memory to do this and have a decent program.
Modern desktop programming == how much bloat can you code?
That's one thing I really like about all of these new embedded light weight devices that have been coming out. It makes people reconsider coding, interface, feature and usage issues.
Bloat sucks.
#67557 - dusda - Thu Jan 19, 2006 12:58 am
Please, don't tell me how you think .NET is bloated or how shitty and slow you believe it is. I asked if it were possible, and what problems I would have to hurdle, not whether it .NET is awesome or not. I didn't ask "What do you guys think of .NET?" It is very frustrating to ask a question about a technology and be met with nothing but negativity and contempt, rather than constructive discussion.
If you have an intelligent set of reasons why .NET isn't possible, or too difficult to implement, then please, inform me (thank you, NoMis). But if you're just here to trash talk (Lupin), then please don't waste everyone's time.
#67558 - josath - Thu Jan 19, 2006 1:28 am
There are two parts to using C# and .NET.
1. You'd have to write a C# -> ARM asm compiler (you could then use the gcc arm assembler, no need to rewrite this part). Depending on how good you are, and how many compilers you've written in the past, you might be able to get a alpha quality version within a month or two of hard work. If you have no experience writing compilers, but are smart, maybe five months? (these are educated guesses here, there are many factors)
2. You'd have to re-implement the .NET framework classes, either in C# itself, or in another language. How much work this would be, depends on how much of the framework you want. If you want all of the GUI stuff ("Forms" I think it's called? not sure), i would say forget it.
If you just want a few basic classes, like Array, etc, and you would access the DS hardware directly (through some special function you'd have to add, unless C# normally lets you access arbitrary memory addresses), then maybe another month could get these written.
This would be a large project for a single coder to undertake. It would only be feasible if he was very experienced, and had plenty of time to dedicate.
So, realistically, the answer is probably no, you cannot use C# or .NET to write applications for DS.
#67563 - doublec - Thu Jan 19, 2006 1:50 am
Portable .NET (http://www.southern-storm.com.au/portable_net.html) is an open source .NET implementation. It runs on ARM. I used to run it on a sharp zaurus.
It might be a useful starting point to try and get something going on the DS.
#67571 - Abscissa - Thu Jan 19, 2006 2:53 am
dusda wrote: |
Does anybody know if it is possible to get some form of the .NET framework functional on a DS? I have not done any homebrew on one yet, but I am about to gather all the hardware (the proper wireless card, a flash cart, etc) to do so. I can manage coding in C or C++, but I would much prefer C#. |
You might have better luck with D. Like C# and Java, it's another "C++ sucks so let's fix it" languages, but it compiles to native code instead of a virtual machine, so it's actually useful for systems and embedded programming. It should be a lot easier to get working on GBA. All you have to do is merge DevKitARM with GDC (A project that adds D support to GCC).
I've actually done this awhile ago. I never got around to compiling the D standard libraries (Phobos) so I couldn't use classes, but it still worked. (I couldn't use garbage collector either, because, at the time, GDC was relying on Java for garbage collection, but that shouldn't be an issue with the current versions.)
EDIT: I was actually referring to GBA in my post, I just now noticed you were talking about DS. I still haven't touched DS homebrew yet but I can't imagine using D on the DS would be any different from doing it on the GBA.
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.
#67598 - NoMis - Thu Jan 19, 2006 9:50 am
doublec wrote: |
Portable .NET (http://www.southern-storm.com.au/portable_net.html) is an open source .NET implementation. It runs on ARM. I used to run it on a sharp zaurus.
It might be a useful starting point to try and get something going on the DS. |
Mono is A LOT more mature then Portable .NET. I used to look at Portable.NET in the past but there was not really any progress done.
Mono progresses great and they already have working applications like Banshee, F-Spot, ... that proove Mono's usability.
Mono has an ARM implementation as well but thats more toward pocket PC's. DS will not have enough power and espeacially RAM to handle a full featured .NET runtime.
NoMis
_________________
www.gamedev.at - The austrian gamedev site
hde.gamedev.at - The Handheld Dev Env plugins for Eclipse