www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - System development for limited devices?

reply Trejkaz Xaoza <trejkaz xaoza.net> writes:
I've been getting curious just lately at whether anyone is planning to use
this language to develop apps for limited devices like PDAs.

libphobos.a is about 760kb at the moment, but since the bits of it are
statically linked, it only really bulks up the simplest program about 100k
or so, so I guess it wouldn't be too infeasible to use.

I'll take Palm OS as an example OS:
    - All OS library calls are in C (unlike a certain desktop OS with a
      hideous predilection for C++)
    - GCC cross-compiler is already used for building apps.
    - Java support is currently horrendously behind the times.

We have an experimental GDC compiler which fronts GCC, and combining this
with a simple wrapper for the Palm OS SDK would create the first clean, OO
framework for the Palm, which doesn't take up _much_ extra space, or
perhaps which only takes up the same amount of space as the framework you
would have to write to make the same application manageable in pure C.

Anyway, it's getting really tempting to try out.  I assume the first step
would be to try and compile libphobos, targeting m68k/palmos instead of
i686/linux.  But I wanted to see if people around here had explored this
avenue before me... perhaps you have some words of discouragement or
otherwise. :-)

TX

-- 
             Email: Trejkaz Xaoza <trejkaz xaoza.net>
          Web site: http://xaoza.net/trejkaz/
         Jabber ID: trejkaz jabber.xaoza.net
   GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F  A62C B8C7 BC8B 037E EA73
Aug 21 2004
next sibling parent John Reimer <brk_6502 NOSP_AM.yahoo.com> writes:
I've mentioned this before.  I would love to see GDC ported to the 
PalmOS.  Palm could really use an OO language like D to liven up PalmOS 
development process.  I don't have the necessary time or skill to see 
this happen, but I would love to see someone succeed here.  Like you say 
  the Palm API is all in C so D should interface with it quite well.
Aug 21 2004
prev sibling parent Ilya Minkov <minkov cs.tum.edu> writes:
Trejkaz Xaoza schrieb:

 I've been getting curious just lately at whether anyone is planning to use
 this language to develop apps for limited devices like PDAs.
Uh-oh. Keyword: RAM requierements, memory management. Any experience with Java on this platform?
 libphobos.a is about 760kb at the moment, but since the bits of it are
 statically linked, it only really bulks up the simplest program about 100k
 or so, so I guess it wouldn't be too infeasible to use.
Furthermore, some library overhead goes away even if it gets completely linked in. :) Another possible step would be to cut down Phobos.
 I'll take Palm OS as an example OS:
     - All OS library calls are in C (unlike a certain desktop OS with a
       hideous predilection for C++)
And what certain desktop OS do you mean? If you mean Windows, then what you mean is COM and can easily be acessed from plain C. ComObj->vtbl->MethodName(ComObj, ...); Or, if you mean another, really C++ operating system, though it gets itself into trouble now with the 2.9x->3.x ABI change, it is the most beautiful OS API i was to see so far.
     - GCC cross-compiler is already used for building apps.
\o/
     - Java support is currently horrendously behind the times.
Hm... Aren't you afraid to get D support which would be "behind the times" as well? But at least you get a more powerful and performant language as Java.
 We have an experimental GDC compiler which fronts GCC, and combining this
 with a simple wrapper for the Palm OS SDK would create the first clean, OO
 framework for the Palm, which doesn't take up _much_ extra space, or
 perhaps which only takes up the same amount of space as the framework you
 would have to write to make the same application manageable in pure C.
True.
 Anyway, it's getting really tempting to try out.  I assume the first step
 would be to try and compile libphobos, targeting m68k/palmos instead of
 i686/linux.  But I wanted to see if people around here had explored this
 avenue before me... perhaps you have some words of discouragement or
 otherwise. :-)
The first step would be to try and compile the compiler. :) Then you need to get the Garbage Collector working. Is there Boehm GC for Palm? If yes, it's gonna be easy. If no, then... good luck. Anyway, i believe the experience made in this field would be useful anyway. If i ever get enough corage to do so i would want to try to get D working on the old Sega Dreamcast, and there is another person interested in porting to Playstation 2. So any experience with PDAs and embedded devices would be of great value. Perhaps it may also spawn ideas on improving the compiler/ language/ library. One dream of mine would be to write a D compiler which would output a single large module for the whole D program, agressively optimized and with all the unused crud agressively thrown out, a la Sather. Don't know to what extend this is possible, and i definately don't seem to have time to do it in foreseeable future. No debugging possible but another value - last tight optimizations. Naturally, unlike the current compiler, it should be written in D. Output can be C with compiler-specific extensions - GCC has some useful pragmas and intrinsics which are a nice match to some of D's performance features. -eye
Aug 27 2004