[Issue 13646] static darray & pointer initializers always allocated in shared(global) memory rather than in TLS

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13646 Vladimir Panteleev changed: What|Removed |Added See Also|

Re: Get complete function declaration

2017-07-18 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 13:35:49 UTC, SrMordred wrote: There is a way to get the full function(or any other structure) declaration with traits? Or I will have to mount it with std.traits functions? eg. void add(int x, int y){} GetFullFunctionDeclaration!add; //return "void add(int x, int

Can't get expected strings

2017-07-18 Thread helxi via Digitalmars-d-learn
import std.stdio, std.datetime, std.conv, std.algorithm; void main() { immutable DEADLINE = DateTime(2017, 7, 16, 23, 59, 59).to!SysTime; immutable NOW = Clock.currTime; immutable INTERVAL = (DEADLINE - NOW) .abs .to!string;

[Issue 7720] asm silent wrong code generation

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=7720 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 13938] IASM shouldn't be able to access TLS variables

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13938 Vladimir Panteleev changed: What|Removed |Added CC|

[Issue 5254] Low performance code with struct constructor

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=5254 Vladimir Panteleev changed: What|Removed |Added Hardware|x86 |All

Re: DMD library available as DUB package

2017-07-18 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-07-18 14:35, Suliman wrote: Could you explain where it can be helpful? As Dukc said, for tools that need to analyze D source code. -- /Jacob Carlborg

Get complete function declaration

2017-07-18 Thread SrMordred via Digitalmars-d-learn
There is a way to get the full function(or any other structure) declaration with traits? Or I will have to mount it with std.traits functions? eg. void add(int x, int y){} GetFullFunctionDeclaration!add; //return "void add(int x, int y)"

[Issue 12930] static and the access modifiers aren't legal on the right-hand side of a function

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12930 Vladimir Panteleev changed: What|Removed |Added Keywords||spec

[Issue 13584] "not callable using argument types" despite perfect match

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13584 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 9991] Optimizer Doesn't Enregister Static Array Elements With Compile-Time Constant Index

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9991 --- Comment #5 from Vladimir Panteleev --- FWIW, after https://github.com/dlang/dmd/pull/6176 (2.073.0) the generated assembly code changed, however a simple benchmark shows that performance did not noticeably

[Issue 16512] std.allocator: Nullify the argument passed to allocator.dispose

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16512 Vladimir Panteleev changed: What|Removed |Added Component|dmd

[Issue 15297] std.stdio readf cryptic error message

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15297 Vladimir Panteleev changed: What|Removed |Added Status|NEW

[Issue 12260] Improve error of std.stdio.readf when involving whitespace

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12260 Vladimir Panteleev changed: What|Removed |Added CC|

[Issue 11500] Bringing mixed-in operators and constructors to the overload set

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11500 Vladimir Panteleev changed: What|Removed |Added Keywords|

Re: DMD library available as DUB package

2017-07-18 Thread Dukc via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 12:35:10 UTC, Suliman wrote: Could you explain where it can be helpful? For tools, such as source code formatters. They do not have to write the parsers themselves if they use a library such as this one.

Re: DMD library available as DUB package

2017-07-18 Thread Suliman via Digitalmars-d-announce
Could you explain where it can be helpful?

Re: Appending static arrays

2017-07-18 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 08:46:50 UTC, Jack Applegame wrote: On Monday, 17 July 2017 at 17:38:23 UTC, Nordlöw wrote: I'm want to define a specialization of `append()` that takes only static arrays as inputs and returns a static array being the sum of the lengths of the inputs. Have

[Issue 8204] Alias causes error: "auto can only be used for template function parameters"

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8204 --- Comment #2 from Vladimir Panteleev --- (In reply to dlang+issues from comment #0) > void foo(T)(ref auto T v) { } > alias foo!int bar; // Error: auto can only be used for template function > parameters What is

Re: proposed @noreturn attribute

2017-07-18 Thread Stefan Koch via Digitalmars-d
On Tuesday, 18 July 2017 at 12:15:06 UTC, Timon Gehr wrote: On 18.07.2017 12:17, John Colvin wrote: Better to just not define it. That's not an option. Bottom is a subtype of all types. It cannot remove members, even static ones. Timon, how important is it to actually have bottom ? ...

Re: proposed @noreturn attribute

2017-07-18 Thread Timon Gehr via Digitalmars-d
On 18.07.2017 12:17, John Colvin wrote: Better to just not define it. That's not an option. Bottom is a subtype of all types. It cannot remove members, even static ones.

Re: Appending static arrays

2017-07-18 Thread Nordlöw via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 08:07:45 UTC, Jacob Carlborg wrote: append - add array or element to existing array concat (concatenate) - add to arrays (or element) together to create a new array Seems like this is a concatenation. But please avoid shortening the names. I vote you go with

DMD library available as DUB package

2017-07-18 Thread Jacob Carlborg via Digitalmars-d-announce
During the dconf hackathon I set out to create a DUB package for DMD to be used as a library. This has finally been merged [1] and is available here [2]. It contains the lexer and the parser. A minimal example: #!/usr/bin/env dub /++ dub.sdl: name "dmd_lexer_example" dependency "dmd"

Re: How do I cast to from byte[] <-> double for making a small assembler language VM to work?

2017-07-18 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 11:06:22 UTC, Enjoys Math wrote: [ ... ] The cast at the bottom gives a compiler error (can't cast byte[] to double). If you want to see how it's done check: https://github.com/UplinkCoder/dmd/blob/newCTFE_on_master/src/ddmd/ctfe/bc.d Though if you have the choice

Re: How do I cast to from byte[] <-> double for making a small assembler language VM to work?

2017-07-18 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 11:06:22 UTC, Enjoys Math wrote: class OpCode { private: byte[] bytes_; public: void opCall(Program program) const; byte[] bytes() const { return bytes_.dup; } } class AddD : OpCode { private: uint d, s;

[Issue 17224] Foreach documentation still refers to TypeTuples, rather than AliasSequences

2017-07-18 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17224 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/c336bb96cf8a0a1b4be57c25d6ef59e3ef781b54 Issue 17224 - Remove std.typetuple from the

Re: An Issue I Wish To Raise Awareness On

2017-07-18 Thread via Digitalmars-d
On Tuesday, 18 July 2017 at 11:47:37 UTC, Petar Kirov [ZombineDev] wrote: On Monday, 17 July 2017 at 19:30:53 UTC, Jack Stouffer wrote: On Monday, 17 July 2017 at 17:41:58 UTC, Atila Neves wrote: On Monday, 17 July 2017 at 14:26:19 UTC, Jack Stouffer wrote: TL;DR: Issue 17658 [1] makes using

Re: An Issue I Wish To Raise Awareness On

2017-07-18 Thread via Digitalmars-d
On Monday, 17 July 2017 at 19:30:53 UTC, Jack Stouffer wrote: On Monday, 17 July 2017 at 17:41:58 UTC, Atila Neves wrote: On Monday, 17 July 2017 at 14:26:19 UTC, Jack Stouffer wrote: TL;DR: Issue 17658 [1] makes using shared very annoying/practically impossible. [...] I fixed this

Re: DCompute: GPGPU with Native D for OpenCL and CUDA

2017-07-18 Thread Nicholas Wilson via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 09:48:47 UTC, John Colvin wrote: On Tuesday, 18 July 2017 at 00:49:11 UTC, Nicholas Wilson wrote: Oh and @JohnColvin do you like the solution for the lambdas? I do, very nice :) You're essentially achieving what I set out to do and got stuck with, just much

How do I cast to from byte[] <-> double for making a small assembler language VM to work?

2017-07-18 Thread Enjoys Math via Digitalmars-d-learn
class OpCode { private: byte[] bytes_; public: void opCall(Program program) const; byte[] bytes() const { return bytes_.dup; } } class AddD : OpCode { private: uint d, s; public: this(uint dst, uint src) { d =

Re: proposed @noreturn attribute

2017-07-18 Thread Stefan Koch via Digitalmars-d
On Tuesday, 18 July 2017 at 10:17:17 UTC, John Colvin wrote: how do I store the type "int" in memory? new Type(TYENUM.Tint32); :o)

Re: proposed @noreturn attribute

2017-07-18 Thread John Colvin via Digitalmars-d
On Monday, 17 July 2017 at 23:01:40 UTC, Walter Bright wrote: On 7/16/2017 5:41 AM, Timon Gehr wrote: struct S{ T x; Bottom everything; } turns the entire struct into an empty type. It is therefore most natural to say that Bottom.sizeof == ∞. (It's the only choice for which S.sizeof

Re: static foreach is now in github master

2017-07-18 Thread Vladimir Panteleev via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 10:02:10 UTC, Seb wrote: And thanks to dmd-nightly, also on run.dlang.io:

Re: static foreach is now in github master

2017-07-18 Thread Seb via Digitalmars-d-announce
On Monday, 17 July 2017 at 21:27:40 UTC, Martin Nowak wrote: On Monday, 17 July 2017 at 18:14:35 UTC, Andrei Alexandrescu wrote: For those who want to play with our new static foreach feature and are willing to take the steps to building their own dmd, Or just wait for the next nightly until

Re: DCompute: GPGPU with Native D for OpenCL and CUDA

2017-07-18 Thread John Colvin via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 00:49:11 UTC, Nicholas Wilson wrote: On Monday, 17 July 2017 at 13:50:22 UTC, Mike Parker wrote: Nicholas Wilson has put together a blog post on his progress with DCompute, expanding on his DConf talk. I have to admit that this is one of the D projects I'm most

Re: New library: open multi-methods

2017-07-18 Thread Jean-Louis Leroy via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 07:06:10 UTC, Jean-Louis Leroy wrote: As for performance, I have a first result: https://github.com/jll63/methods.d/blob/master/benchmarks/source/benchmarks.d#L122 but I still have to implement the "first argument optimization". I am working on it. Now this is

Re: regex(q"<[^]>")

2017-07-18 Thread Anton Fediushin via Digitalmars-d
On Monday, 17 July 2017 at 17:00:10 UTC, unDEFER wrote: Hello! The code in the header leads to assertion! But the user inputed data don't must leads to any assertions! This regular expression is invalid. [bar] - Matches 'b' or 'a' or 'r' [^bar] - Matches everything but 'b' or 'a' or 'r'. So,

Re: Appending static arrays

2017-07-18 Thread Jack Applegame via Digitalmars-d-learn
On Monday, 17 July 2017 at 17:38:23 UTC, Nordlöw wrote: I'm want to define a specialization of `append()` that takes only static arrays as inputs and returns a static array being the sum of the lengths of the inputs. Have anybody already implemented this? If not, I'm specifically interested

Re: Idiomatic way of writing nested loops?

2017-07-18 Thread Anton Fediushin via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 03:36:04 UTC, Nicholas Wilson wrote: With regards to parallel, only use it on the outermost loop. Assuming you have more items in the outermost loop than you do threads parallelising more than one loop won't net you any speed. Thank you! Yes, `parallel` runs only

Re: Compilation times and idiomatic D code

2017-07-18 Thread Olivier FAURE via Digitalmars-d
On Monday, 17 July 2017 at 18:42:36 UTC, H. S. Teoh wrote: Besides the symbol problem though, does the template instantiation explosion problem imply as many duplicated function bodies corresponding to the new type symbols? That's a different, though somewhat related, issue. I have some

Re: proposed @noreturn attribute

2017-07-18 Thread Olivier FAURE via Digitalmars-d
On Monday, 17 July 2017 at 18:10:27 UTC, Andrei Alexandrescu wrote: On 7/17/17 11:39 AM, Olivier FAURE wrote: I'd really prefer if you avoided the whole `typeof(assert(0))` thing. First off, it's way too verbose for a simple concept. Noted, thanks. I won't debate this much but for now I

Re: Appending static arrays

2017-07-18 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-17 22:11, Nordlöw wrote: - under what name: append, concat or cat? append - add array or element to existing array concat (concatenate) - add to arrays (or element) together to create a new array Seems like this is a concatenation. But please avoid shortening the names. I vote

Re: How to init immutable static array?

2017-07-18 Thread Miguel L via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 07:31:22 UTC, Era Scarecrow wrote: On Tuesday, 18 July 2017 at 07:30:30 UTC, Era Scarecrow wrote: my_array[i]=some calculations(based on constants and n) i meant: tmp[i]=some calculations(based on constants and n) That does work, thanks.

Re: How to init immutable static array?

2017-07-18 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 07:30:30 UTC, Era Scarecrow wrote: my_array[i]=some calculations(based on constants and n) i meant: tmp[i]=some calculations(based on constants and n)

Re: How to init immutable static array?

2017-07-18 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 18 July 2017 at 07:20:48 UTC, Miguel L wrote: Hi, I need help again. I have an immutable static array and i need to initialize its contents inside a for loop. Something like this: void f(int n)() { immutable float[n] my_array; for(int i=0;i

How to init immutable static array?

2017-07-18 Thread Miguel L via Digitalmars-d-learn
Hi, I need help again. I have an immutable static array and i need to initialize its contents inside a for loop. Something like this: void f(int n)() { immutable float[n] my_array; for(int i=0;i

Re: New library: open multi-methods

2017-07-18 Thread Jean-Louis Leroy via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 04:26:42 UTC, Ali Çehreli wrote: On 07/16/2017 10:24 AM, Jean-Louis Leroy wrote: > TL;DR: see here https://github.com/jll63/methods.d/blob/master/README.md Woot! :) I'm so happy to see this project complete. Honestly, growing up with languages without this feature

Re: New library: open multi-methods

2017-07-18 Thread Jean-Louis Leroy via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 02:22:15 UTC, Jay Norwood wrote: An excerpt statement from this wiki page is : " dynamically dispatched based on the run-time (dynamic) type or, in the more general case some other attribute, of more than one of its arguments" Based on the 'some other

Re: static foreach is now in github master

2017-07-18 Thread Daniel N via Digitalmars-d-announce
On Tuesday, 18 July 2017 at 06:48:29 UTC, Jacob Carlborg wrote: On 2017-07-17 20:14, Andrei Alexandrescu wrote: For those who want to play with our new static foreach feature and are willing to take the steps to building their own dmd, the feature is now merged in master:

Re: DIP 1010--Static foreach--Accepted

2017-07-18 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-07-17 14:39, Steven Schveighoffer wrote: Awesome! Super glad and looking forward to this in 2.076? ;) It's already merged [1] so..., why not :) [1] http://forum.dlang.org/post/okiuqb$1eti$1...@digitalmars.com -- /Jacob Carlborg

Re: static foreach is now in github master

2017-07-18 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-07-17 20:14, Andrei Alexandrescu wrote: For those who want to play with our new static foreach feature and are willing to take the steps to building their own dmd, the feature is now merged in master: https://github.com/dlang/dmd/pull/6760 Happy hacking! That was quick, and awesome

<    1   2