www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Gdc & avr

reply Andrea Fontana <advmail katamail.com> writes:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Is it possible to compile for avr (atmel) platform using gdc? It would
be interesting for arduino development...
Feb 03 2012
next sibling parent reply =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <xtzgzorex gmail.com> writes:
On 03-02-2012 09:47, Andrea Fontana wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It would
 be interesting for arduino development...

Not currently. We don't even have a standard version identifier for that platform. -- - Alex
Feb 03 2012
next sibling parent reply Andrea Fontana <advmail katamail.com> writes:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

How much work is needed to support atmel in your opinion?

Il giorno ven, 03/02/2012 alle 10.40 +0100, Alex R=C3=B8nne Petersen ha
scritto:

 On 03-02-2012 09:47, Andrea Fontana wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It would
 be interesting for arduino development...

Not currently. We don't even have a standard version identifier for that=

 platform.
=20
 --
 - Alex

Feb 03 2012
parent =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <xtzgzorex gmail.com> writes:
On 03-02-2012 11:33, Andrea Fontana wrote:
 How much work is needed to support atmel in your opinion?

 Il giorno ven, 03/02/2012 alle 10.40 +0100, Alex Rønne Petersen ha scritto:
 On 03-02-2012 09:47, Andrea Fontana wrote:
  Is it possible to compile for avr (atmel) platform using gdc? It would
  be interesting for arduino development...

Not currently. We don't even have a standard version identifier for that platform. -- - Alex


I'm not really qualified to say. Iain? -- - Alex
Feb 03 2012
prev sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 3 February 2012 10:36, Alex R=F8nne Petersen <xtzgzorex gmail.com> wrote=
:
 On 03-02-2012 11:33, Andrea Fontana wrote:
 How much work is needed to support atmel in your opinion?

 Il giorno ven, 03/02/2012 alle 10.40 +0100, Alex R=F8nne Petersen ha
 scritto:
 On 03-02-2012 09:47, Andrea Fontana wrote:
 =A0Is it possible to compile for avr (atmel) platform using gdc? It w=




 =A0be interesting for arduino development...

Not currently. We don't even have a standard version identifier for tha=



 platform.

 --
 - Alex


I'm not really qualified to say. Iain? -- - Alex

In the event that we can't match the platform / cpu to a pre-defined identifier, we just emit what the configure scripts tell us. So, for CPU-VENDOR-TARGET, gdc would emit CPU and TARGET as version identif= iers. --=20 Iain Buclaw *(p < e ? p++ : p) =3D (c & 0x0f) + '0';
Feb 03 2012
prev sibling next sibling parent reply "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

"Andrea Fontana" <advmail katamail.com> wrote:
Is it possible to compile for avr (atmel) platform using gdc? It would =

AVR is 8-bit harward architecture while D is designed for at least 32 = bits. Besides that AVR's have from (less then 1) to (a few) kB of RAM so = it needs another standard library with no GC. Guess that's a lot of = work, so don't expect it any time soon even if someone will try to = implement it.
Feb 03 2012
next sibling parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

There are 32 bit avrs.  Search for 'AVR32'.
  "Alex_Dovhal" <alex_dovhal yahoo.com> wrote in message =
news:jgggnk$2vev$1 digitalmars.com...
  "Andrea Fontana" <advmail katamail.com> wrote:
  >Is it possible to compile for avr (atmel) platform using gdc? It =
would be interesting for arduino development...=20

  AVR is 8-bit harward architecture while D is designed for at least 32 =
bits. Besides that AVR's have from (less then 1) to (a few) kB of RAM so =
it needs another standard library with no GC. Guess that's a lot of =
work, so don't expect it any time soon even if someone will try to =
implement it.
Feb 03 2012
parent reply "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Daniel Murphy" <yebblies nospamgmail.com> wrote:
There are 32 bit avrs.  Search for 'AVR32'.

Feb 03 2012
next sibling parent reply "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Andrea Fontana" <advmail katamail.com> wrote:
In this case can we hope for a d frontend?

means Harvard Architecture (where Program code and RAM are physically = different). Also internal RAM of a few KB and no Linux. If it'll be MCU then it can have Linux OS, so theoretically it can have = GDC ported.
Feb 03 2012
parent reply "Paulo Pinto" <pjmlp progtools.org> writes:
Content-Type: text/plain;
	charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

The only language without runtime is pure assembly.

All high level languages require a runtime library, even C, despite what =
many people think.

Now in this case what would be nice would be the possibility to generate =
code that runs on top of the arduino without any
real OS. This is a common use case in embedded systems and here the =
runtime has even an higher value as it takes the
role of an OS.

--
Paulo

"Manu" <turkeyman gmail.com> wrote in message =
news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...
On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

  >Andrea Fontana" <advmail katamail.com> wrote:
  >In this case can we hope for a d frontend?

  That depends if it's MCU or MPU. If it will be MCU(like ARM7TDMI), =
which means Harvard Architecture (where Program code and RAM are =
physically different). Also internal RAM of a few KB and no Linux.
  If it'll be MCU then it can have Linux OS, so theoretically it can =
have GDC ported.

Eh? Why would GDC depend on linux at all? If you disable the GC (and =
dependent language functionality), and manage to do something about the =
horrible exe bloat, there's no reason it shouldn't be able to target =
anything...
The obvious advantage over C is the syntax features. Clearly D as a =
*language* shouldn't DEPEND on the druntime, other than some language =
features that imply GC, like dynamic arrays/etc.

Is the toolchain not capable of producing a working exe without linking =
any library? Surely you can write a totally raw app with no libs at all? =
(assuming you avoid language features that make implicit druntime calls)
Feb 03 2012
parent reply Paulo Pinto <pjmlp progtools.org> writes:
So are you writting your own crt0 startup code?

Are you also creating the code that takes care to validate if there
are atexit() handlers in need to be called after main?

Are you writing the code that takes care to handle program arguments
and passing them to main() or whatever is your program entry point?

Because if you aren't, then you are using C runtime library no matter what.

--
Paulo


On 03.02.2012 20:32, Manu wrote:
 On 3 February 2012 16:45, Paulo Pinto <pjmlp progtools.org
 <mailto:pjmlp progtools.org>> wrote:

     The only language without runtime is pure assembly.


 And C.. there's no requirement to link the CRT in a C app. In fact, in
 many of my projects, I don't.
 I frequently find that the ONLY function I use from the CRT is
 sprintf... which I really should write(/copy) my own version of, so I
 can never link a CRT again :P

     All high level languages require a runtime library, even C, despite
     what many people think.


 Wrong, the C _language_ depends on NOTHING in the CRT. I prefer to avoid
 linking it wherever possible. Strangely enough, I find the 'standard' C
 library to be one of the least standard libraries out there, and avoid
 it for that reason.

     Now in this case what would be nice would be the possibility to
     generate code that runs on top of the arduino without any
     real OS. This is a common use case in embedded systems and here the
     runtime has even an higher value as it takes the
     role of an OS.


 All that's required is a toolchain that's capable of producing an exe
 without the requirement to link any compulsory library.

     --
     Paulo
     "Manu" <turkeyman gmail.com <mailto:turkeyman gmail.com>> wrote in
     message news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...
     On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com
     <mailto:alex_dovhal yahoo.com>> wrote:

         __
          >Andrea Fontana" <advmail katamail.com
         <mailto:advmail katamail.com>> wrote:
          >In this case can we hope for a d frontend?
         That depends if it's MCU or MPU. If it will be MCU(like
         ARM7TDMI), which means Harvard Architecture (where Program code
         and RAM are physically different). Also internal RAM of a few KB
         and no Linux.
         If it'll be MCU then it can have Linux OS, so theoretically it
         can have GDC ported.

     Eh? Why would GDC depend on linux at all? If you disable the GC (and
     dependent language functionality), and manage to do something about
     the horrible exe bloat, there's no reason it shouldn't be able to
     target anything...
     The obvious advantage over C is the syntax features. Clearly D as a
     *language* shouldn't DEPEND on the druntime, other than some
     language features that imply GC, like dynamic arrays/etc.
     Is the toolchain not capable of producing a working exe without
     linking any library? Surely you can write a totally raw app with no
     libs at all? (assuming you avoid language features that make
     implicit druntime calls)

Feb 04 2012
parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
I'll take it you've never actually used c on a small embedded system?

Of course you're doing all those things, if they're needed.  Very low level 
programming in c does not need a runtime at all. 
Feb 04 2012
next sibling parent "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Daniel Murphy" <yebblies nospamgmail.com> wrote:
 I'll take it you've never actually used c on a small embedded system?

 Of course you're doing all those things, if they're needed.  Very low 
 level programming in c does not need a runtime at all.

Probably you can stub all C runtime initializations. But why? Common C at least adjusts stack pointer, generates interrupt jumps/calls table, initializes data, clear bss and calls main(), doing this manually wouldn't make code shorter.
Feb 04 2012
prev sibling parent Paulo Pinto <pjmlp progtools.org> writes:
On 04.02.2012 13:56, Daniel Murphy wrote:
 I'll take it you've never actually used c on a small embedded system?

 Of course you're doing all those things, if they're needed.  Very low level
 programming in c does not need a runtime at all.

All those things are language runtime according to the Computer Science definition, without them your C code won't run.
Feb 04 2012
prev sibling parent reply "Daniel Murphy" <yebblies nospamgmail.com> writes:
Heh, I didn't realize that.  I actually build an fpga clone of atmega64 last 
year and would love to get D compiling on it, but other things tend to take 
priority.

It probably wouldn't be too hard (if you could get the cross compiler 
working) to stub out most of druntime and get it to compile.  The syntax 
improvement would alone would make it a great alternative to c.

"Alex_Dovhal" <alex_dovhal yahoo.com> wrote in message 
news:jggjg1$2i7$3 digitalmars.com...
 "Daniel Murphy" <yebblies nospamgmail.com> wrote:
There are 32 bit avrs.  Search for 'AVR32'.


Feb 03 2012
parent "Nick Sabalausky" <a a.a> writes:
"Daniel Murphy" <yebblies nospamgmail.com> wrote in message 
news:jggok5$b5i$1 digitalmars.com...
 The syntax improvement would alone would make it a great alternative to c.

Abolutely. I'd love to see a "Lean D" for such uses.
Feb 03 2012
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
--f46d044469f988975704b80e327d
Content-Type: text/plain; charset=ISO-8859-1

 Atmel also Arm based 32bit microcontrollers

On Fri, Feb 3, 2012 at 9:44 PM, Daniel Murphy <yebblies nospamgmail.com>wrote:

 **
 There are 32 bit avrs.  Search for 'AVR32'.

 "Alex_Dovhal" <alex_dovhal yahoo.com> wrote in message
 news:jgggnk$2vev$1 digitalmars.com...
 "Andrea Fontana" <advmail katamail.com> wrote:
Is it possible to compile for avr (atmel) platform using gdc? It would be

AVR is 8-bit harward architecture while D is designed for at least 32 bits. Besides that AVR's have from (less then 1) to (a few) kB of RAM so it needs another standard library with no GC. Guess that's a lot of work, so don't expect it any time soon even if someone will try to implement it.

--f46d044469f988975704b80e327d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable =A0Atmel also Arm based 32bit microcontrollers<br><br><div class=3D"gmail_q= uote">On Fri, Feb 3, 2012 at 9:44 PM, Daniel Murphy <span dir=3D"ltr">&lt;<= a href=3D"mailto:yebblies nospamgmail.com">yebblies nospamgmail.com</a>&gt;= </span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><u></u> <div bgcolor=3D"#ffffff"> <div><font face=3D"Arial">There are 32 bit avrs.=A0 Search for=20 &#39;AVR32&#39;.</font></div> <blockquote dir=3D"ltr" style=3D"PADDING-RIGHT:0px;PADDING-LEFT:5px;MARGIN-= LEFT:5px;BORDER-LEFT:#000000 2px solid;MARGIN-RIGHT:0px"> <div>&quot;Alex_Dovhal&quot; &lt;<a href=3D"mailto:alex_dovhal yahoo.com"= target=3D"_blank">alex_dovhal yahoo.com</a>&gt; wrote in=20 message <a href=3D"news:jgggnk$2vev$1 digitalmars.com" target=3D"_blank">= news:jgggnk$2vev$1 digitalmars.com</a>...</div><div class=3D"im"> <div>&quot;Andrea Fontana&quot; &lt;<a href=3D"mailto:advmail katamail.co= m" target=3D"_blank">advmail katamail.com</a>&gt; wrote:</div> <div>&gt;Is it possible to compile for avr (atmel) platform using gdc? It= =20 would be interesting for arduino development... </div> <div><font face=3D"Arial"></font>=A0</div> <div>AVR is 8-bit harward architecture while D is designed for at least 3= 2=20 bits. Besides that AVR&#39;s have from (less then 1) to (a few) kB of RAM= so it=20 needs another standard library with no GC. Guess that&#39;s a lot of work= , so=20 don&#39;t expect it any time soon even if someone will try to implement= =20 it.</div></div></blockquote></div> </blockquote></div><br> --f46d044469f988975704b80e327d--
Feb 03 2012
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
--f46d044469f9f47dc304b80e5305
Content-Type: text/plain; charset=ISO-8859-1

also do Arm based 32bit microcontrollers...

On Fri, Feb 3, 2012 at 10:10 PM, Danni Coy <danni.coy gmail.com> wrote:

  Atmel also Arm based 32bit microcontrollers

--f46d044469f9f47dc304b80e5305 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable also do Arm based 32bit microcontrollers...=A0<br><br><div class=3D"gmail_q= uote">On Fri, Feb 3, 2012 at 10:10 PM, Danni Coy <span dir=3D"ltr">&lt;<a h= ref=3D"mailto:danni.coy gmail.com">danni.coy gmail.com</a>&gt;</span> wrote= :<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">=A0Atmel also Arm based 32bit microcontrolle= rs<div class=3D"HOEnZb"><div class=3D"h5"><br></div></div></blockquote></di= v> --f46d044469f9f47dc304b80e5305--
Feb 03 2012
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
--f46d0447f0ea1de95104b80e8129
Content-Type: text/plain; charset=ISO-8859-1

reply but a 32bit version is in the works --
http://arduino.cc/blog/2011/09/17/arduino-launches-new-products-in-maker-faire/

On Fri, Feb 3, 2012 at 10:21 PM, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 "Daniel Murphy" <yebblies nospamgmail.com> wrote:
There are 32 bit avrs.  Search for 'AVR32'.


--f46d0447f0ea1de95104b80e8129 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable reply but a 32bit version is in the works --=A0<a href=3D"http://arduino.cc= /blog/2011/09/17/arduino-launches-new-products-in-maker-faire/">http://ardu= ino.cc/blog/2011/09/17/arduino-launches-new-products-in-maker-faire/</a><br=

<span dir=3D"ltr">&lt;<a href=3D"mailto:alex_dovhal yahoo.com">alex_dovhal= yahoo.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"im">&quot;Daniel Murphy&quot; &lt;<a href=3D"mailto:yebblies = nospamgmail.com">yebblies nospamgmail.com</a>&gt; wrote:<br> &gt;There are 32 bit avrs. =A0Search for &#39;AVR32&#39;.<br> </div>Thanks, I know :) But Arduino uses 8-bit.<br> <br> <br> </blockquote></div><br> --f46d0447f0ea1de95104b80e8129--
Feb 03 2012
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
--f46d044469f9442c3e04b80e84a0
Content-Type: text/plain; charset=ISO-8859-1

32bit version will be arm architecture

--f46d044469f9442c3e04b80e84a0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

32bit version will be arm architecture=A0<br><br>

--f46d044469f9442c3e04b80e84a0--
Feb 03 2012
prev sibling next sibling parent Andrea Fontana <advmail katamail.com> writes:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

In this case can we hope for a d frontend?

Il giorno ven, 03/02/2012 alle 22.33 +1000, Danni Coy ha scritto:

 32bit version will be arm architecture=20
=20

Feb 03 2012
prev sibling next sibling parent Manu <turkeyman gmail.com> writes:
--00235429d794425e1504b80fb4be
Content-Type: text/plain; charset=UTF-8

On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 **
Andrea Fontana" <advmail katamail.com> wrote:
In this case can we hope for a d frontend?

means Harvard Architecture (where Program code and RAM are physically different). Also internal RAM of a few KB and no Linux. If it'll be MCU then it can have Linux OS, so theoretically it can have GDC ported.

Eh? Why would GDC depend on linux at all? If you disable the GC (and dependent language functionality), and manage to do something about the horrible exe bloat, there's no reason it shouldn't be able to target anything... The obvious advantage over C is the syntax features. Clearly D as a *language* shouldn't DEPEND on the druntime, other than some language features that imply GC, like dynamic arrays/etc. Is the toolchain not capable of producing a working exe without linking any library? Surely you can write a totally raw app with no libs at all? (assuming you avoid language features that make implicit druntime calls) --00235429d794425e1504b80fb4be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 3 February 2012 15:37, Alex_Dovhal <span dir= =3D"ltr">&lt;<a href=3D"mailto:alex_dovhal yahoo.com">alex_dovhal yahoo.com= </a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin= :0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <u></u> <div bgcolor=3D"#ffffff"> <div>&gt;Andrea Fontana&quot; &lt;<a href=3D"mailto:advmail katamail.com" t= arget=3D"_blank">advmail katamail.com</a>&gt; wrote:</div> <div><div class=3D"im">&gt;In this case can we hope for a d frontend?<br></= div><font face=3D"Arial">That depends if it&#39;s MCU or MPU.=C2=A0If it wi= ll be MCU(like=20 ARM7TDMI), which means Harvard Architecture (where Program code and RAM are= =20 physically different). Also=C2=A0internal RAM of a few KB and=C2=A0no=20 Linux.</font></div> <div><font face=3D"Arial">If it&#39;ll be MCU then it can have Linux OS, so= =20 theoretically it can have GDC ported.</font></div></div> </blockquote></div><br><div>Eh? Why would GDC depend on linux at all? If yo= u disable the GC (and dependent language functionality), and manage to do s= omething about the horrible exe bloat, there&#39;s no reason it shouldn&#39= ;t be able to target anything...</div> <div>The obvious advantage over C is the syntax features. Clearly D as a *l= anguage* shouldn&#39;t DEPEND on the druntime, other than some language fea= tures that imply GC, like dynamic arrays/etc.</div><div><br></div><div> Is the toolchain not capable of producing a working exe without linking any= library? Surely you can write a totally raw app with no libs at all? (assu= ming you avoid language features that make implicit druntime calls)</div> --00235429d794425e1504b80fb4be--
Feb 03 2012
prev sibling next sibling parent Andrea Fontana <advmail katamail.com> writes:
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

That's my point! Arduino use c++, dmd syntax will be a really good
alternative. We just need a subset of druntime and we need to port
arduino/wiring library...

Il giorno sab, 04/02/2012 alle 00.48 +1100, Daniel Murphy ha scritto:

 It probably wouldn't be too hard (if you could get the cross compiler=20
 working) to stub out most of druntime and get it to compile.  The syntax=

 improvement would alone would make it a great alternative to c.

Feb 03 2012
prev sibling next sibling parent Danni Coy <danni.coy gmail.com> writes:
--f46d0444e7f97abc8a04b811327a
Content-Type: text/plain; charset=ISO-8859-1

One can use C without an OS on any of the Atmel microcontroller range...
why would D need an OS to support it?

On Sat, Feb 4, 2012 at 12:45 AM, Paulo Pinto <pjmlp progtools.org> wrote:

   The only language without runtime is pure assembly.

 All high level languages require a runtime library, even C, despite what
 many people think.

 Now in this case what would be nice would be the possibility to generate
 code that runs on top of the arduino without any
 real OS. This is a common use case in embedded systems and here the
 runtime has even an higher value as it takes the
 role of an OS.

 --
 Paulo

  "Manu" <turkeyman gmail.com> wrote in message
 news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...
  On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 **
Andrea Fontana" <advmail katamail.com> wrote:

That depends if it's MCU or MPU. If it will be MCU(like ARM7TDMI), which means Harvard Architecture (where Program code and RAM are physically different). Also internal RAM of a few KB and no Linux. If it'll be MCU then it can have Linux OS, so theoretically it can have GDC ported.

Eh? Why would GDC depend on linux at all? If you disable the GC (and dependent language functionality), and manage to do something about the horrible exe bloat, there's no reason it shouldn't be able to target anything... The obvious advantage over C is the syntax features. Clearly D as a *language* shouldn't DEPEND on the druntime, other than some language features that imply GC, like dynamic arrays/etc. Is the toolchain not capable of producing a working exe without linking any library? Surely you can write a totally raw app with no libs at all? (assuming you avoid language features that make implicit druntime calls)

--f46d0444e7f97abc8a04b811327a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable One can use C without an OS on any of the Atmel microcontroller range... wh= y would D need an OS to support it?=A0<br><br><div class=3D"gmail_quote">On= Sat, Feb 4, 2012 at 12:45 AM, Paulo Pinto <span dir=3D"ltr">&lt;<a href=3D= "mailto:pjmlp progtools.org">pjmlp progtools.org</a>&gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <div dir=3D"ltr"> <div dir=3D"ltr"> <div style=3D"font-size:12pt;font-family:&#39;Calibri&#39;"> <div>The only language without runtime is pure assembly.</div> <div>=A0</div> <div>All high level languages require a runtime library, even C, despite wh= at=20 many people think.</div> <div>=A0</div> <div>Now in this case what would be nice would be the possibility to genera= te=20 code that runs on top of the arduino without any</div> <div>real OS. This is a common use case in embedded systems and here the ru= ntime=20 has even an higher value as it takes the</div> <div>role of an OS.</div><span class=3D"HOEnZb"><font color=3D"#888888"> <div>=A0</div> <div>--</div> <div>Paulo</div> <div>=A0</div> <div style=3D"BORDER-BOTTOM-COLOR:#000000;BORDER-LEFT:#000000 4px solid;BOR= DER-TOP-COLOR:#000000;PADDING-LEFT:5px;BORDER-RIGHT-COLOR:#000000;MARGIN-LE= FT:5px"> <div style=3D"font-size:small;font-style:normal;text-decoration:none;font-f= amily:&#39;Calibri&#39;;display:inline;font-weight:normal"> <div>&quot;Manu&quot; &lt;<a href=3D"mailto:turkeyman gmail.com" target=3D"= _blank">turkeyman gmail.com</a>&gt; wrote in message=20 news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...</div></div=
</div>

4px solid;BORDER-TOP-COLOR:#000000;PADDING-LEFT:5px;BORDER-RIGHT-COLOR:#00= 0000;MARGIN-LEFT:5px"> <div style=3D"font-size:small;font-style:normal;text-decoration:none;font-f= amily:&#39;Calibri&#39;;display:inline;font-weight:normal"> <div class=3D"gmail_quote"><div class=3D"im">On 3 February 2012 15:37, Alex= _Dovhal <span dir=3D"ltr">&lt;<a href=3D"mailto:alex_dovhal yahoo.com" targ= et=3D"_blank">alex_dovhal yahoo.com</a>&gt;</span>=20 wrote:<br> </div><div><div class=3D"h5"><blockquote style=3D"BORDER-LEFT:#ccc 1px soli= d;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class=3D"gmail_quote"><u></u> <div bgcolor=3D"#ffffff"> <div>&gt;Andrea Fontana&quot; &lt;<a href=3D"mailto:advmail katamail.com"= target=3D"_blank">advmail katamail.com</a>&gt; wrote:</div> <div> <div>&gt;In this case can we hope for a d frontend?<br></div><font face= =3D"Arial">That depends if it&#39;s MCU or MPU. If it will be MCU(like ARM7= TDMI),=20 which means Harvard Architecture (where Program code and RAM are physical= ly=20 different). Also internal RAM of a few KB and no Linux.</font></div> <div><font face=3D"Arial">If it&#39;ll be MCU then it can have Linux OS, = so=20 theoretically it can have GDC ported.</font></div></div></blockquote></di= v></div></div> <div>=A0</div><div class=3D"im"> <div>Eh? Why would GDC depend on linux at all? If you disable the GC (and= =20 dependent language functionality), and manage to do something about the hor= rible=20 exe bloat, there&#39;s no reason it shouldn&#39;t be able to target anythin= g...</div> <div>The obvious advantage over C is the syntax features. Clearly D as a=20 *language* shouldn&#39;t DEPEND on the druntime, other than some language f= eatures=20 that imply GC, like dynamic arrays/etc.</div> <div>=A0</div> <div>Is the toolchain not capable of producing a working exe without linkin= g any=20 library? Surely you can write a totally raw app with no libs at all? (assum= ing=20 you avoid language features that make implicit druntime=20 calls)</div></div></div></div></div></div></div> </blockquote></div><br> --f46d0444e7f97abc8a04b811327a--
Feb 03 2012
prev sibling next sibling parent Manu <turkeyman gmail.com> writes:
--20cf3074b0b21b422d04b8145f6c
Content-Type: text/plain; charset=UTF-8

On 3 February 2012 16:45, Paulo Pinto <pjmlp progtools.org> wrote:

   The only language without runtime is pure assembly.

And C.. there's no requirement to link the CRT in a C app. In fact, in many of my projects, I don't. I frequently find that the ONLY function I use from the CRT is sprintf... which I really should write(/copy) my own version of, so I can never link a CRT again :P All high level languages require a runtime library, even C, despite what
 many people think.

Wrong, the C *language* depends on NOTHING in the CRT. I prefer to avoid linking it wherever possible. Strangely enough, I find the 'standard' C library to be one of the least standard libraries out there, and avoid it for that reason. Now in this case what would be nice would be the possibility to generate
 code that runs on top of the arduino without any
 real OS. This is a common use case in embedded systems and here the
 runtime has even an higher value as it takes the
 role of an OS.

All that's required is a toolchain that's capable of producing an exe without the requirement to link any compulsory library. --
 Paulo

  "Manu" <turkeyman gmail.com> wrote in message
 news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...
  On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 **
Andrea Fontana" <advmail katamail.com> wrote:

That depends if it's MCU or MPU. If it will be MCU(like ARM7TDMI), which means Harvard Architecture (where Program code and RAM are physically different). Also internal RAM of a few KB and no Linux. If it'll be MCU then it can have Linux OS, so theoretically it can have GDC ported.

Eh? Why would GDC depend on linux at all? If you disable the GC (and dependent language functionality), and manage to do something about the horrible exe bloat, there's no reason it shouldn't be able to target anything... The obvious advantage over C is the syntax features. Clearly D as a *language* shouldn't DEPEND on the druntime, other than some language features that imply GC, like dynamic arrays/etc. Is the toolchain not capable of producing a working exe without linking any library? Surely you can write a totally raw app with no libs at all? (assuming you avoid language features that make implicit druntime calls)

--20cf3074b0b21b422d04b8145f6c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 3 February 2012 16:45, Paulo Pinto <span dir= =3D"ltr">&lt;<a href=3D"mailto:pjmlp progtools.org">pjmlp progtools.org</a>= &gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0= 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div dir=3D"ltr"> <div dir=3D"ltr"> <div style=3D"font-size:12pt;font-family:&#39;Calibri&#39;"> <div>The only language without runtime is pure assembly.</div></div></div><= /div></blockquote><div><br></div><div>And C.. there&#39;s no requirement to= link the CRT in a C app. In fact, in many of my projects, I don&#39;t.</di= v> <div>I frequently find that the ONLY function I use from the CRT is sprintf= ... which I really should write(/copy) my own version of, so I can never li= nk a CRT again :P</div><div><br></div><blockquote class=3D"gmail_quote" sty= le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div dir=3D"ltr"><div dir=3D"ltr"><div style=3D"font-size:12pt;font-family:= &#39;Calibri&#39;"> <div><span style=3D"font-size:12pt">All high level languages require a runt= ime library, even C, despite what=20 many people think.</span></div></div></div></div></blockquote><div><br></di= v><div>Wrong, the C <u>language</u> depends on NOTHING in the CRT. I prefer= to avoid linking it wherever possible. Strangely enough, I find the &#39;s= tandard&#39; C library to be one of the least standard libraries out there,= and avoid it for that reason.</div> <div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex= ;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div dir=3D"= ltr"><div style=3D"font-size:12pt;font-family:&#39;Calibri&#39;"> <div><span style=3D"font-size:12pt">Now in this case what would be nice wou= ld be the possibility to generate=20 code that runs on top of the arduino without any</span></div> <div>real OS. This is a common use case in embedded systems and here the ru= ntime=20 has even an higher value as it takes the</div> <div>role of an OS.</div></div></div></div></blockquote><div><br></div><div=
All that&#39;s required is a toolchain that&#39;s capable of producing an =

<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord= er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr">= <div style=3D"font-size:12pt;font-family:&#39;Calibri&#39;"><span class=3D"= HOEnZb"><font color=3D"#888888"> <div><span style=3D"font-size:12pt">--</span></div> <div>Paulo</div> <div>=C2=A0</div> <div style=3D"BORDER-BOTTOM-COLOR:#000000;BORDER-LEFT:#000000 4px solid;BOR= DER-TOP-COLOR:#000000;PADDING-LEFT:5px;BORDER-RIGHT-COLOR:#000000;MARGIN-LE= FT:5px"> <div style=3D"font-size:small;font-style:normal;text-decoration:none;font-f= amily:&#39;Calibri&#39;;display:inline;font-weight:normal"> <div>&quot;Manu&quot; &lt;<a href=3D"mailto:turkeyman gmail.com" target=3D"= _blank">turkeyman gmail.com</a>&gt; wrote in message=20 news:mailman.312.1328277504.25230.digitalmars-d puremagic.com...</div></div=
</div>

4px solid;BORDER-TOP-COLOR:#000000;PADDING-LEFT:5px;BORDER-RIGHT-COLOR:#00= 0000;MARGIN-LEFT:5px"> <div style=3D"font-size:small;font-style:normal;text-decoration:none;font-f= amily:&#39;Calibri&#39;;display:inline;font-weight:normal"> <div class=3D"gmail_quote"><div class=3D"im">On 3 February 2012 15:37, Alex= _Dovhal <span dir=3D"ltr">&lt;<a href=3D"mailto:alex_dovhal yahoo.com" targ= et=3D"_blank">alex_dovhal yahoo.com</a>&gt;</span>=20 wrote:<br> </div><div><div class=3D"h5"><blockquote style=3D"BORDER-LEFT:#ccc 1px soli= d;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class=3D"gmail_quote"><u></u> <div bgcolor=3D"#ffffff"> <div>&gt;Andrea Fontana&quot; &lt;<a href=3D"mailto:advmail katamail.com"= target=3D"_blank">advmail katamail.com</a>&gt; wrote:</div> <div> <div>&gt;In this case can we hope for a d frontend?<br></div><font face= =3D"Arial">That depends if it&#39;s MCU or MPU. If it will be MCU(like ARM7= TDMI),=20 which means Harvard Architecture (where Program code and RAM are physical= ly=20 different). Also internal RAM of a few KB and no Linux.</font></div> <div><font face=3D"Arial">If it&#39;ll be MCU then it can have Linux OS, = so=20 theoretically it can have GDC ported.</font></div></div></blockquote></di= v></div></div> <div>=C2=A0</div><div class=3D"im"> <div>Eh? Why would GDC depend on linux at all? If you disable the GC (and= =20 dependent language functionality), and manage to do something about the hor= rible=20 exe bloat, there&#39;s no reason it shouldn&#39;t be able to target anythin= g...</div> <div>The obvious advantage over C is the syntax features. Clearly D as a=20 *language* shouldn&#39;t DEPEND on the druntime, other than some language f= eatures=20 that imply GC, like dynamic arrays/etc.</div> <div>=C2=A0</div> <div>Is the toolchain not capable of producing a working exe without linkin= g any=20 library? Surely you can write a totally raw app with no libs at all? (assum= ing=20 you avoid language features that make implicit druntime=20 calls)</div></div></div></div></div></div></div> </blockquote></div><br> --20cf3074b0b21b422d04b8145f6c--
Feb 03 2012
prev sibling next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 3 February 2012 19:32, Manu <turkeyman gmail.com> wrote:
 On 3 February 2012 16:45, Paulo Pinto <pjmlp progtools.org> wrote:
 The only language without runtime is pure assembly.

And C.. there's no requirement to link the CRT in a C app. In fact, in many of my projects, I don't. I frequently find that the ONLY function I use from the CRT is sprintf... which I really should write(/copy) my own version of, so I can never link a CRT again :P
 All high level languages require a runtime library, even C, despite what
 many people think.

Wrong, the C language depends on NOTHING in the CRT. I prefer to avoid linking it wherever possible. Strangely enough, I find the 'standard' C library to be one of the least standard libraries out there, and avoid it for that reason.

When building without -nostdlib, the compiler can make some assumptions on the fact that it is being linked to libc. I'm not sure if it is still the case, but I've seen Linux devs work around areas where gcc will implicitly put in calls to memcpy on some rather costly copy assignments. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Feb 03 2012
prev sibling parent Manu <turkeyman gmail.com> writes:
--20cf300faaf109b1ab04b82a76ba
Content-Type: text/plain; charset=UTF-8

On 4 February 2012 14:47, Paulo Pinto <pjmlp progtools.org> wrote:

 So are you writting your own crt0 startup code?

Absolutely. Most microcontroller based systems will have a custom written init routine. Are you also creating the code that takes care to validate if there
 are atexit() handlers in need to be called after main?

main will never exit on a typical microcontroller implementation. Are you writing the code that takes care to handle program arguments
 and passing them to main() or whatever is your program entry point?

Unlikely. Embedded systems/microcontrollers typically just begin executing when they receive power. You probably won't even have main, you just declare a 'void start()' function and make sure to place it at the boot address.
 Because if you aren't, then you are using C runtime library no matter what.

I've never linked a c runtime to a microcontroller app. All that said, some of the faster arduino systems are reasonably capable, and have little linux kernels. They might work fine with an adapted druntime, as long as the exe doesn't bloat, and it doesn't allocate like a hog. But D should at least be *capable* of producing a raw exe without any libs either way. It's just a compiler, there's no technical reason why it shouldn't, except a few language features that depend on intrinsic library calls which you would have to avoid. On 03.02.2012 20:32, Manu wrote:
 On 3 February 2012 16:45, Paulo Pinto <pjmlp progtools.org
 <mailto:pjmlp progtools.org>> wrote:

    The only language without runtime is pure assembly.


 And C.. there's no requirement to link the CRT in a C app. In fact, in
 many of my projects, I don't.
 I frequently find that the ONLY function I use from the CRT is
 sprintf... which I really should write(/copy) my own version of, so I
 can never link a CRT again :P

    All high level languages require a runtime library, even C, despite
    what many people think.


 Wrong, the C _language_ depends on NOTHING in the CRT. I prefer to avoid

 linking it wherever possible. Strangely enough, I find the 'standard' C
 library to be one of the least standard libraries out there, and avoid
 it for that reason.

    Now in this case what would be nice would be the possibility to
    generate code that runs on top of the arduino without any
    real OS. This is a common use case in embedded systems and here the
    runtime has even an higher value as it takes the
    role of an OS.


 All that's required is a toolchain that's capable of producing an exe
 without the requirement to link any compulsory library.

    --
    Paulo
    "Manu" <turkeyman gmail.com <mailto:turkeyman gmail.com>> wrote in

    message news:mailman.312.1328277504.**25230.digitalmars-d puremagic.**
 com...
    On 3 February 2012 15:37, Alex_Dovhal <alex_dovhal yahoo.com
    <mailto:alex_dovhal yahoo.com>**> wrote:

        __
         >Andrea Fontana" <advmail katamail.com

        <mailto:advmail katamail.com>> wrote:
         >In this case can we hope for a d frontend?
        That depends if it's MCU or MPU. If it will be MCU(like
        ARM7TDMI), which means Harvard Architecture (where Program code
        and RAM are physically different). Also internal RAM of a few KB
        and no Linux.
        If it'll be MCU then it can have Linux OS, so theoretically it
        can have GDC ported.

    Eh? Why would GDC depend on linux at all? If you disable the GC (and
    dependent language functionality), and manage to do something about
    the horrible exe bloat, there's no reason it shouldn't be able to
    target anything...
    The obvious advantage over C is the syntax features. Clearly D as a
    *language* shouldn't DEPEND on the druntime, other than some
    language features that imply GC, like dynamic arrays/etc.
    Is the toolchain not capable of producing a working exe without
    linking any library? Surely you can write a totally raw app with no
    libs at all? (assuming you avoid language features that make
    implicit druntime calls)


--20cf300faaf109b1ab04b82a76ba Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 4 February 2012 14:47, Paulo Pinto <span dir= =3D"ltr">&lt;<a href=3D"mailto:pjmlp progtools.org">pjmlp progtools.org</a>= &gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0= 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> So are you writting your own crt0 startup code?<br></blockquote><div><br></= div><div>Absolutely. Most microcontroller based systems will have a custom = written init routine.</div><div><br></div><blockquote class=3D"gmail_quote"= style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Are you also creating the code that takes care to validate if there<br> are atexit() handlers in need to be called after main?<br></blockquote><div=
<br></div><div>main will never exit on a typical microcontroller implement=

n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Are you writing the code that takes care to handle program arguments<br> and passing them to main() or whatever is your program entry point?<br></bl= ockquote><div><br></div><div>Unlikely. Embedded systems/microcontrollers ty= pically just begin executing when they receive power.</div><div>You probabl= y won&#39;t even have main, you just declare a &#39;void start()&#39; funct= ion and make sure to place it at the boot address.</div> <div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8= ex;border-left:1px #ccc solid;padding-left:1ex">Because if you aren&#39;t, = then you are using C runtime library no matter what.<br></blockquote><div><= br></div> <div>I&#39;ve never linked a c runtime to a microcontroller app.</div><div>= <br></div><div><br></div><div>All that said, some of the faster arduino sys= tems are reasonably capable, and have little linux kernels. They might work= fine with an adapted druntime, as long as the exe doesn&#39;t bloat, and i= t doesn&#39;t allocate like a hog.</div> <div>But D should at least be <i>capable</i> of producing a raw exe without= any libs either way. It&#39;s just a compiler, there&#39;s no technical re= ason why it shouldn&#39;t, except a few language features that depend on in= trinsic library calls which you would have to avoid.</div> <div>=C2=A0</div><div><br></div><blockquote class=3D"gmail_quote" style=3D"= margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class= =3D"im"> On <a href=3D"tel:03.02.2012%2020" value=3D"+61302201220" target=3D"_blank"=
03.02.2012 20</a>:32, Manu wrote:<br>

eft:1px #ccc solid;padding-left:1ex"><div class=3D"im"> On 3 February 2012 16:45, Paulo Pinto &lt;<a href=3D"mailto:pjmlp progtools= .org" target=3D"_blank">pjmlp progtools.org</a><br></div><div class=3D"im"> &lt;mailto:<a href=3D"mailto:pjmlp progtools.org" target=3D"_blank">pjmlp p= rogtools.org</a>&gt;&gt; wrote:<br> <br> =C2=A0 =C2=A0The only language without runtime is pure assembly.<br> <br> <br></div><div class=3D"im"> And C.. there&#39;s no requirement to link the CRT in a C app. In fact, in<= br> many of my projects, I don&#39;t.<br> I frequently find that the ONLY function I use from the CRT is<br> sprintf... which I really should write(/copy) my own version of, so I<br> can never link a CRT again :P<br> <br></div><div class=3D"im"> =C2=A0 =C2=A0All high level languages require a runtime library, even C, d= espite<br> =C2=A0 =C2=A0what many people think.<br> <br> <br></div> Wrong, the C _language_ depends on NOTHING in the CRT. I prefer to avoid<di= v class=3D"im"><br> linking it wherever possible. Strangely enough, I find the &#39;standard&#3= 9; C<br> library to be one of the least standard libraries out there, and avoid<br> it for that reason.<br> <br></div><div class=3D"im"> =C2=A0 =C2=A0Now in this case what would be nice would be the possibility = to<br> =C2=A0 =C2=A0generate code that runs on top of the arduino without any<br> =C2=A0 =C2=A0real OS. This is a common use case in embedded systems and he= re the<br> =C2=A0 =C2=A0runtime has even an higher value as it takes the<br> =C2=A0 =C2=A0role of an OS.<br> <br> <br></div><div class=3D"im"> All that&#39;s required is a toolchain that&#39;s capable of producing an e= xe<br> without the requirement to link any compulsory library.<br> <br></div> =C2=A0 =C2=A0--<br> =C2=A0 =C2=A0Paulo<br> =C2=A0 =C2=A0&quot;Manu&quot; &lt;<a href=3D"mailto:turkeyman gmail.com" t= arget=3D"_blank">turkeyman gmail.com</a> &lt;mailto:<a href=3D"mailto:turke= yman gmail.com" target=3D"_blank">turkeyman gmail.com</a>&gt;&gt; wrote in<= div class=3D"im"> <br> =C2=A0 =C2=A0message news:mailman.312.1328277504.<u></u>25230.digitalmars-= d puremagic.<u></u>com...<br> =C2=A0 =C2=A0On 3 February 2012 15:37, Alex_Dovhal &lt;<a href=3D"mailto:a= lex_dovhal yahoo.com" target=3D"_blank">alex_dovhal yahoo.com</a><br></div> =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:alex_dovhal yahoo.com" target=3D= "_blank">alex_dovhal yahoo.com</a>&gt;<u></u>&gt; wrote:<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0__<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;Andrea Fontana&quot; &lt;<a href=3D"mailto= :advmail katamail.com" target=3D"_blank">advmail katamail.com</a><div class= =3D"im"><br> =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:advmail katamail.c= om" target=3D"_blank">advmail katamail.com</a>&gt;&gt; wrote:<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;In this case can we hope for a d frontend?= <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0That depends if it&#39;s MCU or MPU. If it will= be MCU(like<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0ARM7TDMI), which means Harvard Architecture (wh= ere Program code<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0and RAM are physically different). Also interna= l RAM of a few KB<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0and no Linux.<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0If it&#39;ll be MCU then it can have Linux OS, = so theoretically it<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0can have GDC ported.<br> <br> =C2=A0 =C2=A0Eh? Why would GDC depend on linux at all? If you disable the = GC (and<br> =C2=A0 =C2=A0dependent language functionality), and manage to do something= about<br> =C2=A0 =C2=A0the horrible exe bloat, there&#39;s no reason it shouldn&#39;= t be able to<br> =C2=A0 =C2=A0target anything...<br> =C2=A0 =C2=A0The obvious advantage over C is the syntax features. Clearly = D as a<br> =C2=A0 =C2=A0*language* shouldn&#39;t DEPEND on the druntime, other than s= ome<br> =C2=A0 =C2=A0language features that imply GC, like dynamic arrays/etc.<br> =C2=A0 =C2=A0Is the toolchain not capable of producing a working exe witho= ut<br> =C2=A0 =C2=A0linking any library? Surely you can write a totally raw app w= ith no<br> =C2=A0 =C2=A0libs at all? (assuming you avoid language features that make<= br> =C2=A0 =C2=A0implicit druntime calls)<br> <br> <br> </div></blockquote> <br> </blockquote></div><br> --20cf300faaf109b1ab04b82a76ba--
Feb 04 2012
prev sibling next sibling parent reply Manu <turkeyman gmail.com> writes:
--0023544717e41f964504b80dd282
Content-Type: text/plain; charset=UTF-8

On 3 February 2012 13:34, Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 **
 "Andrea Fontana" <advmail katamail.com> wrote:
Is it possible to compile for avr (atmel) platform using gdc? It would be

AVR is 8-bit harward architecture while D is designed for at least 32 bits. Besides that AVR's have from (less then 1) to (a few) kB of RAM so it needs another standard library with no GC. Guess that's a lot of work, so don't expect it any time soon even if someone will try to implement it.

I think you'll find that most arduino projects are using a much more capable avr chip, probably avr32 chips. I wouldn't expect D will ever work well on 16bit microcontrollers, but on 32bit avr's I can't see any reason from my (limited) experience why the toolchain wouldn't just build and work out of the box (at least under linux). You'll basically need to write the runtime yourself. If you avoid the GC and OS stuff, you can basically stub out phobos, and you might be able to run raw code quite easily... --0023544717e41f964504b80dd282 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 3 February 2012 13:34, Alex_Dovhal <span dir= =3D"ltr">&lt;<a href=3D"mailto:alex_dovhal yahoo.com">alex_dovhal yahoo.com= </a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin= :0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <u></u> <div bgcolor=3D"#ffffff"><div class=3D"im"> <div>&quot;Andrea Fontana&quot; &lt;<a href=3D"mailto:advmail katamail.com"= target=3D"_blank">advmail katamail.com</a>&gt; wrote:</div> <div>&gt;Is it possible to compile for avr (atmel) platform using gdc? It w= ould=20 be interesting for arduino development... </div> <div><font face=3D"Arial"></font>=C2=A0</div> </div><div>AVR is 8-bit harward architecture while D is designed for at lea= st 32 bits.=20 Besides that AVR&#39;s have from (less then 1) to (a few) kB of RAM so it n= eeds=20 another standard library with no GC. Guess that&#39;s a lot of work, so don= &#39;t expect=20 it any time soon even if someone will try to implement it.</div></div> </blockquote></div><br><div>I think you&#39;ll find that most arduino proje= cts are using a much more capable avr chip, probably avr32 chips.</div><div=
I wouldn&#39;t expect D will ever work well on 16bit microcontrollers, but=

why the toolchain wouldn&#39;t just build and work out of the box (at leas= t under linux).</div> <div>You&#39;ll basically need to write the runtime yourself. If you avoid = the GC and OS stuff, you can basically stub out phobos, and you might be ab= le to run raw code quite easily...</div> --0023544717e41f964504b80dd282--
Feb 03 2012
next sibling parent "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Manu" <turkeyman gmail.com> wrote:
I think you'll find that most arduino projects are using a much more 
capable avr chip, probably avr32 chips.

devices http://en.wikipedia.org/wiki/Arduino . Here also http://arduino.cc/en/Main/Hardware - all PCB contain 8-bit devices.
Feb 03 2012
prev sibling parent "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Manu" <turkeyman gmail.com> wrote:
I think you'll find that most arduino projects are using a much more 
capable avr chip, probably avr32 chips.

http://en.wikipedia.org/wiki/Arduino Here http://arduino.cc/en/Main/Hardware also all AVR's are 8-bit
Feb 03 2012
prev sibling next sibling parent Iain Buclaw <ibuclaw ubuntu.com> writes:
On 3 February 2012 08:47, Andrea Fontana <advmail katamail.com> wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It would be
 interesting for arduino development...

gdc actually asserts that the target it is building for is either 32bit or 64bit, anything greater or less than will fail to compile anything with a solid ICE. For Arduino, it was my understanding that development uses neither C or C++ - something more of an abstract C-like language, unless I'm thinking of NViDIA CUDA... -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Feb 03 2012
prev sibling next sibling parent "Martin Nowak" <dawg dawgfoto.de> writes:
On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw <ibuclaw ubuntu.com> wrote:

 On 3 February 2012 08:47, Andrea Fontana <advmail katamail.com> wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It would  
 be
 interesting for arduino development...


 gdc actually asserts that the target it is building for is either
 32bit or 64bit, anything greater or less than will fail to compile
 anything with a solid ICE.

 For Arduino, it was my understanding that development uses neither C
 or C++ -  something more of an abstract C-like language, unless I'm
 thinking of NViDIA CUDA...

Feb 03 2012
prev sibling next sibling parent Manu <turkeyman gmail.com> writes:
--20cf3074b0b2b52bfb04b817077b
Content-Type: text/plain; charset=UTF-8

On 3 February 2012 23:15, Martin Nowak <dawg dawgfoto.de> wrote:

 On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw <ibuclaw ubuntu.com>
 wrote:

  On 3 February 2012 08:47, Andrea Fontana <advmail katamail.com> wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It would be
 interesting for arduino development...



Why? It just compiles code. Why should it require dependence on anything? --20cf3074b0b2b52bfb04b817077b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 3 February 2012 23:15, Martin Nowak <span dir= =3D"ltr">&lt;<a href=3D"mailto:dawg dawgfoto.de">dawg dawgfoto.de</a>&gt;</= span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e= x;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"im">On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw &lt;<a hr= ef=3D"mailto:ibuclaw ubuntu.com" target=3D"_blank">ibuclaw ubuntu.com</a>&g= t; wrote:<br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On 3 February 2012 08:47, Andrea Fontana &lt;<a href=3D"mailto:advmail kata= mail.com" target=3D"_blank">advmail katamail.com</a>&gt; wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Is it possible to compile for avr (atmel) platform using gdc? It would be<b= r> interesting for arduino development...<br> </blockquote></blockquote></div> It&#39;s unlikely that D will run on systems without a MMU.</blockquote><di= v><br></div><div>Why?</div><div>It just compiles code. Why should it requir= e dependence on anything?</div></div> --20cf3074b0b2b52bfb04b817077b--
Feb 03 2012
prev sibling next sibling parent Johannes Pfau <nospam example.com> writes:
Am Fri, 3 Feb 2012 21:32:21 +0200
schrieb Manu <turkeyman gmail.com>:

 
 All that's required is a toolchain that's capable of producing an exe
 without the requirement to link any compulsory library.

I'm not sure, but I think the D compilers currently depend on druntime. AFAIK you'll need at very least a object.di with certain stuff and I'm not sure if array ops / gc functions are required if you don't use them. Shouldn't be too much work to change that though.
Feb 04 2012
prev sibling next sibling parent reply "Martin Nowak" <dawg dawgfoto.de> writes:
On Fri, 03 Feb 2012 23:42:39 +0100, Manu <turkeyman gmail.com> wrote:

 On 3 February 2012 23:15, Martin Nowak <dawg dawgfoto.de> wrote:

 On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw <ibuclaw ubuntu.com>
 wrote:

  On 3 February 2012 08:47, Andrea Fontana <advmail katamail.com> wrote:
 Is it possible to compile for avr (atmel) platform using gdc? It  
 would be
 interesting for arduino development...



Why? It just compiles code. Why should it require dependence on anything?

Arrays, AA, string switch, array ops, boundary checks, closures, exception handling, class factory, module constructors, unittests, RTTI. Just to name some deeply integrated features that require runtime support and or heap allocation. Some of them even rely on GC in their current implementation. Obviously you can compile and link a simple "double add(double a, double b) { return a + b; }" without using the runtime. What's that thing about not using the C runtime? Don't you use malloc, atexit, str*?
Feb 04 2012
parent "Nick Sabalausky" <a a.a> writes:
"Martin Nowak" <dawg dawgfoto.de> wrote in message 
news:mailman.9.1328397449.20196.digitalmars-d puremagic.com...
 What's that thing about not using the C runtime? Don't you use malloc, 
 atexit, str*?

That sort of stuff isn't always appropriate on an embedded system.
Feb 04 2012
prev sibling next sibling parent Manu <turkeyman gmail.com> writes:
--0023544717e48fbd4204b82cb1ff
Content-Type: text/plain; charset=UTF-8

On 5 February 2012 01:17, Martin Nowak <dawg dawgfoto.de> wrote:

 On Fri, 03 Feb 2012 23:42:39 +0100, Manu <turkeyman gmail.com> wrote:

  On 3 February 2012 23:15, Martin Nowak <dawg dawgfoto.de> wrote:
  On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw <ibuclaw ubuntu.com>
 wrote:

  On 3 February 2012 08:47, Andrea Fontana <advmail katamail.com> wrote:

  Is it possible to compile for avr (atmel) platform using gdc? It would
 be
 interesting for arduino development...

  It's unlikely that D will run on systems without a MMU.



Why? It just compiles code. Why should it require dependence on anything?

Arrays, AA, string switch, array ops, boundary checks, closures, exception handling, class factory, module constructors, unittests, RTTI. Just to name some deeply integrated features that require runtime support and or heap allocation. Some of them even rely on GC in their current implementation. Obviously you can compile and link a simple "double add(double a, double b) { return a + b; }" without using the runtime. What's that thing about not using the C runtime? Don't you use malloc, atexit, str*?

God no. You just case the appropriate address to some sort of pointer and manage it however you like. str*? you mean char*.. Of course you use that, that's a buffer :P --0023544717e48fbd4204b82cb1ff Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On 5 February 2012 01:17, Martin Nowak <span dir= =3D"ltr">&lt;<a href=3D"mailto:dawg dawgfoto.de">dawg dawgfoto.de</a>&gt;</= span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8e= x;border-left:1px #ccc solid;padding-left:1ex"> <div class=3D"HOEnZb"><div class=3D"h5">On Fri, 03 Feb 2012 23:42:39 +0100,= Manu &lt;<a href=3D"mailto:turkeyman gmail.com" target=3D"_blank">turkeyma= n gmail.com</a>&gt; wrote:<br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On 3 February 2012 23:15, Martin Nowak &lt;<a href=3D"mailto:dawg dawgfoto.= de" target=3D"_blank">dawg dawgfoto.de</a>&gt; wrote:<br> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> On Fri, 03 Feb 2012 17:13:04 +0100, Iain Buclaw &lt;<a href=3D"mailto:ibucl= aw ubuntu.com" target=3D"_blank">ibuclaw ubuntu.com</a>&gt;<br> wrote:<br> <br> =C2=A0On 3 February 2012 08:47, Andrea Fontana &lt;<a href=3D"mailto:advmai= l katamail.com" target=3D"_blank">advmail katamail.com</a>&gt; wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Is it possible to compile for avr (atmel) platform using gdc? It would be<b= r> interesting for arduino development...<br> <br> </blockquote> It&#39;s unlikely that D will run on systems without a MMU.<br> </blockquote></blockquote> <br> <br> Why?<br> It just compiles code. Why should it require dependence on anything?<br> </blockquote> <br></div></div> Arrays, AA, string switch, array ops, boundary checks, closures, exception = handling, class factory, module constructors, unittests, RTTI.<br> Just to name some deeply integrated features that require runtime support a= nd or heap allocation. Some of them even rely on GC in their current implem= entation.<br> <br> Obviously you can compile and link a simple &quot;double add(double a, doub= le b) { return a + b; }&quot; without using the runtime.<br> <br> What&#39;s that thing about not using the C runtime? Don&#39;t you use mall= oc, atexit, str*?<br> </blockquote></div><br><div>God no. You just case the appropriate address t= o some sort of pointer and manage it however you like.</div><div>str*? you = mean char*.. Of course you use that, that&#39;s a buffer :P</div> --0023544717e48fbd4204b82cb1ff--
Feb 04 2012
prev sibling parent "Martin Nowak" <dawg dawgfoto.de> writes:
 God no. You just case the appropriate address to some sort of pointer and
 manage it however you like.
 str*? you mean char*.. Of course you use that, that's a buffer :P

The bottom line is you can't avoid the CRT/C++RT when you use certain language constructs, same goes for D. Because D incorporates higher level constructs it might be more difficult than in C to actually do this.
Feb 04 2012