gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Digital Mars D (Via the GDC) for the DS?

#111643 - OOPMan - Fri Dec 08, 2006 5:57 pm

Hmmmmmm, what are the chances that one could port the D Programming Language to the DS?

There is a GNU compiler version of it, but apparently this is more of a front-end than an actual compiler...

It looks like a nice language, but whether it's suitable for the DS I'm not sure...

Anyway, it's probably a pipe dream, but does anyone have any thoughts on this?
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...


Last edited by OOPMan on Thu Mar 15, 2007 7:42 am; edited 2 times in total

#111666 - Dwedit - Fri Dec 08, 2006 10:18 pm

I hear someone made a Palm OS version already, so a DS version can't be too far away.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#111670 - OOPMan - Fri Dec 08, 2006 10:35 pm

It looks like an interesting langauage, although maybe garbage collection would be a bit of a perfomance overhead on the DS...

Ah well, after I've actually mucked about with it properly I'll decide how much I like it :-)
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#111871 - abszero - Mon Dec 11, 2006 5:29 am

It is a fantastic language, and only really held back by not having the ubiquity of C++ or Java. I'd been working in it before I started programming for the DS and having to come back to deaing with C++ was quite painful.

Though I suspect that OOPMan is right about garbage collection being a problem (since most DS programs will be time-critical things like games), I believe I remember that you can disable it. In which case you're back to having to manage memory as in C++, but retain the other benefits. You may also be able to tweak your program to avoid any allocation during the critical loops, as the collection only occurs when you allocate an object.

#111874 - OOPMan - Mon Dec 11, 2006 9:04 am

What interested me was seeing that the language was designed with compiler implementation and so forth in mind, hence it's not an "academic language" :-)

Hopefully this means it's real world usefulness is pretty high :-)
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#111954 - Sweater Fish Deluxe - Tue Dec 12, 2006 1:07 am

D on the DS means ABA on the DS!

ABA Games: www.asahi-net.or.jp/~cs8k-cyu/index_e.html

rRootage and Noiz2sa have been ported all over the place since they're in C, but his later games written using D are even more amazing. It'd be great to have them on the DS.

Though they do use SDL for some things and the DS implementation of SDL is pretty incomplete isn't it?

Still, a big "yea!" to the idea of D on the DS from me even though I've never used it myself.


...word is bondage...

#119570 - OOPMan - Sat Feb 24, 2007 11:20 am

Theoretically this is kind of necro-posting, but I did start the thread, so I think it's okay...

D is now past version 1 and the GNU D front-end is following rather nicely in its footsteps...

So, I decided to do a search on the D mailing lists for "ARM"

Guess what?

People have been working on getting the GDC front-end working with the ARM back-end of the GCC.

In particular this psot and this post are of particular interest.

So far people have been able to get D playing nicely with ARMs and at least one person has made an attempt to port GDC to devkitARM.

I think this is pretty good news and it looks pretty possible that we could get D working on the DS in the near future.

I'm going to do some more looking into this over the weekend, but I'm not a compiler monkey of note, so I'll probably have limited success...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#119578 - tepples - Sat Feb 24, 2007 1:19 pm

I'll assume that D wasn't written in D.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#119737 - Touchstone - Sun Feb 25, 2007 6:51 pm

abszero wrote:
Though I suspect that OOPMan is right about garbage collection being a problem (since most DS programs will be time-critical things like games)


To me this really only seems like a problem during loading since most games tend to not allocate any memory whilst running. And in at least J2ME you can do a garbage collection thingie whenever you want to, so when you've loaded all your game resources and are ready to go into game you can just garbage collect before the loading screen close down.
_________________
You can't beat our meat

#121452 - OOPMan - Mon Mar 12, 2007 3:16 pm

Just an update for anyone who doesn't keep an eye on the devkitARM mailing list over at SourceForge.

I have succeeded in cross-compiling GDC 0.22 (The GNU D Compiler front-end) into the devkitARM toolchain.

The process is easy enough and hence it is pretty much possible to program in D.

However, there are still some things that need to be done...

I still need to finish getting libphobos to compile. This will require a bit of work, as libphobos is more difficult to cross-compile than the base compiler front-end (No surprise...)...

I'm probably going to look into getting the alternative runtime libraries (Tango and Ares) to compile.

libphobos is probably going to require some modifications anyway, since a lot of the existing stuff in it is not of use to DS developers and it would be nice to reduce it's linked in size from 600kb to something a little more space concious.

Also, I'm going to need to go through the libnds (And maybe libgba, if anyone wants to use D on the GBA) headers in order to create skeleton D modules definitions. These are needed in order to allow people to use libnds within D programs (Something I think people will appreciate :-)

Anyway, that's that for now...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#121462 - 0xtob - Mon Mar 12, 2007 4:04 pm

You probably already know it, but I just wanted to mention there's a header conversion tool available here:

http://www.digitalmars.com/d/htod.html

Keep it up!
_________________
http://blog.dev-scene.com/0xtob | http://nitrotracker.tobw.net | http://dsmi.tobw.net

#121592 - OOPMan - Tue Mar 13, 2007 9:58 am

Indeed, I am.

However, I suspect that the libnds headers will require a bit more work than passing it through the .H conversion tool, which does have limitations...

I guess I'll just have to give it a spin and see what comes out :-)
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#122021 - 1srednA - Fri Mar 16, 2007 2:02 pm

I'd love to help out with your D stuff. I've done some header conversions before (Lua) for D. You should set up a SVN repository or so (perhaps at google code?)

note: my nick is "Anders1", but I couldn't register with it (something about "not allowed" I don't really remember)

#122029 - OOPMan - Fri Mar 16, 2007 4:09 pm

Thanks for the offer :-) Feel free to take a look at the libnds and libgba headers in your own time. Any advice or contributions would be appreciated.

At the moment I'm fairly busy, so progress and activity is somewhat slow and I haven't had much time to look at libphobos this week.

With regards to an SVN, that's a good idea. If arm-eabi-gdc gets integrated into the standard devkitARM distribution it'll probably end up in the devkitPro repositry. If a
separate one proves necessary, then I may well make use of Google code though :-)

I'll try and post something on my blog as a stopgap. At the moment the measures necessary to get GDC compiled into DKA are extremely easy, so that shouldn't be too hard to do...

Also, if you or anyone else is keen to help, then any time spent examining libphobos and developing ideas with regards to how to get it to compile nicely would be welcome.
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#122735 - 1srednA - Wed Mar 21, 2007 4:23 pm

Ah, I didn't see your post until now. I'll have a go at building devkitARM in Windows together with GDC and see if I can get anything to work.
_________________
I'm really "Anders1" but the forum would not let me register using that nick :(

#122804 - OOPMan - Thu Mar 22, 2007 9:00 am

Just to let you know, I've posted the instructions necessary to compile GDC into DKA on my blog...

Keep in mind, this doesn't compile libphobos...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#124061 - Abscissa - Mon Apr 02, 2007 10:06 pm

OOPMan wrote:
Just to let you know, I've posted the instructions necessary to compile GDC into DKA on my blog...

Keep in mind, this doesn't compile libphobos...


I'll see your successful compile and raise you one: I was able to use your instructions to build on Windows with MSYS/MinGW. Details on my site

I'll upload the Win binaries I made as soon as I get a chance. Then I plan to merge your instructions and buildscript into the actual DKA buildscripts (I'll talk to wintermute about this, but maybe I could put an option for "preliminary D support" into the official DKA buildscripts, or even binary distro)
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#124117 - Abscissa - Tue Apr 03, 2007 7:12 am

Abscissa wrote:
I'll upload the Win binaries I made as soon as I get a chance.


Ok, I've uploaded these, as well as a small sample D app for GBA. Links, details and gotchas are here.
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#124119 - OOPMan - Tue Apr 03, 2007 7:35 am

W00t! Good to hear you were able to get things built under Windows mate :-)

Anyway, with any luck we can get D included in the standard DKA build scripts, as the process of integrating it isn't really that hard, overall :-)

On my own front, I've been rather busy of late and haven't had much chance to look into getting libphobos working, which is a little sad.

Unfortunately, at the moment, the configure script included with libphobos refuses to play nicely with DKA, so I'm thinking of putting together a custom makefile (Based on the original makefile created for use with DMD) to get libphobos compiled. There are still a few stumbling blocks, though, and it looks like libphobos itself will need to be pruned somewhat in order for it to be useful.

Also, I still haven't gotten around to getting the libnds headers done up for use with D :-(
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#124122 - Abscissa - Tue Apr 03, 2007 8:04 am

Do you think it might be worth it to ditch Phobos altogether and go straight for Tango? From what I've seen, Tango seems to be well on it's way towards replacing Phobos as the de facto standard. If it turns out that Tango's build/configure scripts play nicer with DKA, maybe that would be worth it?
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#124124 - OOPMan - Tue Apr 03, 2007 8:49 am

Hmmmmmmmm, it's an idea. Last time I played with Tango, though, I didn't have much luck getting it compiled :-(

I was looking into Ares a while ago, but it looks like it needs phobos to be built in order for it to be compiled.

Is this the case with Tango?

Well, anyway, if necessary an ultra-trimmed version of phobos with only the basic stuff necessary to support advanced language features could be built...
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...

#124145 - Abscissa - Tue Apr 03, 2007 3:48 pm

OOPMan wrote:
I was looking into Ares a while ago, but it looks like it needs phobos to be built in order for it to be compiled.

Is this the case with Tango?


I'm really not sure, I'm fairly new with Tango myself. Used it briefly, but haven't tried to compile it or anything.
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#124147 - OOPMan - Tue Apr 03, 2007 4:04 pm

I took a brief look. I seems to rely on the Phobos headers and, possibly, a compile of Phobos in order to get off the ground.

No, I think that the best route may be to take a gander at stripping Phobos down (I'd like to keep GC, Threading (Which I think may be necessary for GC anyway...) and a few other useful components. The rest can be weeded out and, maybe at a later stage, compiled in the form of add-in libraries that can be included for extra functionality...)
_________________
"My boot, your face..." - Attributed to OOPMan, Emperor of Eroticon VI

You can find my NDS homebrew projects here...