www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - lowlevel programming with D?

reply alexander.panek brainsware.org writes:
Hello!

I just wondered, if there are any possibility to use D for
microcontroller-programming. The reason I ask for is just because we get started
programming microcontrollers in C (dunno which). So - as a D-fan ;o - it would
be kind to use D instead of good old C. Afaik there`s only a OS-dependent
compiler developed yet?!

Well, thanks for answers.

Alex
Nov 15 2004
next sibling parent reply Ant <Ant_member pathlink.com> writes:
In article <cnapge$4lq$1 digitaldaemon.com>, alexander.panek brainsware.org
says...

be kind to use D instead of good old C. Afaik there`s only a OS-dependent
compiler developed yet?!

check here: http://www.digitalmars.com/drn-bin/wwwnews?D.gnu Ant
Nov 15 2004
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Ant wrote:

be kind to use D instead of good old C. Afaik there`s only a

check here: http://www.digitalmars.com/drn-bin/wwwnews?D.gnu

Or here: http://home.earthlink.net/~dvdfrdmn/d/ <GDC home page> Since D has a static runtime library (libphobos.a) and has garbage collection and threading enabled by default, it does produce bigger binaries than what plain C does... (on the other hand, they are still smaller than with C++ if you also include the size of the shared stdc++ library) --anders
Nov 15 2004
parent reply "Walter" <newshound digitalmars.com> writes:
"Anders F Björklund" <afb algonet.se> wrote in message
news:cnattf$alj$1 digitaldaemon.com...
 Since D has a static runtime library (libphobos.a) and
 has garbage collection and threading enabled by default,
 it does produce bigger binaries than what plain C does...

That is true for small programs because the gc part of the library adds about 40K, but I don't believe it to be true for larger ones. In my repeated experience, D code is shorter than the equivalent C code, and over time this will add up as a smaller overall executable size.
Nov 16 2004
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
Walter wrote:

 That is true for small programs because the gc part of the library adds
 about 40K, but I don't believe it to be true for larger ones. In my repeated
 experience, D code is shorter than the equivalent C code, and over time this
 will add up as a smaller overall executable size.

I should also make the reservation that I have only tried with gcc/gdc lately, and not the Digital Mars compilers dmc/dmd (could be different) And a static library does mean less hidden baggage, than e.g. Java has ? It's already smaller than C++ while offering similar features - and more Just something to keep in mind, when comparing e.g. "Hello World" sizes (my last count: Java* 764, C 9516, D 105524, C++ 430476. Bytes, that is) --anders * = not counting the Java Virtual Machine runtime or libs, of course... (C/C++ used a static library when linking, libgcc.a and libstdc++)
Nov 16 2004
parent Sean Kelly <sean f4.ca> writes:
In article <cne0nl$1k8u$1 digitaldaemon.com>,
=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
Just something to keep in mind, when comparing e.g. "Hello World" sizes
(my last count: Java* 764, C 9516, D 105524, C++ 430476. Bytes, that is)

I've got a minimal runtime library for D that compiled "Hello World" to 59,420 bytes, and it should be possible to get this quite a bit smaller with some work. Sean
Nov 16 2004
prev sibling parent Sean Kelly <sean f4.ca> writes:
In article <cndr3i$1cos$2 digitaldaemon.com>, Walter says...
"Anders F Björklund" <afb algonet.se> wrote in message
news:cnattf$alj$1 digitaldaemon.com...
 Since D has a static runtime library (libphobos.a) and
 has garbage collection and threading enabled by default,
 it does produce bigger binaries than what plain C does...

That is true for small programs because the gc part of the library adds about 40K, but I don't believe it to be true for larger ones. In my repeated experience, D code is shorter than the equivalent C code, and over time this will add up as a smaller overall executable size.

And it's worth noting that a runtime could be designed specifically for systems where multithreading and/or extensive library support are not needed. Also, the garbage collector should probably eventually be buildable in both single and multi-threaded versions (probably not too much work with some version blocks). Sean
Nov 16 2004
prev sibling parent alexander.panek brainsware.org writes:
In article <cnaqr0$6kg$1 digitaldaemon.com>, Ant says...
check here:
http://www.digitalmars.com/drn-bin/wwwnews?D.gnu
Ant

Thanks for this quick answer! Alex
Nov 15 2004
prev sibling parent reply Thomas Kuehne <thomas-dloop kuehne.thisisspam.cn> writes:
alexander.panek brainsware.org schrieb am Montag, 15. November 2004 18:37:

 I just wondered, if there are any possibility to use D for
 microcontroller-programming. 

Depending on what you are going to do you might also have a look at: http://www.geocities.com/one_mad_alien/dkernel.html Thomas
Nov 15 2004
parent J C Calvarese <jcc7 cox.net> writes:
Thomas Kuehne wrote:
 alexander.panek brainsware.org schrieb am Montag, 15. November 2004 18:37:
 
 
I just wondered, if there are any possibility to use D for
microcontroller-programming. 

Depending on what you are going to do you might also have a look at: http://www.geocities.com/one_mad_alien/dkernel.html Thomas

Some posts are referenced here that involve D kernel discussions (included dkernel): http://www.dsource.org/forums/viewtopic.php?p=420#420 -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Nov 15 2004