Re: From the D Blog: Driving with D
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
Re: From the D Blog: Driving with D
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.
Re: From the D Blog: Driving with D
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.
Re: From the D Blog: Driving with D
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
Re: LDC 1.27.0-beta1
On Saturday, 5 June 2021 at 16:53:50 UTC, kinke wrote: Glad to announce the first beta for LDC 1.27 - some highlights: thank you for all your efforts.It's great.
Re: LDC 1.27.0-beta1
On Saturday, 5 June 2021 at 16:53:50 UTC, kinke wrote: Glad to announce the first beta for LDC 1.27 Awesome!! Question, how frequently you guys are updating Snap store? It still has "1.24.0". https://snapcraft.io/ldc2
Re: (Oh My) Gentool 0.4.0 released
On Sunday, 6 June 2021 at 10:38:22 UTC, sighoya wrote: On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote: ## (oh my) gentool v0.4 is now out. It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D. This release has one new feature: support pragma mangle on aggregates (class, struct, etc...). Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes. Source https://github.com/Superbelko/ohmygentool Windows binaries https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0 +1 How did you parse C++ code which seems overkill to do alone. Did you enact clang for? Yes, it's all clang under the hood. But it's not just clang tooling that uses pre-made Tool class that has to be invoked as part of clang itself using special flag. Instead it creates compiler instance and runs regular compilation pass in memory extracting declarations recursively (as part of older pipeline, can be done to some extent using C API with cursors), and then it converts C++ AST to D source code with minimal AST manipulation (can't be done with C API), though I'm looking into AST-to-AST translation instead and then using D compiler frontend to emit source code for better result.
Re: (Oh My) Gentool 0.4.0 released
On Sunday, 6 June 2021 at 10:03:11 UTC, evilrat wrote: ## (oh my) gentool v0.4 is now out. It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D. This release has one new feature: support pragma mangle on aggregates (class, struct, etc...). Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes. Source https://github.com/Superbelko/ohmygentool Windows binaries https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0 +1 How did you parse C++ code which seems overkill to do alone. Did you enact clang for?
(Oh My) Gentool 0.4.0 released
## (oh my) gentool v0.4 is now out. It is my fancy tool to generate extern(C++) stuff quicker, it takes regular compiler flags that you usually pass to clang and translates C/C++ code to D. This release has one new feature: support pragma mangle on aggregates (class, struct, etc...). Also a lot of work was put into template support, but it is still has lots of unhandled cases, so do not expect it will translate STL or Boost without need of manual fixes. Source https://github.com/Superbelko/ohmygentool Windows binaries https://github.com/Superbelko/ohmygentool/releases/tag/v0.4.0