Re: VSCode plugins

2017-07-03 Thread Manu via Digitalmars-d
On 4 July 2017 at 14:59, bauss via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Tuesday, 4 July 2017 at 04:49:29 UTC, Manu wrote: > >> If authors of both plugins are active here, I ask; why have 2 separate >> > > The same reason there are multiple editors. > Errr. No. I don't think yo

Re: VSCode plugins

2017-07-03 Thread bauss via Digitalmars-d
On Tuesday, 4 July 2017 at 04:49:29 UTC, Manu wrote: If authors of both plugins are active here, I ask; why have 2 separate The same reason there are multiple editors.

VSCode plugins

2017-07-03 Thread Manu via Digitalmars-d
I've been using code-d for a while, and it generally works well. I've also noticed there's another plugin available, which at the time I first looked, appeared to be older and less-featured than code-d. I've recently had a couple of colleagues ask me which plugin to install, and I noticed that bot

Re: std.process.execute performance without Config.inheritFDs

2017-07-03 Thread bauss via Digitalmars-d
On Monday, 3 July 2017 at 20:34:00 UTC, Ali Çehreli wrote: On 07/03/2017 07:53 AM, Vladimir Panteleev wrote: > That code is pretty old. std.process was changed to use poll when > available over a year ago: > > https://github.com/dlang/phobos/pull/4114 > > Update your D installation? Jonathan is

Re: Is there a macro for code snippets introduced with "---"?

2017-07-03 Thread Sönke Ludwig via Digitalmars-d
Am 04.07.2017 um 01:17 schrieb Andrei Alexandrescu: Trying to to this: file.dd This will be highlighted: --- int i; --- This should also be but it isn't: $(MYMACRO int j; ) Macros: MYMACRO = Code begins --- $0 --- Code ends file.dd ends The expansion doesn'

Re: Go 1.9

2017-07-03 Thread jmh530 via Digitalmars-d
On Friday, 30 June 2017 at 20:36:47 UTC, bachmeier wrote: On Tuesday, 27 June 2017 at 02:40:37 UTC, jmh530 wrote: On Tuesday, 27 June 2017 at 02:38:31 UTC, bachmeier wrote: I'll post here after updating and testing the embedr package. Great. I'll give it a go again when it's ready. An upda

Re: Is there a macro for code snippets introduced with "---"?

2017-07-03 Thread Andrei Alexandrescu via Digitalmars-d
On 7/3/17 7:19 PM, Vladimir Panteleev wrote: On Monday, 3 July 2017 at 23:17:02 UTC, Andrei Alexandrescu wrote: Is there a macro equivalent for "---"? D_CODE ? That renders the code in constant-width font, but it's not colorized. -- Andrei

Re: pragma(msg) now being innovated into C++

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 3 July 2017 at 20:34:14 UTC, Walter Bright wrote: https://www.reddit.com/r/cpp/comments/6ky6oc/i_created_a_c_static_print_statement_it_allows/ Good things from D keep finding their way into C++. Unfortunately, it pretty much always looks worse there.

Re: can't used dynamic shared libraries compiled with -defaultlib=libphobos2.so

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 3 July 2017 at 21:43:07 UTC, Timothee Cour wrote: How would I use a dynamic shared libraries compiled with -defaultlib=libphobos2.so? Is that supported? I'm running into https://issues.dlang.org/show_bug.cgi?id=17591 Works for me using dmd v2.074.1 on 64bit Linux. What exactly are

Re: how to disable all default N-argument constructors for a struct?

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 4 July 2017 at 01:02:16 UTC, Era Scarecrow wrote: As soon as a class defines at least one constructor, the implicit default constructor is not avaliable anymore. - TDPL pg. 182 This is also true for structs, but one can't infer that from a rule about classes.

Re: how to disable all default N-argument constructors for a struct?

2017-07-03 Thread Moritz Maxeiner via Digitalmars-d
On Tuesday, 4 July 2017 at 00:46:36 UTC, Timothee Cour wrote: How would I disable the following? ``` auto a1=A(1); auto a2=A(1, "b"); Disable the struct's default constructor, which implicitly disables struct literals for it [1]. --- struct A { int a; string b; @disable this();

Re: how to disable all default N-argument constructors for a struct?

2017-07-03 Thread Era Scarecrow via Digitalmars-d
On Tuesday, 4 July 2017 at 00:46:36 UTC, Timothee Cour wrote: How would I disable the following? ``` auto a1=A(1); auto a2=A(1, "b"); struct A{ int a; string b; // @disable default constructors with N(N>=1) arguments } ``` I'd like to force the user to set fields explicitly, so as to ma

Re: how to disable all default N-argument constructors for a struct?

2017-07-03 Thread Stefan Koch via Digitalmars-d
On Tuesday, 4 July 2017 at 00:46:36 UTC, Timothee Cour wrote: How would I disable the following? ``` auto a1=A(1); auto a2=A(1, "b"); struct A{ int a; string b; // @disable default constructors with N(N>=1) arguments } ``` I'd like to force the user to set fields explicitly, so as to ma

how to disable all default N-argument constructors for a struct?

2017-07-03 Thread Timothee Cour via Digitalmars-d
How would I disable the following? ``` auto a1=A(1); auto a2=A(1, "b"); struct A{ int a; string b; // @disable default constructors with N(N>=1) arguments } ``` I'd like to force the user to set fields explicitly, so as to make it more safe to add / move fields

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread H. S. Teoh via Digitalmars-d
On Mon, Jul 03, 2017 at 11:49:56AM -0700, Walter Bright via Digitalmars-d wrote: [...] > Keep in mind that today's optimizers are pretty much tuned to what > works for C++. While D's particular semantics offer opportunities for > optimizations, they are currently pretty much unexploited. So what s

Re: Is there a macro for code snippets introduced with "---"?

2017-07-03 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 3 July 2017 at 23:17:02 UTC, Andrei Alexandrescu wrote: Is there a macro equivalent for "---"? D_CODE ?

Is there a macro for code snippets introduced with "---"?

2017-07-03 Thread Andrei Alexandrescu via Digitalmars-d
Trying to to this: file.dd This will be highlighted: --- int i; --- This should also be but it isn't: $(MYMACRO int j; ) Macros: MYMACRO = Code begins --- $0 --- Code ends file.dd ends The expansion doesn't result in highlighted code. Is there a macro equiv

can't used dynamic shared libraries compiled with -defaultlib=libphobos2.so

2017-07-03 Thread Timothee Cour via Digitalmars-d
How would I use a dynamic shared libraries compiled with -defaultlib=libphobos2.so? Is that supported? I'm running into https://issues.dlang.org/show_bug.cgi?id=17591

Re: CTFE Status 2

2017-07-03 Thread Stefan Koch via Digitalmars-d
On Monday, 3 July 2017 at 06:15:44 UTC, Stefan Koch wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] This code works now as well ;) int maxFloat() { float prev = 1; foreach(int i; 0 .. int.max) { if (i == prev++) return i; } return int.max;

pragma(msg) now being innovated into C++

2017-07-03 Thread Walter Bright via Digitalmars-d
https://www.reddit.com/r/cpp/comments/6ky6oc/i_created_a_c_static_print_statement_it_allows/

Re: std.process.execute performance without Config.inheritFDs

2017-07-03 Thread Ali Çehreli via Digitalmars-d
On 07/03/2017 07:53 AM, Vladimir Panteleev wrote: > That code is pretty old. std.process was changed to use poll when > available over a year ago: > > https://github.com/dlang/phobos/pull/4114 > > Update your D installation? Jonathan is hailing from Weka. :) As evidenced from Johan's recent mes

Re: Checked vs unchecked exceptions

2017-07-03 Thread Crayo List via Digitalmars-d
On Thursday, 29 June 2017 at 21:06:12 UTC, Ola Fosheim Grøstad wrote: On Thursday, 29 June 2017 at 19:34:22 UTC, Crayo List wrote: Checked exceptions are a horrible idea because they leak internal implementation details as part of the signature of a method directly and in a transitive manner, w

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Nick Treleaven via Digitalmars-d
On Monday, 3 July 2017 at 15:48:26 UTC, Petar Kirov [ZombineDev] wrote: but can you explain exactly what part of Rust's type system provides extra benefits in terms of optimization over D's type system? In safe Rust, a reference to mutable data has to be unique [1]. So the optimizer could ass

Re: What are the unused but useful feature you know in D?

2017-07-03 Thread solidstate1991 via Digitalmars-d
On Sunday, 25 June 2017 at 23:21:25 UTC, aberba wrote: Can you share feature(s) in D people are not talking about which you've found very useful? If you need to write a lightweight library or app with no GC and Phobos, you can fall back to C functions in core.stdc, my wavefile codec/utility (

asm.dlang.org and relocations

2017-07-03 Thread Johan Engelen via Digitalmars-d
This code: ``` void fun() { auto a = new int; } ``` results in this assembly output on asm.dlang.org: ``` void example.fun(): push rbp movrbp,rsp subrsp,0x10 movedi,0x0 call 12 movQWORD PTR [rbp-0x8],rax leave ret ``` It'd help a lot if relocation entries are als

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Walter Bright via Digitalmars-d
On 7/3/2017 8:48 AM, Petar Kirov [ZombineDev] wrote: Unlike C++, in D objects can't be shared across threads, unless they are marked as `shared` (modulo un-`@safe` code - like casts and `__gshared` - and compiler bugs). I.e. non-`shared` objects can't be mutated by more than one thread. Combine

Error in spec: struct init with member names

2017-07-03 Thread Johan Engelen via Digitalmars-d
The spec (or DMD frontend) is broken regarding struct initialization with explicit mention of member field names: https://dlang.org/spec/struct.html#static_struct_init The spec says: "The static initializer syntax can also be used to initialize non-static variables, provided that the member nam

Re: Let's talk about deprecations

2017-07-03 Thread bachmeier via Digitalmars-d
On Monday, 3 July 2017 at 16:51:47 UTC, Cym13 wrote: I don't get it: how is linking old and unmaintained code "fixing" anything? Dead code is dead, if it's been two years already let it die and fix your own, anything else can't be future-proof. I don't understand your comment. I'm suggesting

Re: Let's talk about deprecations

2017-07-03 Thread Seb via Digitalmars-d
On Monday, 3 July 2017 at 16:47:35 UTC, Iain Buclaw wrote: Can we tag compiler versions in dub? I think you have such a construct in npm... Found it, https://docs.npmjs.com/files/package.json#engines Yeah - compiler, os, and cpu all seem like something that should be made available in the du

Re: Building phobos with wine fails

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, July 03, 2017 19:57:35 Shachar Shemesh via Digitalmars-d wrote: > On 03/07/17 16:59, Jonathan M Davis via Digitalmars-d wrote: > > 1. The functions for converting to and from a timezone take a struct > > containing information about what that timezone is - including the DST > > switches.

Re: Building phobos with wine fails

2017-07-03 Thread Shachar Shemesh via Digitalmars-d
On 03/07/17 16:59, Jonathan M Davis via Digitalmars-d wrote: 1. The functions for converting to and from a timezone take a struct containing information about what that timezone is - including the DST switches. The way that MS did that orginally involved specifying something like the nth instanc

Re: Let's talk about deprecations

2017-07-03 Thread Cym13 via Digitalmars-d
On Monday, 3 July 2017 at 16:08:43 UTC, bachmeier wrote: On Monday, 3 July 2017 at 13:14:02 UTC, Jonathan M Davis wrote: So, in general, I think that it's a big mistake to keep deprecated stuff along on a permanent or semi-permanent basis. Keeping it around for about two years like we do now i

Re: Let's talk about deprecations

2017-07-03 Thread Iain Buclaw via Digitalmars-d
On 3 July 2017 at 01:48, Nicholas Wilson via Digitalmars-d wrote: > On Sunday, 2 July 2017 at 23:27:26 UTC, Seb wrote: >> >> Proposals >> - >> >> I think we should learn from the past. Here are a couple of ideas: >> >> 1) Stop making such a fuzz about having a long deprecation period. Most

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread ag0aep6g via Digitalmars-d
On 07/03/2017 04:01 PM, Jonathan M Davis via Digitalmars-d wrote: Fortunately, it looks like your assertion that shared may stand for inout is wrong, because this code fails to compile: class C { } inout(C) foo(inout(C) c) { return c; } void main() { shared a = new C; auto b = f

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread deadalnix via Digitalmars-d
On Saturday, 1 July 2017 at 21:47:20 UTC, Andrei Alexandrescu wrote: Walter looked at http://erdani.com/conversions.svg and said actually "const inout" and "const inout shared" should not exist as distinct qualifier groups, leading to the simplified qualifier hierarcy in http://erdani.com/conv

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 3 July 2017 at 15:48:26 UTC, Petar Kirov [ZombineDev] wrote: Unlike C++, in D objects can't be shared across threads, unless they are marked as `shared` (modulo un-`@safe` code - like I understand the intent, but since everything is "shared" in C++, unless you annotate variables wit

Re: Let's talk about deprecations

2017-07-03 Thread bachmeier via Digitalmars-d
On Monday, 3 July 2017 at 13:14:02 UTC, Jonathan M Davis wrote: So, in general, I think that it's a big mistake to keep deprecated stuff along on a permanent or semi-permanent basis. Keeping it around for about two years like we do now is already quite a long time in that regard. As long as th

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread via Digitalmars-d
On Monday, 3 July 2017 at 07:22:08 UTC, Ola Fosheim Grøstad wrote: On Monday, 3 July 2017 at 01:15:47 UTC, Walter Bright wrote: D const is different in that the compiler is allowed to generate code as if const was never cast to immutable. Such casts are also not allowed in @safe code. You pro

Re: std.process.execute performance without Config.inheritFDs

2017-07-03 Thread Vladimir Panteleev via Digitalmars-d
On Monday, 3 July 2017 at 14:48:38 UTC, Jonathan Shamir wrote: if (!(config & Config.inheritFDs)) { import core.sys.posix.sys.resource; rlimit r; getrlimit(RLIMIT_NOFILE, &r); foreach (i; 3 .. cast(int) r.rlim_cur) close(i);

std.process.execute performance without Config.inheritFDs

2017-07-03 Thread Jonathan Shamir via Digitalmars-d
Hey, This code is from std.process: if (!(config & Config.inheritFDs)) { import core.sys.posix.sys.resource; rlimit r; getrlimit(RLIMIT_NOFILE, &r); foreach (i; 3 .. cast(int) r.rlim_cur) close(i); } This is a close-loop to

Re: Phobos PR in need of review/merge

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Sunday, July 02, 2017 00:04:40 H. S. Teoh via Digitalmars-d wrote: > On Sun, Jul 02, 2017 at 01:56:22AM +, Jack Stouffer via Digitalmars-d wrote: > > On Tuesday, 27 June 2017 at 01:35:31 UTC, Meta wrote: > > > On this topic, I feel like we've been falling behind lately in > > > responding t

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Sunday, July 02, 2017 01:16:13 ag0aep6g via Digitalmars-d wrote: > On 07/01/2017 11:47 PM, Andrei Alexandrescu wrote: > > Walter looked at http://erdani.com/conversions.svg and said actually > > "const inout" and "const inout shared" should not exist as distinct > > qualifier groups, leading to

Re: Building phobos with wine fails

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, July 03, 2017 15:43:57 Shachar Shemesh via Digitalmars-d wrote: > On 03/07/17 15:35, Jonathan M Davis via Digitalmars-d wrote: > > Well, that looks bad, and it really should be working better than that, > > but I would point out that (at least, the last time I checked), wine > > does not

Re: Let's talk about deprecations

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, July 03, 2017 13:04:46 bachmeier via Digitalmars-d wrote: > On Monday, 3 July 2017 at 11:30:14 UTC, Jonathan M Davis wrote: > > Ultimately, the way that folks find out about needing to change > > their code is compiling it and seeing the deprecation messages > > - or getting compilation

Re: Let's talk about deprecations

2017-07-03 Thread bachmeier via Digitalmars-d
On Monday, 3 July 2017 at 11:30:14 UTC, Jonathan M Davis wrote: Ultimately, the way that folks find out about needing to change their code is compiling it and seeing the deprecation messages - or getting compilation errors if they wait too long, but that's a _lot_ more of a pain to deal with t

Re: Checked vs unchecked exceptions

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, June 28, 2017 21:47:56 Nick Sabalausky via Digitalmars-d wrote: > On 06/25/2017 01:38 PM, mckoder wrote: > > I am disappointed that D doesn't have checked exceptions. > > Huh? Is it April 1st? That was kind of my reaction. It has been my impression that while many folks initially s

Re: What are your hopes for the future D GC

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Friday, June 30, 2017 20:58:56 Dmitry Olshansky via Digitalmars-d wrote: > On 6/30/2017 7:54 PM, H. S. Teoh via Digitalmars-d wrote: > > On Fri, Jun 30, 2017 at 09:14:41AM +0300, Dmitry Olshansky via Digitalmars-d wrote: > >> On 6/29/2017 10:19 PM, Random D user wrote: > >>> I just got curious,

Re: Building phobos with wine fails

2017-07-03 Thread Shachar Shemesh via Digitalmars-d
On 03/07/17 15:35, Jonathan M Davis via Digitalmars-d wrote: Well, that looks bad, and it really should be working better than that, but I would point out that (at least, the last time I checked), wine does not behave correctly with regards to some of the date/time stuff, so some of the std.datet

Re: Building phobos with wine fails

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Saturday, July 01, 2017 17:09:47 Andrei Alexandrescu via Digitalmars-d wrote: > I've followed the instructions at > https://wiki.dlang.org/Building_under_Posix to build posix on Win32 > using wine (awesome possum!). It works great for building dmd and then > druntime. However when I try to buil

Re: Let's talk about deprecations

2017-07-03 Thread Jonathan M Davis via Digitalmars-d
On Sunday, July 02, 2017 23:27:26 Seb via Digitalmars-d wrote: > Hi all, > > I think we need to talk about deprecations. > A recent example on [Phobos][#5532] uncovered an ugly truth: many > people don't seem care about deprecation warnings. > > #5532 wanted to remove the symbols scheduled for depr

Re: Master thesis

2017-07-03 Thread Ecstatic Coder via Digitalmars-d
Maybe changing the application domain could give you a better dissertation axis for your thesis. For instance comparing the architecture and implementation details of the same game server application implemented in languages like C++, Rust, D, Go, Java, etc. As any web-related application, a

Re: What are the unused but useful feature you know in D?

2017-07-03 Thread Nicholas Wilson via Digitalmars-d
On Tuesday, 27 June 2017 at 03:14:58 UTC, Nicholas Wilson wrote: On Tuesday, 27 June 2017 at 02:19:56 UTC, Nicholas Wilson wrote: I think I'll write a DIP for this after my honours thesis. Initial draft https://github.com/thewilsonator/DIPs/blob/Attributes/DIPs/DIP_attributes.md Don't

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Ola Fosheim Grøstad via Digitalmars-d
I also think it would be a good idea for the D crowd to be specific when they compare to C++ const, which should be compared to D's shared version of const and not to the local variety. C/C++ compilers provide other means to provide the optimizer with information about actual mutation/aliasing

Re: My simple implementation of PHP strip_tags()

2017-07-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 29 June 2017 at 05:30:28 UTC, Patrick Schluter wrote: Ouch, parsing html or xml with regular expressions is problematic. What people generally don't realize is that the > is not required to be encoded as entity when in the data. This means that or > are absolutely legal. Regular e

Re: Why do "const inout" and "const inout shared" exist?

2017-07-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 3 July 2017 at 01:15:47 UTC, Walter Bright wrote: D const is different in that the compiler is allowed to generate code as if const was never cast to immutable. Such casts are also not allowed in @safe code. You probably meant mutable, but how does that bring any advantages if any