www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D on other platforms than Win,Lin,Mac?

reply lurker57 <no.email example.com> writes:
Hi!

I've heard that our company is considering the T20 from Toradex.com for a new
project with remote hardware. The platform runs on Nvidia Tegra and Linux.

Since I have been very impressed by the D programming language, for some years
now, could it be possible to use D in such projects?
Sep 06 2011
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2011-09-06 16:21, lurker57 wrote:
 Hi!

 I've heard that our company is considering the T20 from Toradex.com for a new
project with remote hardware. The platform runs on Nvidia Tegra and Linux.

 Since I have been very impressed by the D programming language, for some years
now, could it be possible to use D in such projects?

DMD currently only supports X86 and X86-64 platforms. I don't know about ldc or gdc (the DMD front end on the LLVM and GCC backend). The backends support ARM but the runtime needs to support ARM as well. -- /Jacob Carlborg
Sep 06 2011
prev sibling next sibling parent reply Trass3r <un known.com> writes:
 I've heard that our company is considering the T20 from Toradex.com for  
 a new project with remote hardware. The platform runs on Nvidia Tegra  
 and Linux.

 Since I have been very impressed by the D programming language, for some  
 years now, could it be possible to use D in such projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky. I think the GC is problematic, thus you also have to avoid most of phobos.
Sep 06 2011
next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Trass3r" <un known.com> wrote in message news:op.v1edf3bj3ncmek enigma...
 I've heard that our company is considering the T20 from Toradex.com for 
 a new project with remote hardware. The platform runs on Nvidia Tegra 
 and Linux.

 Since I have been very impressed by the D programming language, for some 
 years now, could it be possible to use D in such projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky. I think the GC is problematic, thus you also have to avoid most of phobos.

For a language that aims at C/C++'s domain, it's extremely depressing that this is still the case. I *really* think this needs to be one of D's top priorities at this point. I honestly see it as D's #1 biggest glaring hole ATM (Honestly, I've always cared about embedded/non-x86 processors *far* more than the native 64-bit support that got enormous attention awhile back). 'Course I'm kinda just blowing smoke out my ass since I unfortunately have neither the time nor ability to help tackle this goal :(
Sep 06 2011
parent bearophile <bearophileHUGS lycos.com> writes:
Nick Sabalausky:

 I *really* think this needs to be one of D's top 
 priorities at this point.

In my opinion at the moment one of the highest priorities of D (maybe _the_ top one) is to find a ways to improve and speed up the process of reviewing, fixing and applying pull requests for DMD/Phobos. Bye, bearophile
Sep 06 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
 For a language that aims at C/C++'s domain, it's extremely depressing  
 that this is still the case. I *really* think this needs to be one of  
 D's top
 priorities at this point. I honestly see it as D's #1 biggest glaring  
 hole

We have much bigger problems that need attention. And there's nothing preventing the few people demanding ARM support from patching druntime etc. and creating a pull request to add it. The thing is that simply nobody wants to do the dirty base work.
Sep 06 2011
prev sibling next sibling parent Trass3r <un known.com> writes:
 At least for gdc only hello-world like code works. Real code hits this
 issue:
 https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm

Did you ever try with LDC?
Sep 06 2011
prev sibling next sibling parent Andrew Wiley <wiley.andrew.j gmail.com> writes:
--20cf303f69d4729bd504ac4d85fd
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau <spam example.com> wrote:

 Trass3r wrote:
 I've heard that our company is considering the T20 from Toradex.com
 for a new project with remote hardware. The platform runs on Nvidia
 Tegra and Linux.

 Since I have been very impressed by the D programming language, for
 some years now, could it be possible to use D in such projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky.

At least for gdc only hello-world like code works. Real code hits this issue: https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm This also applies to all platforms which aren't supported by dmd.
 I think the GC is problematic, thus you also have to avoid
most of phobos.

The GC seems to work if druntime is compiled with -fno-section-anchors , but no real testing was done. https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-arm might also be caused by bug 215.

If you're looking at an ARMv7 platform (my Tegra is ARMv7, dunno if they all are), I believe you can set the Linux kernel to handle faults caused by unaligned memory accesses, which *should* make D run with a performance hit until this bug gets fixed. Keep in mind that the library situation is largely untested, although Iain seems to have quietly done a lot of work in Druntime at some point to make it all build. Once I've got my Tegra up and running (need a serial cable - it's in the mail), I'll be able to say more. --20cf303f69d4729bd504ac4d85fd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau <s= pan dir=3D"ltr">&lt;<a href=3D"mailto:spam example.com">spam example.com</a=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =

<div class=3D"im">Trass3r wrote:<br> &gt;&gt; I&#39;ve heard that our company is considering the T20 from Torade= x.com<br> &gt;&gt; for a new project with remote hardware. The platform runs on Nvidi= a<br> &gt;&gt; Tegra and Linux.<br> &gt;&gt;<br> &gt;&gt; Since I have been very impressed by the D programming language, fo= r<br> &gt;&gt; some years now, could it be possible to use D in such projects?<br=

&gt;You&#39;d have to use gdc or ldc and patch at least druntime.<br> &gt;Some people already managed to get stuff running on ARM but it&#39;s<br=

<br> </div>At least for gdc only hello-world like code works. Real code hits thi= s<br> issue:<br> <a href=3D"https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-= members-wrong-on-arm" target=3D"_blank">https://bitbucket.org/goshawk/gdc/i= ssue/215/alignment-of-struct-members-wrong-on-arm</a><br> <br> This also applies to all platforms which aren&#39;t supported by dmd.<br> <div class=3D"im"><br> &gt; I think the GC is problematic, thus you also have to avoid<br> &gt;most of phobos.<br> <br> </div>The GC seems to work if druntime is compiled with<br> -fno-section-anchors , but no real testing was done.<br> <a href=3D"https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-bro= ken-on-arm" target=3D"_blank">https://bitbucket.org/goshawk/gdc/issue/120/f= section-anchors-broken-on-arm</a><br> might also be caused by bug 215.<br> <font color=3D"#888888"><br></font></blockquote><div><br></div><div>+1</div=
<div><br></div><div>If you&#39;re looking at an ARMv7 platform (my Tegra i=

handle faults caused by unaligned memory accesses, which *should* make D ru= n with a performance hit until this bug gets fixed. Keep in mind that the l= ibrary situation is largely untested, although Iain seems to have quietly d= one a lot of work in Druntime at some point to make it all build. Once I&#3= 9;ve got my Tegra up and running (need a serial cable - it&#39;s in the mai= l), I&#39;ll be able to say more.</div> </div><br> --20cf303f69d4729bd504ac4d85fd--
Sep 06 2011
prev sibling next sibling parent Andrew Wiley <wiley.andrew.j gmail.com> writes:
--00151773db9839b8da04ac4db3a3
Content-Type: text/plain; charset=ISO-8859-1

On Tue, Sep 6, 2011 at 1:51 PM, Nick Sabalausky <a a.a> wrote:

 "Trass3r" <un known.com> wrote in message news:op.v1edf3bj3ncmek enigma...
 I've heard that our company is considering the T20 from Toradex.com for
 a new project with remote hardware. The platform runs on Nvidia Tegra
 and Linux.

 Since I have been very impressed by the D programming language, for some
 years now, could it be possible to use D in such projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky. I think the GC is problematic, thus you also have to avoid most of

For a language that aims at C/C++'s domain, it's extremely depressing that this is still the case. I *really* think this needs to be one of D's top priorities at this point. I honestly see it as D's #1 biggest glaring hole ATM (Honestly, I've always cared about embedded/non-x86 processors *far* more than the native 64-bit support that got enormous attention awhile back). 'Course I'm kinda just blowing smoke out my ass since I unfortunately have neither the time nor ability to help tackle this goal :(

backend that isn't Digital Mars, and there's far fewer people working on other backends. This is why I asked whether anything had happened with GCC inclusion a while back. If that could happen, D would get a large leap forward in this area. I agree that a systems language that only works on x86/x86_64 is a depressing concept, and I think it's about to become unacceptable in the next few years. --00151773db9839b8da04ac4db3a3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Tue, Sep 6, 2011 at 1:51 PM, Nick Sabalausky = <span dir=3D"ltr">&lt;a a.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;"> &quot;Trass3r&quot; &lt;<a href=3D"mailto:un known.com">un known.com</a>&gt= ; wrote in message news:op.v1edf3bj3ncmek enigma...<br> <div><div></div><div class=3D"h5">&gt;&gt; I&#39;ve heard that our company = is considering the T20 from Toradex.com for<br> &gt;&gt; a new project with remote hardware. The platform runs on Nvidia Te= gra<br> &gt;&gt; and Linux.<br> &gt;&gt;<br> &gt;&gt; Since I have been very impressed by the D programming language, fo= r some<br> &gt;&gt; years now, could it be possible to use D in such projects?<br> &gt;<br> &gt; You&#39;d have to use gdc or ldc and patch at least druntime.<br> &gt; Some people already managed to get stuff running on ARM but it&#39;s t= ricky.<br> &gt; I think the GC is problematic, thus you also have to avoid most of pho= bos.<br> <br> </div></div>For a language that aims at C/C++&#39;s domain, it&#39;s extrem= ely depressing that<br> this is still the case. I *really* think this needs to be one of D&#39;s to= p<br> priorities at this point. I honestly see it as D&#39;s #1 biggest glaring h= ole<br> ATM (Honestly, I&#39;ve always cared about embedded/non-x86 processors *far= *<br> more than the native 64-bit support that got enormous attention awhile<br> back). &#39;Course I&#39;m kinda just blowing smoke out my ass since I unfo= rtunately<br> have neither the time nor ability to help tackle this goal :(<br> <br></blockquote><div><br></div><div>The problem is that the most direct wa= y to do this is to use a compiler backend that isn&#39;t Digital Mars, and = there&#39;s far fewer people working on other backends. This is why I asked= whether anything had happened with GCC inclusion a while back. If that cou= ld happen, D would get a large leap forward in this area.</div> <div><br></div><div>I agree that a systems language that only works on x86/= x86_64 is a depressing concept, and I think it&#39;s about to become unacce= ptable in the next few years.</div></div> --00151773db9839b8da04ac4db3a3--
Sep 06 2011
prev sibling parent Andrew Wiley <wiley.andrew.j gmail.com> writes:
--00151774187a54cec704ac5b7600
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Sep 7, 2011 at 2:46 AM, Johannes Pfau <spam example.com> wrote:

 Andrew Wiley wrote:
On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau <spam example.com> wrote:

 Trass3r wrote:
 I've heard that our company is considering the T20 from
 Toradex.com for a new project with remote hardware. The platform
 runs on Nvidia Tegra and Linux.

 Since I have been very impressed by the D programming language,
 for some years now, could it be possible to use D in such
 projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky.

At least for gdc only hello-world like code works. Real code hits this issue:


 This also applies to all platforms which aren't supported by dmd.

 I think the GC is problematic, thus you also have to avoid
most of phobos.

The GC seems to work if druntime is compiled with -fno-section-anchors , but no real testing was done.


 might also be caused by bug 215.

If you're looking at an ARMv7 platform (my Tegra is ARMv7, dunno if they all are), I believe you can set the Linux kernel to handle faults caused by unaligned memory accesses, which *should* make D run with a performance hit until this bug gets fixed. Keep in mind that the library situation is largely untested, although Iain seems to have quietly done a lot of work in Druntime at some point to make it all build. Once I've got my Tegra up and running (need a serial cable - it's in the mail), I'll be able to say more.

(OMAP4 / Dual Core Cortex A9 / ARM7). But the SD Card I ordered is broken, I'm waiting for a replacement now. Anyway: Are you referring to this? http://www.mjmwired.net/kernel/Documentation/arm/mem_alignment

problems from crashing the program otherwise. Also, my experience with LDC was that it doesn't have the Druntime patches it needs, but I seem to recall adding enough to get it building, then watching LDC segfault. I think they're already fixing the alignments (though I'm not familiar enough with their source to be certain that's what I was seeing), but there seems to be some other issue. --00151774187a54cec704ac5b7600 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Wed, Sep 7, 2011 at 2:46 AM, Johannes Pfau <s= pan dir=3D"ltr">&lt;<a href=3D"mailto:spam example.com">spam example.com</a=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =

<div class=3D"im">Andrew Wiley wrote:<br> &gt;On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau &lt;<a href=3D"mailto:spa= m example.com">spam example.com</a>&gt; wrote:<br> &gt;<br> </div><div><div></div><div class=3D"h5">&gt;&gt; Trass3r wrote:<br> &gt;&gt; &gt;&gt; I&#39;ve heard that our company is considering the T20 fr= om<br> &gt;&gt; &gt;&gt; Toradex.com for a new project with remote hardware. The p= latform<br> &gt;&gt; &gt;&gt; runs on Nvidia Tegra and Linux.<br> &gt;&gt; &gt;&gt;<br> &gt;&gt; &gt;&gt; Since I have been very impressed by the D programming lan= guage,<br> &gt;&gt; &gt;&gt; for some years now, could it be possible to use D in such= <br> &gt;&gt; &gt;&gt; projects?<br> &gt;&gt; &gt;<br> &gt;&gt; &gt;You&#39;d have to use gdc or ldc and patch at least druntime.<= br> &gt;&gt; &gt;Some people already managed to get stuff running on ARM but it= &#39;s<br> &gt;&gt; &gt;tricky.<br> &gt;&gt;<br> &gt;&gt; At least for gdc only hello-world like code works. Real code hits<= br> &gt;&gt; this issue:<br> &gt;&gt;<br> &gt;&gt; <a href=3D"https://bitbucket.org/goshawk/gdc/issue/215/alignment-o= f-struct-members-wrong-on-arm" target=3D"_blank">https://bitbucket.org/gosh= awk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm</a><br> &gt;&gt;<br> &gt;&gt; This also applies to all platforms which aren&#39;t supported by d= md.<br> &gt;&gt;<br> &gt;&gt; &gt; I think the GC is problematic, thus you also have to avoid<br=

&gt;&gt;<br> &gt;&gt; The GC seems to work if druntime is compiled with<br> &gt;&gt; -fno-section-anchors , but no real testing was done.<br> &gt;&gt; <a href=3D"https://bitbucket.org/goshawk/gdc/issue/120/fsection-an= chors-broken-on-arm" target=3D"_blank">https://bitbucket.org/goshawk/gdc/is= sue/120/fsection-anchors-broken-on-arm</a><br> &gt;&gt; might also be caused by bug 215.<br> &gt;&gt;<br> &gt;&gt;<br> </div></div><div class=3D"im">&gt;+1<br> &gt;<br> &gt;If you&#39;re looking at an ARMv7 platform (my Tegra is ARMv7, dunno if= <br> &gt;they all are), I believe you can set the Linux kernel to handle faults<= br> &gt;caused by unaligned memory accesses, which *should* make D run with a<b= r> &gt;performance hit until this bug gets fixed. Keep in mind that the<br> &gt;library situation is largely untested, although Iain seems to have<br> &gt;quietly done a lot of work in Druntime at some point to make it all<br> &gt;build. Once I&#39;ve got my Tegra up and running (need a serial cable -= <br> &gt;it&#39;s in the mail), I&#39;ll be able to say more.<br> &gt;<br> </div>I only had a cheap ARM5TE till now, but yesterday my PandaBoard arriv= ed<br> (OMAP4 / Dual Core Cortex A9 / ARM7). But the SD Card I ordered is<br> broken, I&#39;m waiting for a replacement now.<br> <br> Anyway: Are you referring to this?<br> <a href=3D"http://www.mjmwired.net/kernel/Documentation/arm/mem_alignment" = target=3D"_blank">http://www.mjmwired.net/kernel/Documentation/arm/mem_alig= nment</a><br> <font color=3D"#888888"><br></font></blockquote><div><br></div><div>Yes. Th= at won&#39;t make our OS structs match up, but it should keep alignment pro= blems from crashing the program otherwise.</div><div><br></div><div>Also, m= y experience with LDC was that it doesn&#39;t have the Druntime patches it = needs, but I seem to recall adding enough to get it building, then watching= LDC segfault. I think they&#39;re already fixing the alignments (though I&= #39;m not familiar enough with their source to be certain that&#39;s what I= was seeing), but there seems to be some other issue.</div> </div><br> --00151774187a54cec704ac5b7600--
Sep 07 2011
prev sibling next sibling parent Johannes Pfau <spam example.com> writes:
Trass3r wrote:
 I've heard that our company is considering the T20 from Toradex.com
 for a new project with remote hardware. The platform runs on Nvidia
 Tegra and Linux.

 Since I have been very impressed by the D programming language, for
 some years now, could it be possible to use D in such projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky.

At least for gdc only hello-world like code works. Real code hits this issue: https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm This also applies to all platforms which aren't supported by dmd.
 I think the GC is problematic, thus you also have to avoid
most of phobos.

The GC seems to work if druntime is compiled with -fno-section-anchors , but no real testing was done. https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-arm might also be caused by bug 215. -- Johannes Pfau
Sep 06 2011
prev sibling next sibling parent Johannes Pfau <spam example.com> writes:
Trass3r wrote:
 At least for gdc only hello-world like code works. Real code hits
 this issue:
 https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm

Did you ever try with LDC?

Not yet, but I'll try it as soon as possible. -- Johannes Pfau
Sep 07 2011
prev sibling parent Johannes Pfau <spam example.com> writes:
Andrew Wiley wrote:
On Tue, Sep 6, 2011 at 2:25 PM, Johannes Pfau <spam example.com> wrote:

 Trass3r wrote:
 I've heard that our company is considering the T20 from
 Toradex.com for a new project with remote hardware. The platform
 runs on Nvidia Tegra and Linux.

 Since I have been very impressed by the D programming language,
 for some years now, could it be possible to use D in such
 projects?

You'd have to use gdc or ldc and patch at least druntime. Some people already managed to get stuff running on ARM but it's tricky.

At least for gdc only hello-world like code works. Real code hits this issue: https://bitbucket.org/goshawk/gdc/issue/215/alignment-of-struct-members-wrong-on-arm This also applies to all platforms which aren't supported by dmd.
 I think the GC is problematic, thus you also have to avoid
most of phobos.

The GC seems to work if druntime is compiled with -fno-section-anchors , but no real testing was done. https://bitbucket.org/goshawk/gdc/issue/120/fsection-anchors-broken-on-arm might also be caused by bug 215.

If you're looking at an ARMv7 platform (my Tegra is ARMv7, dunno if they all are), I believe you can set the Linux kernel to handle faults caused by unaligned memory accesses, which *should* make D run with a performance hit until this bug gets fixed. Keep in mind that the library situation is largely untested, although Iain seems to have quietly done a lot of work in Druntime at some point to make it all build. Once I've got my Tegra up and running (need a serial cable - it's in the mail), I'll be able to say more.

(OMAP4 / Dual Core Cortex A9 / ARM7). But the SD Card I ordered is broken, I'm waiting for a replacement now. Anyway: Are you referring to this? http://www.mjmwired.net/kernel/Documentation/arm/mem_alignment -- Johannes Pfau
Sep 07 2011