Re: Shared library module system with dub

2021-03-01 Thread evilrat via Digitalmars-d-learn
On Tuesday, 2 March 2021 at 04:26:52 UTC, Pillager86 wrote: On Tuesday, 2 March 2021 at 04:13:31 UTC, Pillager86 wrote: On Tuesday, 2 March 2021 at 03:42:14 UTC, Pillager86 wrote: Update: the dub "dynamicLibrary" target option is busted on Windows and does not build anything at all. This

Re: Vibe.d tutorial

2021-03-01 Thread bachmeier via Digitalmars-d-learn
On Monday, 1 March 2021 at 22:25:39 UTC, Rey Valeza wrote: Hi, I wrote a tutorial on Vibe.d while trying to re-learn Vibe.d. I find that most of Kai Nacke's book need updating, so I wrote a tutorial while trying to re-learn it. Here it is.

Re: Shared library module system with dub

2021-03-01 Thread Pillager86 via Digitalmars-d-learn
On Tuesday, 2 March 2021 at 04:13:31 UTC, Pillager86 wrote: On Tuesday, 2 March 2021 at 03:42:14 UTC, Pillager86 wrote: Update: the dub "dynamicLibrary" target option is busted on Windows and does not build anything at all. This should be filed as a bug. Update again: I got the Windows DLL

Re: Shared library module system with dub

2021-03-01 Thread Pillager86 via Digitalmars-d-learn
On Tuesday, 2 March 2021 at 03:42:14 UTC, Pillager86 wrote: Update: the dub "dynamicLibrary" target option is busted on Windows and does not build anything at all. This should be filed as a bug. Update again: I got the Windows DLL to build and run without crashing, but I don't know how to

Re: Shared library module system with dub

2021-03-01 Thread Pillager86 via Digitalmars-d-learn
Update: the dub "dynamicLibrary" target option is busted on Windows and does not build anything at all. This should be filed as a bug.

Shared library module system with dub

2021-03-01 Thread Pillager86 via Digitalmars-d-learn
What is the correct multi-platform way to build one dub project as a shared library, and load said shared library in a separate dub project? So far I am able to load a shared library and run a function from it (had to extern(C) it to get the symbol to load) by using

Re: Vibe.d tutorial

2021-03-01 Thread ryuukk_ via Digitalmars-d-learn
On Monday, 1 March 2021 at 22:25:39 UTC, Rey Valeza wrote: Hi, I wrote a tutorial on Vibe.d while trying to re-learn Vibe.d. I find that most of Kai Nacke's book need updating, so I wrote a tutorial while trying to re-learn it. Here it is.

Vibe.d tutorial

2021-03-01 Thread Rey Valeza via Digitalmars-d-learn
Hi, I wrote a tutorial on Vibe.d while trying to re-learn Vibe.d. I find that most of Kai Nacke's book need updating, so I wrote a tutorial while trying to re-learn it. Here it is. https://github.com/reyvaleza/vibed/commit/27ec3678f25d1dd414fae1390677397a7bc57721 I would be glad if you can

Re: Does reserve() preallocate for futher appends too?

2021-03-01 Thread bachmeier via Digitalmars-d-learn
On Monday, 1 March 2021 at 03:07:19 UTC, Jack wrote: isn't clear for me if reserve() does preallocate memory so that that operator like arr ~= x can use previously allocate memory by reserve() or it's just used in slices like b = arr[x .. y]? You may potentially find this article of use:

Re: How can I tell if the give parameter can be run at compile time?

2021-03-01 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 01, 2021 at 08:05:57PM +, Jack via Digitalmars-d-learn wrote: > bool g(T)(T) > { > return __traits(compiles, mixin("{ enum a = t; }")); > } > > > int a; > enum s = ""; > // both return false but g(s) is expected to return true > pragma(msg, g(s)); > pragma(msg, g(a));

Re: How can I tell if the give parameter can be run at compile time?

2021-03-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 1 March 2021 at 20:05:57 UTC, Jack wrote: int a; enum s = ""; // both return false but g(s) is expected to return true So the value must be known at compile time without any extra context. So that `a` variable might be changed somewhere else so compile time can't read or write it.

How can I tell if the give parameter can be run at compile time?

2021-03-01 Thread Jack via Digitalmars-d-learn
bool g(T)(T) { return __traits(compiles, mixin("{ enum a = t; }")); } int a; enum s = ""; // both return false but g(s) is expected to return true pragma(msg, g(s)); pragma(msg, g(a));

Re: vibe.d selectively include attribute into tag using diet template

2021-03-01 Thread JG via Digitalmars-d-learn
On Sunday, 28 February 2021 at 18:10:26 UTC, Steven Schveighoffer wrote: On 2/28/21 12:29 AM, JG wrote: On Saturday, 27 February 2021 at 19:12:55 UTC, Steven Schveighoffer wrote: If you use an expression without quotes in diet, it becomes an interpolation. Would you mind explaining in more

Re: Unexpected threads observed before main()

2021-03-01 Thread Keivan Shah via Digitalmars-d-learn
On Monday, 1 March 2021 at 09:03:32 UTC, rikki cattermole wrote: So it is debatable if it is a good idea to get rid of them once done (even if delayed). Makes sense, Thanks a lot for the quick help!

Re: Unexpected threads observed before main()

2021-03-01 Thread rikki cattermole via Digitalmars-d-learn
On 01/03/2021 8:02 PM, Keivan Shah wrote: If possible, Can you also help me understand that why are the threads not despawned once the GC is done collecting in this example? There was a PR about this ages ago. But one thing to consider is that keeping threads around not doing anything

Re: Name mangling problem with tiny Windows 10 load-time DLL example

2021-03-01 Thread Siemargl via Digitalmars-d-learn
On Sunday, 28 February 2021 at 23:00:56 UTC, WhatMeWorry wrote: On Sunday, 28 February 2021 at 22:10:21 UTC, Siemargl wrote: On Sunday, 28 February 2021 at 18:29:11 UTC, WhatMeWorry wrote: It seems pretty obvious the problem is with name mangling. But how to fix it? fixing int numb = 1;

Re: tiny alternative to std library

2021-03-01 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 25 February 2021 at 22:39:11 UTC, Anthony wrote: Hello, I noticed that importing some std libraries causes the build time to jump to around 1 - 3 secs. I started creating my own helper functions to avoid importing std for scripting and prototyping in order to keep the compile