5

Note: I know very little about the GCC toolchain, so this question may not make much sense.

Since GCC includes an Ada front end, and it can emit ARM, and devKitPro is based on GCC, is it possible to use Ada instead of C/C++ for writing code on the DS?

Edit: It seems that the target that devKitARM uses is arm-eabi.

TraumaPony
  • 10,742
  • 12
  • 54
  • 74

5 Answers5

6

devkitPro is not a toolchain, compiler or indeed any software package. The toolchain used to target the DS is devkitARM, one of the toolchains provided by devkitPro.

It may be possible to build the ada compiler but I doubt very much if you'll ever manage to get anything useful running on the DS itself. devkitPro will certainly never provide an ada compiler as part of the packages we produce.

WinterMute
  • 336
  • 3
  • 5
6

Yes it is possible, see my project https://github.com/Lucretia/tamp and build the cross compiler as per my script. You would then be able to target NDS using Ada. I have build a basic RTS as well which will provide you with local exception handling.

And @Martin Beckett, why do think Ada is aimed squarely at DoD stuff? They dropped the mandate years ago and Ada is easily usable for any project, you do realise that Ada is a general purpose programming language don't you?

Luke A. Guest
  • 556
  • 5
  • 8
  • I do plan to use your cross tools to target the DS. Maybe I'll start targeting the GBA first. – Rommudoh Mar 28 '11 at 14:32
  • I've recently managed to get a nice cross build using 4.6.2 of GCC without the use of ugly hacks. See my Careers 2.0 profile for the link. Although it isn't scripted, the instructions are on the link above. – Luke A. Guest Nov 02 '11 at 17:39
2

(Disclaimer: I don't know Ada)

Possibly.

You might be able to build devKitPro to use Ada, however, the pre-provided binaries (at least for OS X) do not have Ada support compiled in.

However, you will probably find yourself writing tons of C "glue" code to interface with the various hardware registers and the like.

Dre
  • 4,298
  • 30
  • 39
2

One thing to consider when porting a language to the nintendo DS is the relatively small stack it has (16KB). There are possible workarounds such as swapping the SRAM stack content into DRAM (4MB) when stack gets full or just have the whole stack in DRAM (assumed to be auwfully slow).

And I second Dre on the fact that you'll have to provide yourself glue between the Ada library function you'd like to use and existing libraries on the DS (which are hopefully covering most of the hardware stuff).

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
PypeBros
  • 2,607
  • 24
  • 37
0

On a practical plane, it is not possible.

On a theoretical plane, you could use one custom Ada parser (I found this one on the ANTLR site, but it is quite old) in order to translate Ada to C/C++, and then feed that to devkitpro.

However, the effort of building such translator is probably going to be equal (if not higher) to creating the game itself.

T.E.D.
  • 44,016
  • 10
  • 73
  • 134
kikito
  • 51,734
  • 32
  • 149
  • 189
  • Way too much work as writing a compiler or a translator for Ada is a huge project in itself. A very basic Ada->C/C++ translator would be doable though. – Luke A. Guest Nov 02 '11 at 17:41