Re: Compile without generating code

2017-07-06 Thread Lewis via Digitalmars-d
On Wednesday, 5 July 2017 at 22:05:53 UTC, Stefan Koch wrote: On Wednesday, 5 July 2017 at 21:58:45 UTC, Lewis wrote: I was reading https://blog.rust-lang.org/2017/07/05/Rust-Roadmap-Update.html, which mentioned that the Rust compiler now has a mode to go through the motions of compiling and sho

Re: auto*

2017-07-06 Thread Patrick Schluter via Digitalmars-d
On Thursday, 6 July 2017 at 23:50:24 UTC, bauss wrote: On Thursday, 6 July 2017 at 23:12:03 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 10:31:10PM +, Meta via Digitalmars-d wrote: On Thursday, 6 July 2017 at 21:58:45 UTC, H. S. Teoh wrote: > On Thu, Jul 06, 2017 at 09:42:22PM +, Meta

Re: auto*

2017-07-06 Thread Patrick Schluter via Digitalmars-d
On Thursday, 6 July 2017 at 20:24:24 UTC, FoxyBrown wrote: On Thursday, 6 July 2017 at 18:11:13 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 06:10:57PM +, FoxyBrown via Digitalmars-d wrote: Create an auto pointer, handy in some cases and fits in the language as a natural generalization.

Re: Webassembly?

2017-07-06 Thread Jakob Bornecrantz via Digitalmars-d
On Thursday, 6 July 2017 at 22:58:36 UTC, Ola Fosheim Grostad wrote: On Thursday, 6 July 2017 at 18:26:18 UTC, Joakim wrote: so you can seamlessly pass objects to javascript. I believe people have written their own GCs that target webasm, so the D GC can likely be made to do the same. You wo

Re: auto*

2017-07-06 Thread Meta via Digitalmars-d
On Friday, 7 July 2017 at 00:58:57 UTC, jmh530 wrote: On Friday, 7 July 2017 at 00:39:32 UTC, Meta wrote: (https://github.com/dlang/dmd/pull/3615) Of course this could also get confusing pretty fast. I wish we at least had the `int[$]` syntax but it's not a huge loss. Thanks for posting th

Re: auto*

2017-07-06 Thread jmh530 via Digitalmars-d
On Friday, 7 July 2017 at 00:39:32 UTC, Meta wrote: (https://github.com/dlang/dmd/pull/3615) Of course this could also get confusing pretty fast. I wish we at least had the `int[$]` syntax but it's not a huge loss. Thanks for posting the link. Made for interesting reading. This was another

Re: auto*

2017-07-06 Thread Meta via Digitalmars-d
On Thursday, 6 July 2017 at 23:51:13 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 11:50:24PM +, bauss via Digitalmars-d wrote: [...] Let's say you have. auto a = foo(); You have no idea what auto actually is in that case, but auto* a = foo(); You know auto is a pointer of whatever foo

Re: auto*

2017-07-06 Thread bauss via Digitalmars-d
On Thursday, 6 July 2017 at 23:51:13 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 11:50:24PM +, bauss via Digitalmars-d wrote: [...] Let's say you have. auto a = foo(); You have no idea what auto actually is in that case, but auto* a = foo(); You know auto is a pointer of whatever foo

Re: auto*

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 11:50:24PM +, bauss via Digitalmars-d wrote: [...] > Let's say you have. > > auto a = foo(); > > You have no idea what auto actually is in that case, but > > auto* a = foo(); > > You know auto is a pointer of whatever foo returns. Ah, I see. So if foo() doesn't ret

Re: auto*

2017-07-06 Thread bauss via Digitalmars-d
On Thursday, 6 July 2017 at 23:12:03 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 10:31:10PM +, Meta via Digitalmars-d wrote: On Thursday, 6 July 2017 at 21:58:45 UTC, H. S. Teoh wrote: > On Thu, Jul 06, 2017 at 09:42:22PM +, Meta via > Digitalmars-d wrote: > > On Thursday, 6 July 20

Re: auto*

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 10:31:10PM +, Meta via Digitalmars-d wrote: > On Thursday, 6 July 2017 at 21:58:45 UTC, H. S. Teoh wrote: > > On Thu, Jul 06, 2017 at 09:42:22PM +, Meta via Digitalmars-d wrote: > > > On Thursday, 6 July 2017 at 18:10:57 UTC, FoxyBrown wrote: > > > > Create an auto p

Re: Webassembly?

2017-07-06 Thread Ola Fosheim Grostad via Digitalmars-d
On Thursday, 6 July 2017 at 18:26:18 UTC, Joakim wrote: so you can seamlessly pass objects to javascript. I believe people have written their own GCs that target webasm, so the D GC can likely be made to do the same. You would have to emulate the stack...

Re: auto*

2017-07-06 Thread Meta via Digitalmars-d
On Thursday, 6 July 2017 at 21:58:45 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 09:42:22PM +, Meta via Digitalmars-d wrote: On Thursday, 6 July 2017 at 18:10:57 UTC, FoxyBrown wrote: > Create an auto pointer, handy in some cases and fits in the > language as a natural generalization.

Re: auto*

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 09:42:22PM +, Meta via Digitalmars-d wrote: > On Thursday, 6 July 2017 at 18:10:57 UTC, FoxyBrown wrote: > > Create an auto pointer, handy in some cases and fits in the language > > as a natural generalization. > > It's been suggested before (as well as more powerful ge

Re: auto*

2017-07-06 Thread Meta via Digitalmars-d
On Thursday, 6 July 2017 at 18:10:57 UTC, FoxyBrown wrote: Create an auto pointer, handy in some cases and fits in the language as a natural generalization. It's been suggested before (as well as more powerful generalization for slices and associative arrays), but Andrei vetoed it so it proba

Re: Webassembly?

2017-07-06 Thread kinke via Digitalmars-d
On Thursday, 6 July 2017 at 18:26:18 UTC, Joakim wrote: On Thursday, 6 July 2017 at 17:19:34 UTC, bauss wrote: On Thursday, 6 July 2017 at 15:34:08 UTC, Wulfklaue wrote: Is there a future where we can see WebAssembly as part of D? Seeing Rusts backbone already producing wasm is impressive. We

Re: Experience with https://www.patreon.com

2017-07-06 Thread Meta via Digitalmars-d
On Thursday, 6 July 2017 at 16:00:05 UTC, Jack Stouffer wrote: On Thursday, 6 July 2017 at 13:53:08 UTC, Andrei Alexandrescu wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei It works well for supporting artists. I support many peo

Re: Experience with https://www.patreon.com

2017-07-06 Thread Brad Roberts via Digitalmars-d
On 7/6/17 6:53 AM, Andrei Alexandrescu via Digitalmars-d wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei I have experience as both. Feel free to grab me off-list to talk in more detail.

Re: Experience with https://www.patreon.com

2017-07-06 Thread Nick B via Digitalmars-d
On Thursday, 6 July 2017 at 13:53:08 UTC, Andrei Alexandrescu wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei I support someone who is a pure intellectual now, and can no longer survive in the university system, with his radical

Re: auto*

2017-07-06 Thread Ali Çehreli via Digitalmars-d
On 07/06/2017 01:24 PM, FoxyBrown wrote: > On Thursday, 6 July 2017 at 18:11:13 UTC, H. S. Teoh wrote: >> On Thu, Jul 06, 2017 at 06:10:57PM +, FoxyBrown via Digitalmars-d >> wrote: >>> Create an auto pointer, handy in some cases and fits in the language >>> as a natural generalization. >> >>

Re: auto*

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 08:24:24PM +, FoxyBrown via Digitalmars-d wrote: [...] > auto x = ... > > auto* x = ... > > auto* is the pointerized version of auto. > > > e.g., > > int x = ... > > int* x = ... > > typeof(x) y = ... > typeof(x)* y = ... > > > obviously the rhs must be congruen

Re: auto*

2017-07-06 Thread FoxyBrown via Digitalmars-d
On Thursday, 6 July 2017 at 18:11:13 UTC, H. S. Teoh wrote: On Thu, Jul 06, 2017 at 06:10:57PM +, FoxyBrown via Digitalmars-d wrote: Create an auto pointer, handy in some cases and fits in the language as a natural generalization. What's an auto pointer? T is it not obvious? auto x =

Re: gdc is in

2017-07-06 Thread Marco Leise via Digitalmars-d
Am Wed, 21 Jun 2017 15:11:39 + schrieb Joakim : > the gcc tree: > > https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html > > Congratulations to Iain and the gdc team. :) > > I found out because it's on the front page of HN right now, where > commenters are asking questions about D. I missed t

Re: Experience with https://www.patreon.com

2017-07-06 Thread Brad Anderson via Digitalmars-d
On Thursday, 6 July 2017 at 16:00:05 UTC, Jack Stouffer wrote: On Thursday, 6 July 2017 at 13:53:08 UTC, Andrei Alexandrescu wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei It works well for supporting artists. I support many peo

Re: Strange -cov bug

2017-07-06 Thread Ali Çehreli via Digitalmars-d
On 07/06/2017 10:58 AM, H. S. Teoh via Digitalmars-d wrote: Recently I discovered a strange bug in dmd -cov, that I finally got some time today to reduce to a smallish test case. However, I can't seem to get rid of the dependency on std.stdio; anybody has any idea how to reduce this code further?

Re: Webassembly?

2017-07-06 Thread Joakim via Digitalmars-d
On Thursday, 6 July 2017 at 17:19:34 UTC, bauss wrote: On Thursday, 6 July 2017 at 15:34:08 UTC, Wulfklaue wrote: Is there a future where we can see WebAssembly as part of D? Seeing Rusts backbone already producing wasm is impressive. WebAssembly currently does not support a GC ...so it fair t

Re: auto*

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 06:10:57PM +, FoxyBrown via Digitalmars-d wrote: > Create an auto pointer, handy in some cases and fits in the language > as a natural generalization. What's an auto pointer? T -- Truth, Sir, is a cow which will give [skeptics] no more milk, and so they are gone to

auto*

2017-07-06 Thread FoxyBrown via Digitalmars-d
Create an auto pointer, handy in some cases and fits in the language as a natural generalization.

Re: Webassembly?

2017-07-06 Thread Wulfklaue via Digitalmars-d
On Thursday, 6 July 2017 at 17:19:34 UTC, bauss wrote: I'm just curious how it doesn't support GC? Like if you can allocate and free memory then you can have a GC. Currently there is no native GC build into WebAssembly. This is planned for the future. If your language is designed around allo

Strange -cov bug

2017-07-06 Thread H. S. Teoh via Digitalmars-d
Recently I discovered a strange bug in dmd -cov, that I finally got some time today to reduce to a smallish test case. However, I can't seem to get rid of the dependency on std.stdio; anybody has any idea how to reduce this code further? https://issues.dlang.org/show_bug.cgi?id=17613 This

Re: Compilation times and idiomatic D code

2017-07-06 Thread John Colvin via Digitalmars-d
On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote: On Wednesday, 5 July 2017 at 20:12:40 UTC, H. S. Teoh wrote: I vaguely remember there was talk about compressing symbols when they get too long... is there any hope of seeing this realized in the near future? Yes there is. Rainer

Re: Webassembly?

2017-07-06 Thread bauss via Digitalmars-d
On Thursday, 6 July 2017 at 15:34:08 UTC, Wulfklaue wrote: Is there a future where we can see WebAssembly as part of D? Seeing Rusts backbone already producing wasm is impressive. WebAssembly currently does not support a GC ...so it fair the assume that this will be the main issue for LDC? I

Re: Compilation times and idiomatic D code

2017-07-06 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 06, 2017 at 01:32:04PM +, Atila Neves via Digitalmars-d wrote: > On Thursday, 6 July 2017 at 12:00:29 UTC, Jacob Carlborg wrote: [...] > > Yeah, it's usually all these D specific compile time features that > > is slowing down compilation. > > > > DWT and Tango are two good examples

Re: VSCode plugins

2017-07-06 Thread WebFreak001 via Digitalmars-d
On Tuesday, 4 July 2017 at 04:49:29 UTC, Manu wrote: 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 colleag

Re: DCompute development

2017-07-06 Thread Mike Parker via Digitalmars-d
On Wednesday, 5 July 2017 at 09:41:40 UTC, Nicholas Wilson wrote: @Mike Parker, what kind of things do you want me to write for the blog? Anything you can expand on beyond your DConf talk. Add a link to the talk video & slides in the introductory paragraph, touch on one or two points you t

Re: Experience with https://www.patreon.com

2017-07-06 Thread Jack Stouffer via Digitalmars-d
On Thursday, 6 July 2017 at 13:53:08 UTC, Andrei Alexandrescu wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei It works well for supporting artists. I support many people with it. However, if you're thinking of an application fo

Webassembly?

2017-07-06 Thread Wulfklaue via Digitalmars-d
Is there a future where we can see WebAssembly as part of D? Seeing Rusts backbone already producing wasm is impressive. WebAssembly currently does not support a GC ...so it fair the assume that this will be the main issue for LDC? I see the move towards one language for back and front-end as

Re: Checked vs unchecked exceptions

2017-07-06 Thread Crayo List via Digitalmars-d
On Wednesday, 5 July 2017 at 21:05:04 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 5 July 2017 at 15:48:33 UTC, Crayo List wrote: What happens to the 3000 direct and indirect calls to open() ? Notice how the 'interface' has not changed, only the implementation. No, the exception spec is par

Re: Experience with https://www.patreon.com

2017-07-06 Thread Joel Nilsson via Digitalmars-d
On Thursday, 6 July 2017 at 13:53:08 UTC, Andrei Alexandrescu wrote: Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei I support several creators on there. I think it works great.

Experience with https://www.patreon.com

2017-07-06 Thread Andrei Alexandrescu via Digitalmars-d
Does anyone have experience with https://www.patreon.com either as a patron or creator? Thanks! -- Andrei

Re: Compilation times and idiomatic D code

2017-07-06 Thread Atila Neves via Digitalmars-d
On Thursday, 6 July 2017 at 12:00:29 UTC, Jacob Carlborg wrote: On 2017-07-05 22:12, H. S. Teoh via Digitalmars-d wrote: [...] It's not UFCS per say that causes the problem. If you're using the traditional calling syntax it would generate the same symbols. [...] Yeah, it's usually all t

Re: Checked vs unchecked exceptions

2017-07-06 Thread Moritz Maxeiner via Digitalmars-d
On Thursday, 6 July 2017 at 11:01:26 UTC, Marco Leise wrote: Am Thu, 06 Jul 2017 01:31:44 + schrieb Moritz Maxeiner : But to be clear (and the title and description of any DIP addressing this should reflect this): These are not checked exceptions, because checked exceptions would require ba

Re: Compilation times and idiomatic D code

2017-07-06 Thread Jacob Carlborg via Digitalmars-d
On 2017-07-05 22:12, H. S. Teoh via Digitalmars-d wrote: Over time, what is considered "idiomatic D" has changed, and nowadays it seems to be leaning heavily towards range-based code with UFCS chains using std.algorithm and similar reusable pieces of code. It's not UFCS per say that causes the

Re: Checked vs unchecked exceptions

2017-07-06 Thread Marco Leise via Digitalmars-d
Am Thu, 06 Jul 2017 01:31:44 + schrieb Moritz Maxeiner : > But to be clear (and the title and description of any DIP > addressing this should reflect this): > These are not checked exceptions, because checked exceptions > would require bar to declare its exception set manually. Yep, absolut

Re: Checked vs unchecked exceptions

2017-07-06 Thread crimaniak via Digitalmars-d
On Thursday, 6 July 2017 at 01:31:44 UTC, Moritz Maxeiner wrote: --- void foo() throws AException throws BException { ... } vod bar() { foo(); } --- works and bar's exception is inferred by the compiler to contain AException and BException. But to be clear (and the title and description of an

Re: Vibe.d - very low performance

2017-07-06 Thread Sönke Ludwig via Digitalmars-d
Am 06.07.2017 um 09:27 schrieb Marek: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext C++, Java and Go frameworks have very high performance. Vibe.d is supposed to have similar performance, but in fact vibe.d performance is very low. Why? This is a scalability

Re: DCompute development

2017-07-06 Thread Sönke Ludwig via Digitalmars-d
Am 05.07.2017 um 11:41 schrieb Nicholas Wilson: Hi all, Now that I've (finally) finished my honours thesis, I've got time to start working on dcompute again. I'd like to invite anyone interested in helping to develop and/or document (or just interested in general) the drivers for OpenCL/CUDA,

Re: Foreach loops on static arrays error message

2017-07-06 Thread Anonymouse via Digitalmars-d
On Thursday, 6 July 2017 at 08:49:33 UTC, Stefan Koch wrote: I'd say this is not often encoutered. One should avoid using a different type then size_t for the index, as it can have negative performance implications. I thought size_t was what it lowered down to using if you used something else

Re: Foreach loops on static arrays error message

2017-07-06 Thread Andrea Fontana via Digitalmars-d
On Thursday, 6 July 2017 at 09:06:18 UTC, Guillaume Chatelet wrote: ubyte[256] data; foreach(ubyte i; 0..256) { ubyte x = data[i]; } Yes. Much better. What's the rewrite in this case? Using a size_t internally and casting to ubyte? I was just wondering

Re: Foreach loops on static arrays error message

2017-07-06 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 6 July 2017 at 09:11:44 UTC, Ola Fosheim Grøstad wrote: ubyte[256] data; if (data.length > 0) { ubyte i = 0; do { writeln(i); } while ((++i) != cast(ubyte)data.length); } Here is another version that will work ok on CPUs that can issue many instructions in para

Re: Foreach loops on static arrays error message

2017-07-06 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 6 July 2017 at 09:11:44 UTC, Ola Fosheim Grøstad wrote: ubyte[256] data; if (data.length > 0) { ubyte i = 0; do { writeln(i); } while ((++i) != cast(ubyte)data.length); } You also need to add an assert before the if to check that the last index can be represent

Re: Foreach loops on static arrays error message

2017-07-06 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: A correct lowering would be: ubyte[256] data; for(ubyte i = 0;;++i) { ubyte x = data[i]; ... if(i==255) break; } That could lead to two branches in machine language, try to think about it in terms of if and do-while

Re: Foreach loops on static arrays error message

2017-07-06 Thread Guillaume Chatelet via Digitalmars-d
On Thursday, 6 July 2017 at 09:00:47 UTC, Andrea Fontana wrote: On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: From the programmer's point of view the original code makes sense. A correct lowering would be: ubyte[256] data; for(ubyte i = 0;;++i) { ubyte x = data[i];

Re: Foreach loops on static arrays error message

2017-07-06 Thread Stefan Koch via Digitalmars-d
On Thursday, 6 July 2017 at 08:57:42 UTC, Nemanja Boric wrote: On Thursday, 6 July 2017 at 08:49:33 UTC, Stefan Koch wrote: On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: [...] I'd say this is not often encoutered. One should avoid using a different type then size_t for t

Re: Foreach loops on static arrays error message

2017-07-06 Thread Andrea Fontana via Digitalmars-d
On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: From the programmer's point of view the original code makes sense. A correct lowering would be: ubyte[256] data; for(ubyte i = 0;;++i) { ubyte x = data[i]; ... if(i==255) break; } or: ubyte[256] data; foreach(ubyte

Re: Foreach loops on static arrays error message

2017-07-06 Thread Nemanja Boric via Digitalmars-d
On Thursday, 6 July 2017 at 08:49:33 UTC, Stefan Koch wrote: On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: [...] I'd say this is not often encoutered. One should avoid using a different type then size_t for the index, as it can have negative performance implications. I

Re: Foreach loops on static arrays error message

2017-07-06 Thread Stefan Koch via Digitalmars-d
On Thursday, 6 July 2017 at 08:26:42 UTC, Guillaume Chatelet wrote: I stumbled upon https://issues.dlang.org/show_bug.cgi?id=12685 In essence: [...] `ubyte` can clearly hold a value from 0 to 255 so it should be ok. No need for 256 ?! So I decided to fix it https://github.com/dlang/dmd/pu

Foreach loops on static arrays error message

2017-07-06 Thread Guillaume Chatelet via Digitalmars-d
I stumbled upon https://issues.dlang.org/show_bug.cgi?id=12685 In essence: ubyte[256] data; foreach (ubyte i, x; data) {} Error: index type 'ubyte' cannot cover index range 0..256 `ubyte` can clearly hold a value from 0 to 255 so it should be ok. No need for 256 ?! So I decided to fix it

Vibe.d - very low performance

2017-07-06 Thread Marek via Digitalmars-d
https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext C++, Java and Go frameworks have very high performance. Vibe.d is supposed to have similar performance, but in fact vibe.d performance is very low. Why?