June 06, 2021
On Friday, 4 June 2021 at 21:47:21 UTC, Iain Buclaw wrote:

>
> You should have better luck using gdc on avr.
>
> https://explore.dgnu.org/z/bos5ee

Trying that, thank you. For now, two issues with GDC 11, which I hope to work around: 1) compiler complains about typeinfos of structs used in CTFE only, 2) 'align' is mishandled
June 06, 2021
On Sunday, 6 June 2021 at 18:57:06 UTC, Max Samukha wrote:

> 2) 'align' is mishandled

GCC's bugzilla won't let me register.

align(4)
struct S {
    ubyte[4] bytes;
}

static assert (S.alignof == 4); // fail, S.alignof == 1

It's not specific to AVR. Worked around by placing 'align' inside the struct.

June 06, 2021
On Sunday, 6 June 2021 at 20:11:04 UTC, Max Samukha wrote:
> On Sunday, 6 June 2021 at 18:57:06 UTC, Max Samukha wrote:
>
>> 2) 'align' is mishandled
>
> GCC's bugzilla won't let me register.
>

You'd have to use a non-gmail account IIRC, not sure if there's any others that are in the "typically spam" blacklist.

> align(4)
> struct S {
>     ubyte[4] bytes;
> }
>
> static assert (S.alignof == 4); // fail, S.alignof == 1
>
> It's not specific to AVR. Worked around by placing 'align' inside the struct.

That sounds a lot like this issue: https://issues.dlang.org/show_bug.cgi?id=17857

Can backport that for GCC-11.
June 06, 2021
On Friday, 4 June 2021 at 21:47:21 UTC, Iain Buclaw wrote:
> On Friday, 4 June 2021 at 21:28:00 UTC, Max Samukha wrote:
>>
>> This doesn't [work]:
>>
>> ubyte[] slice;
>> foreach (ubyte i; slice) {
>> }
>>
>> Invalid bitcast
>>   %17 = bitcast i16 %15 to i32
>>
>> I guess the cause is the same - slice.length.sizeof == 4, while slice.sizeof == 4, slice.ptr.sizeof == 2, and size_t.sizeof == 2.
>
> You should have better luck using gdc on avr.
>
> https://explore.dgnu.org/z/bos5ee

Hi Max,
  GDC and LDC are both happy to support many platforms (it's fun), so keep filing bug reports in our bug trackers! (LDC's bug tracker is on Github, please also mention the triple you are using)

cheers,
  Johan

June 07, 2021
On Sunday, 6 June 2021 at 21:18:01 UTC, Iain Buclaw wrote:

>
> That sounds a lot like this issue: https://issues.dlang.org/show_bug.cgi?id=17857

Most certainly.

>
> Can backport that for GCC-11.

Would be great if you did. Not a blocker, though.

June 07, 2021
On Sunday, 6 June 2021 at 22:39:34 UTC, Johan Engelen wrote:
> it's fun

Hell Yeah! )



June 08, 2021

On Monday, 7 June 2021 at 10:38:08 UTC, Max Samukha wrote:

>

Would be great if you did. Not a blocker, though.

However, this is a major pain:

struct FP {
}

alias parse = () {
    FP[] parts;
    parts ~= FP();
    return parts;
};

immutable s = parse();

extern(C) int main() {
    return 0;
}

avr-gdc -fno-druntime ctfe.d
ctfe.d:3:1: error: 'object.TypeInfo' cannot be used with '-fno-rtti'
3 | struct FP {
| ^
ctfe.d:3:1: error: 'object.TypeInfo' could not be found, but is implicitly used
3 | struct FP {
| ^
d21: internal compiler error: Segmentation fault
0x178ae29 internal_error(char const*, ...)

June 08, 2021

On Tuesday, 8 June 2021 at 09:08:20 UTC, Max Samukha wrote:

>

On Monday, 7 June 2021 at 10:38:08 UTC, Max Samukha wrote:

>

Would be great if you did. Not a blocker, though.

However, this is a major pain:

struct FP {
}

alias parse = () {
    FP[] parts;
    parts ~= FP();
    return parts;
};

immutable s = parse();

extern(C) int main() {
    return 0;
}

avr-gdc -fno-druntime ctfe.d
ctfe.d:3:1: error: 'object.TypeInfo' cannot be used with '-fno-rtti'
3 | struct FP {
| ^
ctfe.d:3:1: error: 'object.TypeInfo' could not be found, but is implicitly used
3 | struct FP {
| ^
d21: internal compiler error: Segmentation fault
0x178ae29 internal_error(char const*, ...)

Thanks, that seems to be this issue.

Testing backports of both now (here and here).

June 08, 2021

On Tuesday, 8 June 2021 at 11:35:39 UTC, Iain Buclaw wrote:

>

Testing backports of both now (here and here).

Thanks!

July 16, 2021

On Tuesday, 1 June 2021 at 11:57:34 UTC, Mike Parker wrote:

>

Dylan Graham writes about his experience using D in a microcontroller project and why he chose it. Does anyone know of any similar projects using D? I don't. This may well be the first time it's been employed in this specific manner.

Golem has translated the article into German and republished it:

https://www.golem.de/news/programmiersprachen-durchstarten-mit-d-2107-157716.html