GCC 14.1.0 now available for Dreamcast's KallistiOS, including GDC support.

2024-05-08 Thread Paulo Pinto via Digitalmars-d-announce
As per KallistiOS Dreamcast maintainers, the new GCC version has been integrated, with support for all GCC frontends, https://twitter.com/falco_girgis/status/1788064911689404612

Re: Spec for the ‘locality’ parameter to the LDC and GDC builtin magic functions for accessing special CPU prefetch instructions

2023-08-22 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 19 August 2023 at 19:23:38 UTC, Cecil Ward wrote: I’m trying to write a cross-platform function that gives access to the CPU’s prefetch instructions such as x86 prefetch0/1/2/prefetchnta and AAarch64 too. I’ve found that the GDC and LDC compilers provide builtin magic functions

Re: Spec for the ‘locality’ parameter to the LDC and GDC builtin magic functions for accessing special CPU prefetch instructions

2023-08-20 Thread Iain Buclaw via Digitalmars-d-learn
On Saturday, 19 August 2023 at 19:23:38 UTC, Cecil Ward wrote: I’m trying to write a cross-platform function that gives access to the CPU’s prefetch instructions such as x86 prefetch0/1/2/prefetchnta and AAarch64 too. I’ve found that the GDC and LDC compilers provide builtin magic functions

Spec for the ‘locality’ parameter to the LDC and GDC builtin magic functions for accessing special CPU prefetch instructions

2023-08-19 Thread Cecil Ward via Digitalmars-d-learn
I’m trying to write a cross-platform function that gives access to the CPU’s prefetch instructions such as x86 prefetch0/1/2/prefetchnta and AAarch64 too. I’ve found that the GDC and LDC compilers provide builtin magic functions for this, and are what I need. I am trying to put together

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-25 Thread Ernesto Castellotti via Digitalmars-d-learn
and curl) are all Boost regardless of compiler. That just leaves backends, which depends upon GCC and LLVM. So if you can use GCC and Clang, your fine to use GDC and LDC. As far as I know any contribution to GCC has to be done under a GPLv3 compatible license (like Boost) and then it's all

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-25 Thread IchorDev via Digitalmars-d-learn
n by many users (e.g. compiling with -release, disabling of asserts or array bounds checking, etc). Known edge cases of compiler optimization causing different behavior between vendors? Some LDC stuff: https://wiki.dlang.org/LDC-specific_language_changes#Violations_of_the_specification Pretty muc

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Guillaume Piolat via Digitalmars-d-learn
On Monday, 24 July 2023 at 09:20:05 UTC, BoQsc wrote: There are three compilers present in the Dlang website: DMD GDC and LDC DMD can build much faster than LDC. In some cases it is quite extreme, for example the product I work on has a 3.6x faster debug build time with DMD (well, only

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Johan via Digitalmars-d-learn
it into LDC. I understand what you mean, but a key reason to use LDC or GDC is for all the features that DMD does not have. - support for more platforms - CPU intrinsics, more extensive inline assembly - sanitizers, fuzzing - special function/variable attributes (e.g. @section, @weak, ...) To the OP's

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Dennis via Digitalmars-d-learn
On Monday, 24 July 2023 at 13:30:27 UTC, cc wrote: Is there any list of known significant "gotchas" with moving to LDC from DMD? Any unexpected surprises to watch out for or be careful for? - DMD has weak linking for all functions by default (mostly as a workaround to several bugs). In LDC,

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
, which depends upon GCC and LLVM. So if you can use GCC and Clang, your fine to use GDC and LDC.

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Steven Schveighoffer via Digitalmars-d-learn
only differ between them by their glue code to the relevant backend and some modules in druntime that are optional. Oh and inline assembly, although there is some compat code in ldc/gdc for dmd style. If dmd dies, so does ldc/gdc basically. Each one sees active development although gdc only has

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
``extern(Objective-C)`` implemented currently. I don't know about GDC. Over all, if you are familiar with GCC & Clang, you'll be ok. A lot of the flags from dmd have a comparable version (if not split up further) in LDC and GDC.

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread cc via Digitalmars-d-learn
by their glue code to the relevant backend and some modules in druntime that are optional. Oh and inline assembly, although there is some compat code in ldc/gdc for dmd style. If dmd dies, so does ldc/gdc basically. Each one sees active development although gdc only has one developer. Ldc keeps up

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread devosalain via Digitalmars-d-learn
I could be interesting to also compare the licenses of the 3 compilers.

Re: Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
that are optional. Oh and inline assembly, although there is some compat code in ldc/gdc for dmd style. If dmd dies, so does ldc/gdc basically. Each one sees active development although gdc only has one developer. Ldc keeps up with the dmd releases pretty well.

Which D compiler is the most maintained and future-proof? [DMD GDC and LDC]

2023-07-24 Thread BoQsc via Digitalmars-d-learn
There are three compilers present in the Dlang website: DMD GDC and LDC

Re: Installing GDC / Linux / x86-64 when apt-get doesn’t work

2023-07-11 Thread Cecil Ward via Digitalmars-d-learn
On Tuesday, 11 July 2023 at 05:49:36 UTC, Sergey wrote: On Tuesday, 11 July 2023 at 04:11:38 UTC, Cecil Ward wrote: I’m trying to install GDC on a new Linux box and I don’t know what I’m doing. Background: I have installed LDC successfully and have installed GDC on a Raspberry Pi using 32-bit

Re: Installing GDC / Linux / x86-64 when apt-get doesn’t work

2023-07-10 Thread Sergey via Digitalmars-d-learn
On Tuesday, 11 July 2023 at 04:11:38 UTC, Cecil Ward wrote: I’m trying to install GDC on a new Linux box and I don’t know what I’m doing. Background: I have installed LDC successfully and have installed GDC on a Raspberry Pi using 32-bit ARM. For some reason the apt-get command doesn’t work

Re: Installing GDC / Linux / x86-64 when apt-get doesn’t work

2023-07-10 Thread Cecil Ward via Digitalmars-d-learn
On Tuesday, 11 July 2023 at 04:11:38 UTC, Cecil Ward wrote: I’m trying to install GDC on a new Linux box and I don’t know what I’m doing. Background: I have installed LDC successfully and have installed GDC on a Raspberry Pi using 32-bit ARM. For some reason the apt-get command doesn’t work

Installing GDC / Linux / x86-64 when apt-get doesn’t work

2023-07-10 Thread Cecil Ward via Digitalmars-d-learn
I’m trying to install GDC on a new Linux box and I don’t know what I’m doing. Background: I have installed LDC successfully and have installed GDC on a Raspberry Pi using 32-bit ARM. For some reason the apt-get command doesn’t work on this machine, don’t know why. The machine is a virtual

Re: gdc 12.1: undefined references when linking separately compiled files

2023-07-06 Thread mw via Digitalmars-d-learn
On Thursday, 6 July 2023 at 22:44:27 UTC, Alexibu wrote: I just encountered this problem in recently released debian bookworm (gdc 12.2.0), I was able to fix these undefined lambdas inside std library with -fall-instantiations, and a bunch of other undefined lambdas in my own code

Re: gdc 12.1: undefined references when linking separately compiled files

2023-07-06 Thread Alexibu via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:44:56 UTC, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 14:16:51 UTC, kdevel wrote: $ gdc -o ppinsta ppinsta.d parser.d Compiling together is faster anyway this is prolly what you want most the time. But I know what's going on now, it is the template

Re: GDC Compilation wtih Directory Present

2023-06-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 June 2023 at 06:38:17 UTC, Murloc wrote: Thanks! That works well. I thought that `module pack.file1` is implicitly there by default :') The compiler will use the file name as a default module name if you don't provide one, but that's *just* the module name. It doesn't take

Re: GDC Compilation wtih Directory Present

2023-06-16 Thread Murloc via Digitalmars-d-learn
On Friday, 16 June 2023 at 06:32:21 UTC, Richard (Rikki) Andrew Cattermole wrote: On 16/06/2023 6:26 PM, Murloc wrote: Don't you need to provide a full path to these files relatively to the directory where the compilation process takes place (Test)? Yes. But I suspect you have not written

Re: GDC Compilation wtih Directory Present

2023-06-16 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 16/06/2023 6:26 PM, Murloc wrote: Don't you need to provide a full path to these files relatively to the directory where the compilation process takes place (Test)? Yes. But I suspect you have not written the module statement, which is required. ```d module pack.file1; // file1.d void

GDC Compilation wtih Directory Present

2023-06-16 Thread Murloc via Digitalmars-d-learn
; import pack.file2: value; writeln(value); } ``` ```d // program.d void main() { import pack.file1; printlnValueInFile2(); // -120 expected } ``` From the directory Test when I'm trying to compile the project with command `gdc -o program program.d pack/file1.d pack/file2.d`, it produces

Re: Writing a dejargoniser - producing read ke analysis output in English that explains GDC / LDC asm code’s parameters and clobbers

2023-04-05 Thread z via Digitalmars-d-learn
’. :-) The idea would be that the user could run this to sanity-check her understanding of the sometimes arcane GDC asm code outputs/inputs/clobbers syntax, and see what her asm code’s constraints are actually going to do rather than what she thinks it’s going to do. Clearly I can’t readily start

Writing a dejargoniser - producing read ke analysis output in English that explains GDC / LDC asm code’s parameters and clobbers

2023-04-05 Thread Cecil Ward via Digitalmars-d-learn
-check her understanding of the sometimes arcane GDC asm code outputs/inputs/clobbers syntax, and see what her asm code’s constraints are actually going to do rather than what she thinks it’s going to do. Clearly I can’t readily start parsing the asm body itself, I would just inspect the meta info

Re: Any ways to get addr2line working with DMD? works fine with GDC

2023-03-21 Thread ryuukk_ via Digitalmars-d-learn
I found what was the issue!! https://stackoverflow.com/a/63856113 The 0x55XX address you got is most likely the memory address of the function after the EXE is loaded from disk. addr2line only recognizes VMA addresses like the ones that you got from disassembling with objdump. It

Re: Any ways to get addr2line working with DMD? works fine with GDC

2023-03-21 Thread ryuukk_ via Digitalmars-d-learn
I found what was the issue!! https://stackoverflow.com/a/63856113 The 0x55XX address you got is most likely the memory address of the function after the EXE is loaded from disk. addr2line only recognizes VMA addresses like the ones that you got from disassembling with objdump. It

Re: Any ways to get addr2line working with DMD? works fine with GDC

2023-03-17 Thread ryuukk_ via Digitalmars-d-learn
On Friday, 17 March 2023 at 20:53:07 UTC, WB wrote: On Thursday, 16 March 2023 at 22:07:04 UTC, ryuukk_ wrote: Hello, The problem is when i compile with DMD i get: ``` ??:0 ``` When i compile it with GDC i get proper file + line What does GDC do different than DMD? Is there a way to get

Re: Any ways to get addr2line working with DMD? works fine with GDC

2023-03-17 Thread WB via Digitalmars-d-learn
On Thursday, 16 March 2023 at 22:07:04 UTC, ryuukk_ wrote: Hello, The problem is when i compile with DMD i get: ``` ??:0 ``` When i compile it with GDC i get proper file + line What does GDC do different than DMD? Is there a way to get the same result as GDC with DMD? Thanks Did you

Any ways to get addr2line working with DMD? works fine with GDC

2023-03-16 Thread ryuukk_ via Digitalmars-d-learn
t;, array[i], _exe[0]); system([0]); printf(" >%s\n", strings[i]); //sprintf([0], "addr2line %p -f -e %s | ddemangle", strings[i], _exe[0]); //system([0]); } exit(-1); } ``` The problem is when i compile with DMD i get: ``` ??:0 ``` When i compile it with GDC i get proper file + line What does GDC do different than DMD? Is there a way to get the same result as GDC with DMD? Thanks

Re: GDC documentation is online and 13.x development updates.

2023-01-22 Thread Iain Buclaw via Digitalmars-d-announce
On Sunday, 15 January 2023 at 19:00:50 UTC, Johan wrote: On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. https://gcc.gnu.org/onlinedocs/gdc/ Just

Re: GDC documentation is online and 13.x development updates.

2023-01-15 Thread Johan via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. https://gcc.gnu.org/onlinedocs/gdc/ Just now, I had trouble finding this. I don't think

Re: GDC binary for windows?

2022-12-18 Thread j via Digitalmars-d-learn
On Thursday, 15 December 2022 at 21:43:07 UTC, TheZipCreator wrote: is there a compiled binary of GDC anywhere? I looked at https://www.gdcproject.org/downloads, and the link there goes to winlibs, but after downloading the archive I couldn't find gdc anywhere in it. I did some research

[Issue 20841] Website: update the outdated GDC download link.

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20841 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 15843] D-type mangling used for extern(C) (extern) function declaration inside function body, on LDC, GDC, and DMD.

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15843 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 23416] Difference DMD/GDC: Error: non-constant expression `& foo`

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23416 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --

[Issue 14937] Slow code compared to ldc/gdc on calculation with real variables

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14937 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --

[Issue 21342] Install.sh can not install gdc, can not install ldc.

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21342 Iain Buclaw changed: What|Removed |Added Priority|P1 |P4 --

GDC binary for windows?

2022-12-15 Thread TheZipCreator via Digitalmars-d-learn
is there a compiled binary of GDC anywhere? I looked at https://www.gdcproject.org/downloads, and the link there goes to winlibs, but after downloading the archive I couldn't find gdc anywhere in it. I did some research and [it appears they removed it](https://forum.dlang.org/thread

Re: GDC documentation is online and 13.x development updates.

2022-12-15 Thread Witold Baryluk via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. [...] Nice. GDC expanded documentation looks really good, and covers everything I could think

Re: GDC documentation is online and 13.x development updates.

2022-12-10 Thread Bruce Carneal via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. ... This is very much appreciated, especially the SIMD portion. Thanks.

Re: GDC documentation is online and 13.x development updates.

2022-12-09 Thread M.M. via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. [...] There is quite some momentum on the GDC front recently. Well done. Much appreciated.

Re: GDC documentation is online and 13.x development updates.

2022-12-06 Thread zjh via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There are new documents to learn.

Re: GDC documentation is online and 13.x development updates.

2022-12-06 Thread Johan via Digitalmars-d-announce
On Tuesday, 6 December 2022 at 12:13:59 UTC, Iain Buclaw wrote: Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. https://gcc.gnu.org/onlinedocs/gdc/ (also in [PDF](https://gcc.gnu.org/onlinedocs/gdc.pdf

GDC documentation is online and 13.x development updates.

2022-12-06 Thread Iain Buclaw via Digitalmars-d-announce
Hi, There is now (long overdue) expanded documentation of the user-facing features of GDC online on GCC's documentation site. https://gcc.gnu.org/onlinedocs/gdc/ (also in [PDF](https://gcc.gnu.org/onlinedocs/gdc.pdf) or [PostScript](https://gcc.gnu.org/onlinedocs/gdc.ps.gz) or an [HTML

[Issue 23416] Difference DMD/GDC: Error: non-constant expression `& foo`

2022-10-14 Thread d-bugmail--- via Digitalmars-d-bugs
: non-constant expression `& foo` But this code should compile and pass: $ gdc -O -funittest -fmain post2.d -o post2 && ./post2 void post2.S.foo() void post2.S.bar() 1 modules passed unittests --

[Issue 23416] Difference DMD/GDC: Error: non-constant expression `& foo`

2022-10-14 Thread d-bugmail--- via Digitalmars-d-bugs
||ibuc...@gdcproject.org --- Comment #1 from Iain Buclaw --- LDC also errors: dmd-gdc-difference.d(4): Error: need `this` to access `foo` Compiler returned: 1 --

[Issue 23416] New: Difference DMD/GDC: Error: non-constant expression `& foo`

2022-10-14 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23416 Issue ID: 23416 Summary: Difference DMD/GDC: Error: non-constant expression `& foo` Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-30 Thread Johan via Digitalmars-d-learn
On Saturday, 28 May 2022 at 22:23:34 UTC, kdevel wrote: On Saturday, 28 May 2022 at 15:10:25 UTC, Steven Schveighoffer wrote: [...] Is this specific to gdc, or does it happen for other compilers as well? The former. Please check the dlang versions of all compilers. The template emission

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 15:10:25 UTC, Steven Schveighoffer wrote: [...] Is this specific to gdc, or does it happen for other compilers as well? The former.

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:37:07 UTC, kdevel wrote: dmd: ``` $ dmd -c ppinsta.d $ dmd -c parser.d $ dmd -of=ppinsta ppinsta.o parser.o $ ./ppinsta [] ``` (checking ldc/ldmd2 later) ``` $ ldc2 -c ppinsta.d && ldc2 -c parser.d && ldc2 -of=ppinsta ppinsta.o parser.o && ./ppinsta [] $

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/28/22 10:44 AM, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 14:16:51 UTC, kdevel wrote: $ gdc -o ppinsta ppinsta.d parser.d Compiling together is faster anyway this is prolly what you want most the time. But I know what's going on now, it is the template emission thing

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:44:56 UTC, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 14:16:51 UTC, kdevel wrote: $ gdc -o ppinsta ppinsta.d parser.d Compiling together is faster anyway this is prolly what you want most the time. But I know what's going on now, it is the template

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:16:51 UTC, kdevel wrote: $ gdc -o ppinsta ppinsta.d parser.d Compiling together is faster anyway this is prolly what you want most the time. But I know what's going on now, it is the template emission thing, the compiler thinks, since it is from std

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:55:09 UTC, Tejas wrote: On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: [...] Is seperate compilation

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:03:13 UTC, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: gdc -o ppinsta ppinsta.o esah.o evaluate.o jsr.o jsw.o parser.o ptvr.o stack.o testdatagenerator.o You might need to add -lgphobos or -lgphobos2 or whatever it is called too

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: Any ideas? ppinsta.d ``` import std.stdio : write, writeln; import parser; // <- comment this out and gdc links void main () { string [string] h; writeln (h); } ``` parser.d ``` module parser; import std.regex : regex; priv

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: gdc -o ppinsta ppinsta.o esah.o evaluate.o jsr.o jsw.o parser.o ptvr.o stack.o testdatagenerator.o You might need to add -lgphobos or -lgphobos2 or whatever it is called too explicitly.

Re: gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread Tejas via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: [...] Is seperate compilation working successfully for dmd and ldc? The only bug I know

gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: ``` $ gdc -o ppinsta esah.d evaluate.d jsr.d jsw.d parser.d ppinsta.d ptvr.d stack.d testdatagenerator.d ``` Though after compiling separately

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-28 Thread Ali Çehreli via Digitalmars-d-learn
On 4/26/22 3:32 AM, Claude wrote: > On Tuesday, 26 April 2022 at 10:29:39 UTC, Iain Buclaw wrote: >> you haven't initialized the D run-time in your program. > I should have suspected something like this. I've just discovered[1] that I had a DConf 2020 presentation which is somewhat related to

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-27 Thread dangbinghoo via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 13:36:19 UTC, Claude wrote: On Tuesday, 26 April 2022 at 12:49:21 UTC, Alain De Vos wrote: --- I also encountered problems while I was trying to use CTFE only functions (using betterC so I don't have to link phobos/D-runtime). However, if those functions use the

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Claude via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 12:49:21 UTC, Alain De Vos wrote: PS : I use ``` ldc2 --gcc=cc , cc -v : clang version 11.0.1 ``` We only have gcc in our toolchain (we target an ARM-based embedded system). --- I also encountered problems while I was trying to use CTFE only functions (using

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Alain De Vos via Digitalmars-d-learn
PS : I use ``` ldc2 --gcc=cc , cc -v : clang version 11.0.1 ```

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Claude via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 10:29:39 UTC, Iain Buclaw wrote: On Tuesday, 26 April 2022 at 10:23:15 UTC, Claude wrote: Hello, Hello, <%--SNIP--%> Does anyone have any idea what's going on? (if I just compile a single D file with "int main() { int* a = new int(42); return *a; }", it

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Claude via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 10:23:15 UTC, Claude wrote: It seg-faults... Just to make it clear, it seg-faults at run-time (not at compilation or link time) when I launch the executable "test".

Re: Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Iain Buclaw via Digitalmars-d-learn
On Tuesday, 26 April 2022 at 10:23:15 UTC, Claude wrote: Hello, Hello, <%--SNIP--%> Does anyone have any idea what's going on? (if I just compile a single D file with "int main() { int* a = new int(42); return *a; }", it works as intended.) The `new` keyword requests the druntime GC

Problem with GC - linking C++ & D (with gdc)

2022-04-26 Thread Claude via Digitalmars-d-learn
Hello, I'm working on a C++ project requiring an XML parser. I decided to make it in D so I could easily parse at run-time or compile-time as I wish. As our project uses a gcc tool-chain, I naturally use GDC (GCC 9.4.0). But I have a few problems with D, linking with it, trying to use

Re: gdc or ldc for faster programs?

2022-03-10 Thread Chris Piker via Digitalmars-d-learn
On Tuesday, 25 January 2022 at 20:04:04 UTC, Adam D Ruppe wrote: Not surprising at all: gdc is excellent and underrated in the community. The performance metrics are just a bonus. Gdc is the main reason I can get my worksite to take D seriously since we're a traditional unix shop (solaris

Re: gdc or ldc for faster programs?

2022-03-09 Thread Iain Buclaw via Digitalmars-d-learn
On Monday, 31 January 2022 at 10:33:49 UTC, Siarhei Siamashka wrote: I wonder if GDC can do the same? GDC as a front-end doesn't dictate what the optimization passes are doing, nor does it have any real control what each level means. It is only ensured that semantic doesn't break because

Re: gdc or ldc for faster programs?

2022-01-31 Thread Siarhei Siamashka via Digitalmars-d-learn
izations --O4 - Equivalent to -O3 --O5 - Equivalent to -O3 --Os - Like -O2 with extra optimizations for size --Oz - Like -Os but reduces code size further I wonder if GDC can do the same?

Re: gdc or ldc for faster programs?

2022-01-31 Thread Elronnd via Digitalmars-d-learn
On Monday, 31 January 2022 at 08:54:16 UTC, Patrick Schluter wrote: -O3 often chooses longer code and unrollsmore agressively inducing higher miss rates in the instruction caches. -O2 can beat -O3 in some cases when code size is important. That is generally true. My point is that GCC and

Re: gdc or ldc for faster programs?

2022-01-31 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 25 January 2022 at 22:41:35 UTC, Elronnd wrote: On Tuesday, 25 January 2022 at 22:33:37 UTC, H. S. Teoh wrote: interesting because idivl is known to be one of the slower instructions, but gdc nevertheless considered it not worthwhile to replace it, whereas ldc seems obsessed about

Re: gdc or ldc for faster programs?

2022-01-30 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 29 January 2022 at 18:28:06 UTC, Ali Çehreli wrote: On 1/29/22 10:04, Salih Dincer wrote: > Could you also try the following > code with the same configurations? The program you posted with 2 million random values: ldc 1.9 seconds gdc 2.3 seconds dmd 2.8 seconds I unde

Re: gdc or ldc for faster programs?

2022-01-29 Thread Siarhei Siamashka via Digitalmars-d-learn
On Saturday, 29 January 2022 at 18:28:06 UTC, Ali Çehreli wrote: (And now we know gdc can go about 7% faster with additional command line switches.) No, we don't know this yet ;-) That's just what I said and I may be bullshitting. Or the configuration of my computer is significantly

Re: gdc or ldc for faster programs?

2022-01-29 Thread max haughton via Digitalmars-d-learn
On Saturday, 29 January 2022 at 18:28:06 UTC, Ali Çehreli wrote: On 1/29/22 10:04, Salih Dincer wrote: > Could you also try the following code with the same configurations? The program you posted with 2 million random values: ldc 1.9 seconds gdc 2.3 seconds dmd 2.8 seconds I underst

Re: gdc or ldc for faster programs?

2022-01-29 Thread Ali Çehreli via Digitalmars-d-learn
On 1/29/22 10:04, Salih Dincer wrote: > Could you also try the following code with the same configurations? The program you posted with 2 million random values: ldc 1.9 seconds gdc 2.3 seconds dmd 2.8 seconds I understand such short tests are not definitive but to have a rough idea betw

Re: gdc or ldc for faster programs?

2022-01-29 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 18:00:41 UTC, Ali Çehreli wrote: For completeness (and noise :/) here is the final version of the program: Could you also try the following code with the same configurations? ```d struct LongScale { struct ShortStack { short[] stack; size_t

Re: gdc or ldc for faster programs?

2022-01-28 Thread Siarhei Siamashka via Digitalmars-d-learn
r the hood. They can be solved when/if we encounter them. That said, I can confirm that GDC 10 indeed fails with `multiple definition of 'rt_cmdline_enabled'` linker error when trying to compile: ```D extern(C) __gshared bool rt_cmdline_enabled = false; void main() { } ``` But can't GDC just use

Re: gdc or ldc for faster programs?

2022-01-28 Thread Iain Buclaw via Digitalmars-d-learn
On Thursday, 27 January 2022 at 20:28:40 UTC, Siarhei Siamashka wrote: On Thursday, 27 January 2022 at 18:12:18 UTC, Johan Engelen wrote: But the language requires ODR, so we can emit templates as weak_odr, telling the optimizer and linker that the symbols should be merged _and_ that ODR can

Re: gdc or ldc for faster programs?

2022-01-27 Thread Siarhei Siamashka via Digitalmars-d-learn
On Thursday, 27 January 2022 at 18:12:18 UTC, Johan Engelen wrote: But the language requires ODR, so we can emit templates as weak_odr, telling the optimizer and linker that the symbols should be merged _and_ that ODR can be assumed to hold (i.e. inlining is OK). Thanks! This was also my

Re: gdc or ldc for faster programs?

2022-01-27 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 27 January 2022 at 16:46:59 UTC, Ali Çehreli wrote: What I know is that weak symbols can be overridden by strong symbols during linking. Which means, if a function body is inlined which also has a weak symbol, some part of the program may be using the inlined definition and some

Re: gdc or ldc for faster programs?

2022-01-27 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 27, 2022 at 08:46:59AM -0800, Ali Çehreli via Digitalmars-d-learn wrote: [...] > I see that template instantiations are linked through weak symbols: > > $ nm deneme | grep foo > [...] > 00021380 W _D6deneme__T3fooTiZQhFNaNbNiNfZv > > What I know is that weak symbols can be

Re: gdc or ldc for faster programs?

2022-01-27 Thread Ali Çehreli via Digitalmars-d-learn
On 1/26/22 11:07, Siarhei Siamashka wrote: > On Wednesday, 26 January 2022 at 18:41:51 UTC, Iain Buclaw wrote: >> The D language shot itself in the foot by requiring templates to have >> weak semantics. >> >> If DMD and LDC inline weak functions, that's their bug. > > As I already mentioned in

Re: gdc or ldc for faster programs?

2022-01-26 Thread Siarhei Siamashka via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 18:41:51 UTC, Iain Buclaw wrote: The D language shot itself in the foot by requiring templates to have weak semantics. If DMD and LDC inline weak functions, that's their bug. As I already mentioned in the bugzilla, it would be really useful to see a

Re: gdc or ldc for faster programs?

2022-01-26 Thread Iain Buclaw via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 18:39:07 UTC, Siarhei Siamashka wrote: It's not DMD doing a good job here, but GDC11 shooting itself in the foot by requiring additional esoteric command line options if you really want to produce optimized binaries. The D language shot itself in the foot

Re: gdc or ldc for faster programs?

2022-01-26 Thread Siarhei Siamashka via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 18:00:41 UTC, Ali Çehreli wrote: ldc shines with sprintf. And dmd suprises by being a little bit faster than gdc! (?) ldc (2.098.0): ~6.2 seconds dmd (2.098.1): ~7.4 seconds gdc (2.076.?): ~7.5 seconds Again, here are the versions of the compilers

Re: gdc or ldc for faster programs?

2022-01-26 Thread Iain Buclaw via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 11:43:39 UTC, forkit wrote: On Wednesday, 26 January 2022 at 11:25:47 UTC, Iain Buclaw wrote: Whenever I've watched talks/demos where benchmarks were the central topic, GDC has always blown LDC out the water when it comes to matters of math. .. https

Re: gdc or ldc for faster programs?

2022-01-26 Thread Ali Çehreli via Digitalmars-d-learn
ldc shines with sprintf. And dmd suprises by being a little bit faster than gdc! (?) ldc (2.098.0): ~6.2 seconds dmd (2.098.1): ~7.4 seconds gdc (2.076.?): ~7.5 seconds Again, here are the versions of the compilers that are readily available on my system: > ldc: LDC - the LLVM D compi

Re: gdc or ldc for faster programs?

2022-01-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/26/22 7:06 AM, Johan wrote: Couldn't test with LDC 1.6 (dlang2.076), because it is too old and not running on M1/Monterey (?). There was a range of macos dmd binaries that did not work after a certain MacOS. I think it had to do with the hack for TLS that apple changed, so it no longer

Re: gdc or ldc for faster programs?

2022-01-26 Thread Ali Çehreli via Digitalmars-d-learn
On 1/26/22 04:06, Johan wrote: > The stdlib makes a huge difference in performance. > Ali's program uses string manipulation, Yes, on the surface, I thought my inner loop had just / and % but of course there is that formattedWrite. I will change the code to use sprintf into a static buffer

Re: gdc or ldc for faster programs?

2022-01-26 Thread Johan via Digitalmars-d-learn
Linux's package system: >> >> ldc: LDC - the LLVM D compiler (1.28.0): >> based on DMD v2.098.0 and LLVM 13.0.0 >> >> gdc: dc (GCC) 11.1.0 >> >> dmd: DMD64 D Compiler v2.098.1 > > What phobos version is gdc using? Oh! Good question. Unfort

Re: gdc or ldc for faster programs?

2022-01-26 Thread forkit via Digitalmars-d-learn
On Wednesday, 26 January 2022 at 11:25:47 UTC, Iain Buclaw wrote: Whenever I've watched talks/demos where benchmarks were the central topic, GDC has always blown LDC out the water when it comes to matters of math. .. https://dlang.org/blog/2020/05/14/lomutos-comeback/

Re: gdc or ldc for faster programs?

2022-01-26 Thread Iain Buclaw via Digitalmars-d-learn
mpiler (1.28.0): >> based on DMD v2.098.0 and LLVM 13.0.0 >> >> gdc: dc (GCC) 11.1.0 >> >> dmd: DMD64 D Compiler v2.098.1 > > What phobos version is gdc using? Oh! Good question. Unfortunately, I don't think Phobos modules contain that information. The followi

Re: gdc or ldc for faster programs?

2022-01-25 Thread Ali Çehreli via Digitalmars-d-learn
On 1/25/22 16:15, Johan wrote: > On Tuesday, 25 January 2022 at 19:52:17 UTC, Ali Çehreli wrote: >> >> I am using compilers installed by Manjaro Linux's package system: >> >> ldc: LDC - the LLVM D compiler (1.28.0): >> based on DMD v2.098.0 and LLVM 13.0.0 >

Re: gdc or ldc for faster programs?

2022-01-25 Thread Johan via Digitalmars-d-learn
On Tuesday, 25 January 2022 at 19:52:17 UTC, Ali Çehreli wrote: I am using compilers installed by Manjaro Linux's package system: ldc: LDC - the LLVM D compiler (1.28.0): based on DMD v2.098.0 and LLVM 13.0.0 gdc: dc (GCC) 11.1.0 dmd: DMD64 D Compiler v2.098.1 What phobos version

Re: gdc or ldc for faster programs?

2022-01-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jan 25, 2022 at 11:01:57PM +, forkit via Digitalmars-d-learn wrote: > On Tuesday, 25 January 2022 at 20:01:18 UTC, Johan wrote: > > > > Tough to say. Of course DMD is not a serious contender, but I > > believe the difference between GDC and LDC is

  1   2   3   4   5   6   7   8   9   10   >