trait to get the body code of a function?

2018-07-23 Thread Guillaume Lathoud via Digitalmars-d-learn
Hello, __traits and std.traits already offer access to function information like input parameters, e.g. in std.traits: ParameterIdentifierTuple ParameterStorageClassTuple Even if that might sound strange, is there a compile time access to the body of the function, e.g. as a code string, or

Re: trait to get the body code of a function?

2018-07-24 Thread Guillaume Lathoud via Digitalmars-d-learn
On Tuesday, 24 July 2018 at 14:26:45 UTC, 12345swordy wrote: On Tuesday, 24 July 2018 at 05:27:36 UTC, rikki cattermole wrote: On 24/07/2018 4:43 PM, Guillaume Lathoud wrote: [...] Doesn't exist. Well, IMO it should exist as it can be quite useful for generating metainfo. Thanks for all

Re: trait to get the body code of a function?

2018-07-25 Thread Guillaume Lathoud via Digitalmars-d-learn
On Wednesday, 25 July 2018 at 04:46:20 UTC, rikki cattermole wrote: On 25/07/2018 5:32 AM, Guillaume Lathoud wrote: Thanks for all the answers. I've just had a look at an alternative: using dmd as a package. However that's a lot of doc to browse... Maybe someone has experience with dmd as a

Re: How to list aggregate members in order of declaration at compile time?

2018-06-27 Thread Guillaume Lathoud via Digitalmars-d-learn
On Friday, 11 November 2016 at 23:55:58 UTC, Jonathan M Davis wrote: ... So, just provide a solid use case (if not multiple) as to why it needs to have a specific order, and you probably stand a good chance of it being added to the spec - especially since it's what the implementation does

Re: -O flag ; automatic cast in a bitshift

2018-10-01 Thread Guillaume Lathoud via Digitalmars-d-learn
On Friday, 21 September 2018 at 01:44:33 UTC, Vladimir Panteleev wrote: On Thursday, 20 September 2018 at 11:14:05 UTC, Guillaume FYI, it's undefined in D mainly because the behavior of the actual Intel CPU instruction is undefined in such cases:

Re: -O flag ; automatic cast in a bitshift

2018-09-20 Thread Guillaume Lathoud via Digitalmars-d-learn
On Thursday, 20 September 2018 at 11:08:32 UTC, ketmar wrote: Guillaume Lathoud wrote: this is UB. by the specs, values are promoted to int, and shifting int by 50 is UB. so both results are nonsense. Thanks!

-O flag ; automatic cast in a bitshift

2018-09-20 Thread Guillaume Lathoud via Digitalmars-d-learn
Hello, the code below behaves differently when compiled with or without the -O flag (both DMD and LDC2). Two questions: (1) does the D language explicitly specifies what the following expression should do? If yes, where? ' |= << ' In the example below, there seems to be a cast to 32

Re: Practical parallelization of D compilation

2020-01-09 Thread Guillaume Lathoud via Digitalmars-d-learn
On Wednesday, 8 January 2020 at 15:44:24 UTC, user1234 wrote: yeah there's one. DUB does the same as you script with the following options: dub build --parallel --build-mode=singleFile I just gave it a try, and it stopped with a warning on some file. After fixing the file, I relaunched

Re: Practical parallelization of D compilation

2020-01-09 Thread Guillaume Lathoud via Digitalmars-d-learn
On Wednesday, 8 January 2020 at 19:31:13 UTC, H. S. Teoh wrote: Personally I prefer using SCons (https://scons.org/), but there are plenty of similar build systems out there, like tup, Meson, CMake, etc.. There are also fancier offerings that double as package managers like Gradle, but from

Re: Practical parallelization of D compilation

2020-01-15 Thread Guillaume Lathoud via Digitalmars-d-learn
Concerning the first (fresh) compilation: On Wednesday, 8 January 2020 at 13:14:38 UTC, kinke wrote: [...] you can also try to compile all modules at once, but output separate object files - `ldc2 -c a.d b.d c.d`. I just had another try at `ldc2 -c ...`. It does work when grouping the files

Re: Practical parallelization of D compilation

2020-01-08 Thread Guillaume Lathoud via Digitalmars-d-learn
Thanks to all for the answers. The package direction is precisely what I am trying to avoid. It is still not obvious to me how much work (how many trials) would be needed to decide on granularity, as well as how much work to automatize the decision to recompile a package or not ; and

Practical parallelization of D compilation

2020-01-07 Thread Guillaume Lathoud via Digitalmars-d-learn
Hello, One of my D applications grew from a simple main and a few source files to more than 200 files. Although I minimized usage of templating and CTFE, the compiling time is now about a minute. I did not find any solution to take advantage of having multiple cores during compilation, lest I

Re: openssl 1.1 vs. 3.0 for vibe.d:tls on Ubuntu 22.04

2023-07-31 Thread Guillaume Lathoud via Digitalmars-d-learn
On Friday, 28 July 2023 at 08:56:17 UTC, Guillaume Lathoud wrote: ... Now to the actual question: I am a bit confused since the source code of `vibe-d:tls` seem to support openssl-3.0, as visible e.g. in [1] but then in the config [2] I don't see anything like `"openssl-3.0"`. Maybe I missed

openssl 1.1 vs. 3.0 for vibe.d:tls on Ubuntu 22.04

2023-07-28 Thread Guillaume Lathoud via Digitalmars-d-learn
Hello, some context first: I recently updated a server to Ubuntu 22.04 which appears to have only openssl 3.0.2 installed. Dub could compile my project, but could not link it anymore, as the D code seemed to be expecting openssl 1.1 whereas only 3.0.2 was installed. That type of errors: ```