Re: #include C headers in D code

2018-04-13 Thread Petar via Digitalmars-d-announce
On Friday, 13 April 2018 at 10:31:43 UTC, Atila Neves wrote: On Wednesday, 11 April 2018 at 14:33:26 UTC, Jacob Carlborg wrote: On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* I don't know the

Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 13 April 2018 at 11:54:12 UTC, David Bennett wrote: Also the other idea I had was to have mixin functions that only take compiletime args (they are UFCS-able though, unlike templates) and mixin themselves when called like: --- mixin add1Xtimes(alias int a, alias int t){ uint

Re: D Library Breakage

2018-04-13 Thread Jonathan Marler via Digitalmars-d
On Friday, 13 April 2018 at 23:36:46 UTC, H. S. Teoh wrote: On Fri, Apr 13, 2018 at 11:00:20PM +, Jonathan Marler via Digitalmars-d wrote: [...] @JonathanDavis, the original post goes through an example where you won't get a compile-time or link-time error...it results in a very bad

Re: D vs nim

2018-04-13 Thread Timothee Cour via Digitalmars-d
@helxi I invite you to contribute PR's to https://github.com/timotheecour/D_vs_nim/ where I discuss feature parity and how to translate concepts from D to nim wherever it makes sense On Fri, Apr 13, 2018 at 4:12 PM, helxi via Digitalmars-d wrote: > On Friday, 10

Munich D Meetup April 2018

2018-04-13 Thread Dragos Carp via Digitalmars-d-announce
Our next gathering will be on April 18th. Stefan will introduce "Vectorflow - Netflix's Neural Network library in Action". We will also have as special guest Benoit Rostykus, the author of the library, who will call-in and take questions. Please RSVP on:

Re: Migrating an existing more modern GC to D's gc.d

2018-04-13 Thread H. S. Teoh via Digitalmars-d
On Sat, Apr 14, 2018 at 01:40:58AM +0200, Timon Gehr via Digitalmars-d wrote: > On 13.04.2018 23:40, Jonathan M Davis wrote: > > On Friday, April 13, 2018 22:36:31 Timon Gehr via Digitalmars-d wrote: > > > On 10.04.2018 10:56, Jonathan M Davis wrote: > > > > CTFE only ever happens when it must

Re: Migrating an existing more modern GC to D's gc.d

2018-04-13 Thread Timon Gehr via Digitalmars-d
On 13.04.2018 23:40, Jonathan M Davis wrote: On Friday, April 13, 2018 22:36:31 Timon Gehr via Digitalmars-d wrote: On 10.04.2018 10:56, Jonathan M Davis wrote: CTFE only ever happens when it must happen. The compiler never does it as an optimization. The frontend doesn't. The backend might.

Re: D Library Breakage

2018-04-13 Thread H. S. Teoh via Digitalmars-d
On Fri, Apr 13, 2018 at 11:00:20PM +, Jonathan Marler via Digitalmars-d wrote: [...] > @JonathanDavis, the original post goes through an example where you > won't get a compile-time or link-time error...it results in a very bad > runtime stack stomp. To put things in perspective, this is

Re: D Library Breakage

2018-04-13 Thread Steven Schveighoffer via Digitalmars-d
On 4/13/18 7:00 PM, Jonathan Marler wrote: @Steven You're just addressing the example I gave and not thinking of all the other ways version (or other compiler flags) could change things.  For example, you could have version code inside a template that changes mangling because it is no longer

Re: D vs nim

2018-04-13 Thread helxi via Digitalmars-d
On Friday, 10 April 2015 at 18:42:20 UTC, Timothee Cour wrote: Nim looks very promising. Is there any comprehensive comparison against D somewhere (if possible recent) ? Nim is way more expressive than D afaik. Consider the following imaginary function: proc fn[A : int | float; N; B :

Re: D Library Breakage

2018-04-13 Thread Jonathan Marler via Digitalmars-d
On Friday, 13 April 2018 at 22:29:25 UTC, Steven Schveighoffer wrote: On 4/13/18 5:57 PM, Jonathan M Davis wrote: On Friday, April 13, 2018 16:15:21 Steven Schveighoffer via Digitalmars-d I don't know if the compiler can determine if a version statement affects the layout, I suppose it

Re: Passing directory as compiler argument not finding file

2018-04-13 Thread Cym13 via Digitalmars-d-learn
On Friday, 13 April 2018 at 13:39:23 UTC, Tony wrote: On Friday, 13 April 2018 at 12:46:32 UTC, Cym13 wrote: On Friday, 13 April 2018 at 01:27:06 UTC, Tony wrote: I think that the typical model (at least in other languages) is to only compile one D source file at a time. Compile the b.d file

Re: D Library Breakage

2018-04-13 Thread Steven Schveighoffer via Digitalmars-d
On 4/13/18 5:57 PM, Jonathan M Davis wrote: On Friday, April 13, 2018 16:15:21 Steven Schveighoffer via Digitalmars-d I don't know if the compiler can determine if a version statement affects the layout, I suppose it could, but it would have to compile both with and without the version to

[Issue 18758] RVO ignores asm writing to return value

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18758 Ketmar Dark changed: What|Removed |Added CC|

Re: D Library Breakage

2018-04-13 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 13, 2018 16:15:21 Steven Schveighoffer via Digitalmars-d wrote: > On 4/13/18 3:47 PM, Jesse Phillips wrote: > > On Friday, 13 April 2018 at 18:04:38 UTC, Jonathan Marler wrote: > >> Error: symbol "__module_config_foo" needed by main.o is not defined > >> > >> The linker error

Re: Migrating an existing more modern GC to D's gc.d

2018-04-13 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 13, 2018 22:36:31 Timon Gehr via Digitalmars-d wrote: > On 10.04.2018 10:56, Jonathan M Davis wrote: > > CTFE only ever happens when it must happen. The compiler never does it > > as an optimization. > > The frontend doesn't. The backend might. The optimizer may do constant

Re: Why is the error message coming by the end of the compilation?

2018-04-13 Thread Ikeran via Digitalmars-d-learn
On Friday, 13 April 2018 at 20:50:38 UTC, bauss wrote: What I'm doing is basically this: static foreach (viewResult; generateViewsResult) { pragma(msg, "Compiling: " ~ viewResult.name); mixin(viewResult.source); pragma(msg, "Compiled: " ~ viewResult.name); } I

Re: Why is the error message coming by the end of the compilation?

2018-04-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/13/18 4:50 PM, bauss wrote: I can't seem to reproduce this with any other smaller projects, so my question is really what could trigger this behavior. See: https://i.imgur.com/OmqJ8Sr.png Whenever I try to just do this kind of thing by itself then it behaves correctly. Ex: (As you can

Why is the error message coming by the end of the compilation?

2018-04-13 Thread bauss via Digitalmars-d-learn
I can't seem to reproduce this with any other smaller projects, so my question is really what could trigger this behavior. See: https://i.imgur.com/OmqJ8Sr.png Whenever I try to just do this kind of thing by itself then it behaves correctly. Ex: (As you can see it prints the error messages

Re: Why is the error message coming by the end of the compilation?

2018-04-13 Thread bauss via Digitalmars-d-learn
On Friday, 13 April 2018 at 20:50:38 UTC, bauss wrote: https://run.dlang.io/ Sorry posted wrong link for run.dlang.io. https://run.dlang.io/is/HQlbgv

Re: Migrating an existing more modern GC to D's gc.d

2018-04-13 Thread Timon Gehr via Digitalmars-d
On 10.04.2018 10:56, Jonathan M Davis wrote: CTFE only ever happens when it must happen. The compiler never does it as an optimization. The frontend doesn't. The backend might.

Re: D Library Breakage

2018-04-13 Thread Steven Schveighoffer via Digitalmars-d
On 4/13/18 3:47 PM, Jesse Phillips wrote: On Friday, 13 April 2018 at 18:04:38 UTC, Jonathan Marler wrote: Error: symbol "__module_config_foo" needed by main.o is not defined The linker error isn't great, but it prevents potential runtime errors.  Also, if you use the compiler instead of the

Re: D Library Breakage

2018-04-13 Thread Steven Schveighoffer via Digitalmars-d
On 4/13/18 4:15 PM, Steven Schveighoffer wrote: I don't know if the compiler can determine if a version statement affects the layout, I suppose it could, but it would have to compile both with and without the version to see. It's probably an intractable problem. Even when the layout is

Re: D Library Breakage

2018-04-13 Thread Jesse Phillips via Digitalmars-d
On Friday, 13 April 2018 at 18:04:38 UTC, Jonathan Marler wrote: Error: symbol "__module_config_foo" needed by main.o is not defined The linker error isn't great, but it prevents potential runtime errors. Also, if you use the compiler instead of the linker you'll get a nice error message.

Re: #include C headers in D code

2018-04-13 Thread Jacob Carlborg via Digitalmars-d-announce
On 2018-04-13 12:33, Atila Neves wrote: I'll have to take a look at Jacob's configure.d to find out where libclang is installed on Windows. Unfortunately the configuration script is only for Posix. -- /Jacob Carlborg

Re: D Library Breakage

2018-04-13 Thread Dmitry Olshansky via Digitalmars-d
On Friday, 13 April 2018 at 18:04:38 UTC, Jonathan Marler wrote: On Friday, 13 April 2018 at 10:47:18 UTC, Rene Zwanenburg wrote: On Friday, 13 April 2018 at 05:31:25 UTC, Jesse Phillips wrote: One thought I has was that we could define a special symbol that basically encodes the

Re: D Library Breakage

2018-04-13 Thread Jonathan Marler via Digitalmars-d
On Friday, 13 April 2018 at 10:47:18 UTC, Rene Zwanenburg wrote: On Friday, 13 April 2018 at 05:31:25 UTC, Jesse Phillips wrote: Well if DIP1000 isn't on by default I don't think Phobos should be compiled with it. I think that the version issue is not unique to D and would be good to

Re: How do you check for nonempty string?

2018-04-13 Thread user1234 via Digitalmars-d-learn
On Friday, 13 April 2018 at 17:41:00 UTC, Adam D. Ruppe wrote: On Friday, 13 April 2018 at 17:38:39 UTC, Dr.No wrote: string s = null; if(s !is null && s[0] == '/') is this correct? No, that doesn't work if the string = "a"[$..$] for example Just use if(s.length && s[0]) instead just

Re: How do you check for nonempty string?

2018-04-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 13 April 2018 at 17:38:39 UTC, Dr.No wrote: string s = null; if(s !is null && s[0] == '/') is this correct? No, that doesn't work if the string = "a"[$..$] for example Just use if(s.length && s[0]) instead

How do you check for nonempty string?

2018-04-13 Thread Dr.No via Digitalmars-d-learn
s.length > 0 or s !is null? used to C++/C#'s world I cautch myself doing something like this: if(s !is null && s.length > 0 && s[0] == '/) then a I remembered the D's way, which length is probably a function not a property (in the C++/C#'s sense, which needs this as first parameter, hence

[Issue 18760] New: theAllocator should hold a reference to the allocator that it uses

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18760 Issue ID: 18760 Summary: theAllocator should hold a reference to the allocator that it uses Product: D Version: D2 Hardware: x86_64 OS: All Status:

[Issue 18759] feature request: blocks

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18759 Simen Kjaeraas changed: What|Removed |Added CC|

Re: What Is Python Developer Salary?

2018-04-13 Thread Kagamin via Digitalmars-d
On Thursday, 12 April 2018 at 21:01:47 UTC, Arnold Blake wrote: I hired a remote developer in the language of the programming python, there was such a question as to how much should I pay him for the work? how many per hour? Estimate the project budget based on the plan and derive salary

Re: D Library Breakage

2018-04-13 Thread Jesse Phillips via Digitalmars-d
On Friday, 13 April 2018 at 10:47:18 UTC, Rene Zwanenburg wrote: On Friday, 13 April 2018 at 05:31:25 UTC, Jesse Phillips wrote: Well if DIP1000 isn't on by default I don't think Phobos should be compiled with it. I think that the version issue is not unique to D and would be good to

Re: Passing directory as compiler argument not finding file

2018-04-13 Thread Tony via Digitalmars-d-learn
On Friday, 13 April 2018 at 12:46:32 UTC, Cym13 wrote: On Friday, 13 April 2018 at 01:27:06 UTC, Tony wrote: I think that the typical model (at least in other languages) is to only compile one D source file at a time. Compile the b.d file with the -c option to create an object file. Then put

Re: Passing directory as compiler argument not finding file

2018-04-13 Thread Cym13 via Digitalmars-d-learn
On Friday, 13 April 2018 at 01:27:06 UTC, Tony wrote: I think that the typical model (at least in other languages) is to only compile one D source file at a time. Compile the b.d file with the -c option to create an object file. Then put the object file in a library file (either static

[Issue 18747] [Structs, Unions]

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18747 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/3e85ad29d5dedb0d2b2505cf82b9d01db1556aa9 Fix Issue 18747 - [Structs, Unions] example is

[Issue 18747] [Structs, Unions]

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18747 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: trouble building dlang.org

2018-04-13 Thread Seb via Digitalmars-d-learn
On Tuesday, 10 April 2018 at 15:58:10 UTC, Zach Tollen wrote: I'm trying to update the language spec. I have the standard dmd installed on my Mac in `~/dlang/dmd` using the install script from the website "curl -fsS https://dlang.org/install.sh | bash -s dmd". Okay, good, done. Actually no D

Re: What are AST Macros?

2018-04-13 Thread David Bennett via Digitalmars-d
On Friday, 6 April 2018 at 20:33:10 UTC, Chris Katko wrote: Sorry if this is "re-opening" an old thread, but did anything come from this and DIP50? It seems like a really interesting concept and this thread was one of the first results for a Google search. Thanks. Thanks for reminding me

Re: D Library Breakage

2018-04-13 Thread Rene Zwanenburg via Digitalmars-d
On Friday, 13 April 2018 at 05:31:25 UTC, Jesse Phillips wrote: Well if DIP1000 isn't on by default I don't think Phobos should be compiled with it. I think that the version issue is not unique to D and would be good to address, but I don't see the compiler reading the object file to

Re: What Is Python Developer Salary?

2018-04-13 Thread bauss via Digitalmars-d
On Friday, 13 April 2018 at 10:06:55 UTC, Cym13 wrote: On Friday, 13 April 2018 at 10:00:00 UTC, bauss wrote: On Thursday, 12 April 2018 at 21:01:47 UTC, Arnold Blake wrote: I hired a remote developer in the language of the programming python, there was such a question as to how much should I

Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce
On Wednesday, 11 April 2018 at 14:57:51 UTC, rumbu wrote: On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote: [...] Cannot manage to build it on Windows: D:\git\dpp>dub build WARNING: A deprecated branch based version specification is used for the dependency libclang. Please use

Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce
On Wednesday, 11 April 2018 at 14:26:04 UTC, Jacob Carlborg wrote: On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* BTW, you can steal the config script [1] from DStep to help detect locations of

Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce
On Wednesday, 11 April 2018 at 14:33:26 UTC, Jacob Carlborg wrote: On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote: Here's my blog post about my project that allows directly #including C headers in D* I don't know the exact details of your project but can't you just: 1. Copy the

Re: What Is Python Developer Salary?

2018-04-13 Thread Simen Kjærås via Digitalmars-d
On Friday, 13 April 2018 at 10:00:00 UTC, bauss wrote: Also who hires someone before they agree on a salary? Says right there: "Arnold Blake". -- Simen

Re: What Is Python Developer Salary?

2018-04-13 Thread Cym13 via Digitalmars-d
On Friday, 13 April 2018 at 10:00:00 UTC, bauss wrote: On Thursday, 12 April 2018 at 21:01:47 UTC, Arnold Blake wrote: I hired a remote developer in the language of the programming python, there was such a question as to how much should I pay him for the work? how many per hour? What kind of

Re: What Is Python Developer Salary?

2018-04-13 Thread bauss via Digitalmars-d
On Friday, 13 April 2018 at 10:05:12 UTC, Simen Kjærås wrote: On Friday, 13 April 2018 at 10:00:00 UTC, bauss wrote: Also who hires someone before they agree on a salary? Says right there: "Arnold Blake". -- Simen Had me chuckle

Re: What Is Python Developer Salary?

2018-04-13 Thread bauss via Digitalmars-d
On Thursday, 12 April 2018 at 21:01:47 UTC, Arnold Blake wrote: I hired a remote developer in the language of the programming python, there was such a question as to how much should I pay him for the work? how many per hour? What kind of salary do they have, are different countries interested,

[Issue 18759] New: feature request: blocks

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18759 Issue ID: 18759 Summary: feature request: blocks Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1

[Issue 18758] New: RVO ignores asm writing to return value

2018-04-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18758 Issue ID: 18758 Summary: RVO ignores asm writing to return value Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: major

Re: [OT] gdc status

2018-04-13 Thread Johannes Pfau via Digitalmars-d-announce
Am Wed, 11 Apr 2018 16:44:32 +0300 schrieb drug: > 11.04.2018 16:26, Uknown пишет: >> On Wednesday, 11 April 2018 at 13:17:23 UTC, drug wrote: >>> 11.04.2018 15:22, bachmeier пишет: On Wednesday, 11 April 2018 at 09:45:07 UTC, Jonathan M Davis wrote: ... Given that GDC has been added to

Re: Deprecating this(this)

2018-04-13 Thread Kagamin via Digitalmars-d
On Wednesday, 4 April 2018 at 10:37:57 UTC, Steven Schveighoffer wrote: Any place where an immutable can be observed to change between two reads is breaking immutable. That happens in constructor too.

Re: Deprecating this(this)

2018-04-13 Thread Kagamin via Digitalmars-d
On Wednesday, 4 April 2018 at 10:37:57 UTC, Steven Schveighoffer wrote: I would like to see more flexibility for copying. It's a tradeoff between control and ergonomics. import std.stdio; immutable(int)* p; struct S {     int x;     this(this) immutable     {     x = 42; /* First