Re: Phobos Action Items

2016-06-19 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 19 June 2016 at 09:50:42 UTC, John Colvin wrote: On Sunday, 19 June 2016 at 01:01:30 UTC, Nicholas Wilson wrote: On Saturday, 18 June 2016 at 20:04:50 UTC, Walter Bright wrote: [...] Now that I'm on my (southern hemisphere) winter break I will be working on getting LDC to emit

Re: GPGPU work and Identifiers

2016-06-19 Thread Jakob Bornecrantz via Digitalmars-d
On Sunday, 19 June 2016 at 11:12:50 UTC, Nicholas Wilson wrote: This thread is partly to announce that i will be adding to LDC the ability to generate code for GPUs through OpenCL, CUDA (and if i have time) Metal in my fork at https://github.com/thewilsonator/ldc and partly to request the

std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Seb via Digitalmars-d
Optimizing for performance is one of the major challenges for Phobos and user libraries in the next month and years. As an example of the benefits, have a look at the recent blog post about find [1]. Robert burner Schadek has proposed std.experimental.randomized_unittest_benchmark over a

Re: Dub generate visuald, multiple configurations?

2016-06-19 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 17 June 2016 at 08:49:47 UTC, Tofu Ninja wrote: Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to generate a separate project for each configuration? I am

[Issue 16184] New: allocator.dispose allows to dispose C++ interfaces

2016-06-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16184 Issue ID: 16184 Summary: allocator.dispose allows to dispose C++ interfaces Product: D Version: D2 Hardware: All OS: All Status: ASSIGNED Severity: normal

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread Dicebot via Digitalmars-d
This important feature and can't be simply removed. For example, std.experimental.logger also relies on it. It needs to be fixed instead. Two immediate workarounds that come to mmy mind: 1. Make __FILE__ relative to import path 2. Always emit new symbol to object file if __FILE__ is involved

Re: Templated class defaults and inheritence

2016-06-19 Thread Rene Zwanenburg via Digitalmars-d-learn
On Saturday, 18 June 2016 at 17:48:47 UTC, Joerg Joergonson wrote: class foo(T) if (is(T : subfoo)) X; FYI this can also be done in the template parameter list: class foo(T : subfoo){}

Re: Possible bug in std.path?

2016-06-19 Thread Hugo via Digitalmars-d
On Sunday, 19 June 2016 at 14:29:27 UTC, ag0aep6g wrote: [...] auto wargs = CommandLineToArgvW(GetCommandLineW(), ); You're calling Windows' CommandLineToArgvW here. I don't think that's what Adam meant by "process it yourself". If you don't like how CommandLineToArgvW parses the

Re: Weird compiler

2016-06-19 Thread mogu via Digitalmars-d
On Sunday, 19 June 2016 at 15:00:07 UTC, Rene Zwanenburg wrote: Don't underestimate the value of fast compilation, it's incredibly useful while writing code. Sorry for my tone. After waste so much time, I've been a little mad. :( In fact, I'm an advocator of meta-programming.

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:10:54 UTC, Jonathan M Davis wrote: On Saturday, June 18, 2016 21:55:31 Joerg Joergonson via Digitalmars-d-learn wrote: I wanted to switch to std.container.Array but it doesn't seem to mimic [] for some odd ball reason. D's dynamic arrays are really quite weird in

Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 15:35:04 UTC, moe wrote: I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to use a .lib file in an app. However, I can not use a module

[Issue 15341] segfault with std.signals slots

2016-06-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15341 hba...@hotmail.com changed: What|Removed |Added CC||hba...@hotmail.com --- Comment #1 from

Re: Possible bug in std.path?

2016-06-19 Thread ag0aep6g via Digitalmars-d
On 06/19/2016 05:36 PM, Hugo wrote: I thought the proper way to call GetCommandLineW was precisely through CommandLineToArgvW, now I am lost. It may be the proper way, but you don't want the proper way then. I don't know if there's a Windows function for the behavior you want. If there

Re: Weird compiler

2016-06-19 Thread Rene Zwanenburg via Digitalmars-d
On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: Today, I'm working on a private GUI tool which must be run at linux and windows. It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a

D-Man culture

2016-06-19 Thread Seb via Digitalmars-d-announce
Hi, I am not sure how much you have heard about the D-Man, but in Japan there is an entire culture based on the D-Man! As I learned about this by accident (and even Walter didn't know about it), I thought I share this great movement with the DLang community! Here are some awesome impressions

Re: Weird compiler

2016-06-19 Thread Rene Zwanenburg via Digitalmars-d
On Sunday, 19 June 2016 at 14:45:29 UTC, mogu wrote: Moreover, I wonder if D is really a cross-platform programming language?! The official dmd only supports x86 structure. You can never build a project with third party static library in windows independently. Back when DMD on windows

Re: Phobos Action Items

2016-06-19 Thread Dicebot via Digitalmars-d
On Sunday, 19 June 2016 at 13:32:02 UTC, jmh530 wrote: On Sunday, 19 June 2016 at 06:19:34 UTC, Dicebot wrote: Which is inherently suboptimal and is a part of Go marketing bullshit not worth spending time on. It also requires heavy runtime modifications (because TLS) unless one wants to

Re: Button: A fast, correct, and elegantly simple build system.

2016-06-19 Thread Dicebot via Digitalmars-d-announce
On Saturday, 18 June 2016 at 08:05:18 UTC, Jason White wrote: I realize you might be playing devil's advocate a bit and I appreciate it. Yeah, I personally quite like how Button looks and would totally consider it, probably with some tweaks of own taste. But not for most public projects for

Re: Weird compiler

2016-06-19 Thread mogu via Digitalmars-d
On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote: On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a linker. It's

Re: Weird compiler

2016-06-19 Thread Patrick Schluter via Digitalmars-d
On Sunday, 19 June 2016 at 14:45:43 UTC, Rene Zwanenburg wrote: On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: Today, I'm working on a private GUI tool which must be run at linux and windows. It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual

Re: std.experimental.randomized_unittest_benchmark is ready for comments

2016-06-19 Thread Robert burner Schadek via Digitalmars-d
Thank you Seb for taking over the review management. Some additional feature for the proposed module is. * Simple way to create test data for user defined types * Benchmark data is stored into csv file for comparing the benchmark results between runs * Standalone tool to create gnuplot graphs

Re: Weird compiler

2016-06-19 Thread mogu via Digitalmars-d
On Sunday, 19 June 2016 at 15:06:40 UTC, David Nadlinger wrote: On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a linker. It's

Re: Possible bug in std.path?

2016-06-19 Thread Hugo via Digitalmars-d
On Sunday, 19 June 2016 at 14:29:27 UTC, ag0aep6g wrote: You're calling Windows' CommandLineToArgvW here. I don't think that's what Adam meant by "process it yourself". If you don't like how CommandLineToArgvW parses the command line, don't use it. What would be the efficient way to talke

Re: Phobos Action Items

2016-06-19 Thread Lodovico Giaretta via Digitalmars-d
On Sunday, 19 June 2016 at 15:40:09 UTC, Dicebot wrote: On Sunday, 19 June 2016 at 13:32:02 UTC, jmh530 wrote: On Sunday, 19 June 2016 at 06:19:34 UTC, Dicebot wrote: Which is inherently suboptimal and is a part of Go marketing bullshit not worth spending time on. It also requires heavy

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: On Sunday, 19 June 2016 at 16:31:40 UTC, Mike Parker wrote: [...] Thanks for the reply. Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo".

Re: Weird compiler

2016-06-19 Thread mogu via Digitalmars-d
Moreover, I wonder if D is really a cross-platform programming language?! The official dmd only supports x86 structure. You can never build a project with third party static library in windows independently. And how I can build an android program? LDC2? So what dmd is? Only for a bit faster

Re: Weird compiler

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 14:05:22 UTC, mogu wrote: It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a linker. It's weird that a compiler compiles to binary targets needs another

Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
Hello, I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to use a .lib file in an app. However, I can not use a module from the .lib file. I get the following

Re: ARSD PNG memory usage

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Saturday, 18 June 2016 at 02:17:01 UTC, Adam D. Ruppe wrote: I have an auto generator for pngs and 99% of the time it works, but every once in a while I get an error when loading the png's. Usually re-running the generator "fixes the problem" so it might be on my end. Regardless of where

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 16:31:40 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 15:35:04 UTC, moe wrote: I am new to d and doing some small test apps at the moment to learn d. Currently I must be missing something basic here. I have installed dub as a project manager and I am trying to

Re: D-Man culture

2016-06-19 Thread Walter Bright via Digitalmars-d-announce
I find this amazing and lots of fun!

Re: ARSD PNG memory usage

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
Also, for some reason one image has a weird horizontal line at the bottom of the image that is not part of the original. This is as if the height was 1 pixel to much and it's reading "junk". I have basically a few duplicate images that were generated from the same base image. None of the

Re: Possible bug in std.path?

2016-06-19 Thread ag0aep6g via Digitalmars-d
On 06/19/2016 06:21 PM, Hugo wrote: What would be the efficient way to talke this then? I tried regex: [...] However it doesn't quite work will all cases (besides I fear in this case a regexp could offer an unnecessary entry point for an exploit): I don't know if you can solve this with

Re: Phobos Action Items

2016-06-19 Thread Dicebot via Digitalmars-d
On Sunday, 19 June 2016 at 05:37:01 UTC, Walter Bright wrote: On 6/18/2016 10:22 PM, Suliman wrote: 8. create a greenthreads module that works like Goroutines But we already have fibers, I thought that they are same with Goroutines Fibers are thread local. Goroutines are distributed

Re: Dub generate visuald, multiple configurations?

2016-06-19 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 19 June 2016 at 07:25:29 UTC, Tofu Ninja wrote: On Friday, 17 June 2016 at 08:49:47 UTC, Tofu Ninja wrote: Is there a way to generate a single visuald project file for all dub configurations, selecting the configuration from the visual studio configuration manager? Or do I have to

[Issue 16185] New: Contents of object files are non-deterministic

2016-06-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16185 Issue ID: 16185 Summary: Contents of object files are non-deterministic Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread Johan Engelen via Digitalmars-d
On Sunday, 19 June 2016 at 08:06:09 UTC, Dicebot wrote: This important feature and can't be simply removed. For example, std.experimental.logger also relies on it. Do you mean it relies on __FILE__ being a template parameter (instead of a runtime default parameter, like enforce)? It needs

Re: Phobos Action Items

2016-06-19 Thread ZombineDev via Digitalmars-d
On Sunday, 19 June 2016 at 06:28:45 UTC, deadalnix wrote: On Sunday, 19 June 2016 at 05:37:01 UTC, Walter Bright wrote: On 6/18/2016 10:22 PM, Suliman wrote: 8. create a greenthreads module that works like Goroutines But we already have fibers, I thought that they are same with Goroutines

Re: Button: A fast, correct, and elegantly simple build system.

2016-06-19 Thread Jason White via Digitalmars-d-announce
On Saturday, 18 June 2016 at 23:52:00 UTC, H. S. Teoh wrote: I did a quick investigation, which found something interesting. If compiling straight to executable, the executable is identical each time with the same md5sum. However, when compiling to object files, the md5sum is sometimes the

Re: Phobos Action Items

2016-06-19 Thread deadalnix via Digitalmars-d
On Sunday, 19 June 2016 at 05:37:01 UTC, Walter Bright wrote: On 6/18/2016 10:22 PM, Suliman wrote: 8. create a greenthreads module that works like Goroutines But we already have fibers, I thought that they are same with Goroutines Fibers are thread local. Goroutines are distributed

Unwanted moves in d and intrusive data structures

2016-06-19 Thread Tofu Ninja via Digitalmars-d
Figured I would link this because no one responded on Reddit, I did not make the post, just linking. https://www.reddit.com/r/d_language/comments/4oohgl/unwanted_moves_in_d_and_intrusive_data_structures/

Re: Possible bug in std.path?

2016-06-19 Thread Hugo via Digitalmars-d
On Sunday, 19 June 2016 at 23:01:26 UTC, Adam D. Ruppe wrote: One potentially simple option would be to preprocess it by doing a .replace(`\"`, `\\"`) then pass to CommandLineToArgvW to hack in the extra slash... The problem with that approach is that replace does not work with wchar*. I

Re: Possible bug in std.path?

2016-06-19 Thread Mike Parker via Digitalmars-d
On Monday, 20 June 2016 at 05:11:12 UTC, Hugo wrote: On Sunday, 19 June 2016 at 23:01:26 UTC, Adam D. Ruppe wrote: One potentially simple option would be to preprocess it by doing a .replace(`\"`, `\\"`) then pass to CommandLineToArgvW to hack in the extra slash... The problem with that

Re: Possible bug in std.path?

2016-06-19 Thread ag0aep6g via Digitalmars-d
On 06/20/2016 12:38 AM, Hugo wrote: What you suggest is non-standard in Windows, I don't buy this. MSDN says about "Parsing C++ Command-Line Arguments" [1]: > A double quotation mark preceded by a backslash (\") is interpreted as a literal double quotation mark character ("). As we've

Re: Can anybody install DDT on Eclipse Neon or Mars?

2016-06-19 Thread crimaniak via Digitalmars-d-learn
On Saturday, 18 June 2016 at 16:46:26 UTC, Mark wrote: I've spent may hours trying to do this in OSX. Everything goes fine from the marketplace window...until I restart Eclipse and find no files have been added? Any words of consolation or advice will be greatly appreciated. I have Eclipse

Re: D-Man culture

2016-06-19 Thread Adam D. Ruppe via Digitalmars-d-announce
We should probably make a D-man video game.

Re: Can anybody install DDT on Eclipse Neon or Mars?

2016-06-19 Thread bachmeier via Digitalmars-d-learn
On Saturday, 18 June 2016 at 16:46:26 UTC, Mark wrote: I've spent may hours trying to do this in OSX. Everything goes fine from the marketplace window...until I restart Eclipse and find no files have been added? Any words of consolation or advice will be greatly appreciated. Desperately,

Re: D-Man culture

2016-06-19 Thread Max Klyga via Digitalmars-d-announce
On 2016-06-19 23:29:35 +, Adam D. Ruppe said: We should probably make a D-man video game. There already are a couple: http://yomogimaru.tumblr.com/post/145803169293 http://goboriin.sub.jp/DLNGRING/

Re: Parameterized inheritence issues, bug or ignorance?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d
On Monday, 20 June 2016 at 00:15:33 UTC, David Nadlinger wrote: On Monday, 20 June 2016 at 00:01:58 UTC, Joerg Joergonson wrote: class a { } class b : a { } class A(T : a) { T x; } void main(string[] argv) { auto y = new A!a(); auto z = new A!b(); y.x = new a();

Re: Parameterized inheritence issues, bug or ignorance?

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Monday, 20 June 2016 at 00:34:18 UTC, Joerg Joergonson wrote: Can I just force the cast in some way if I know good an well it works for ever? Or do I have to write extra code to get around axiom: "We did this to save you trouble because we know better than you what you are doing. Go forth

Re: Using .lib and .dll in D applications

2016-06-19 Thread docandrew via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:33:36 UTC, moe wrote: On Sunday, 19 June 2016 at 18:00:07 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in

Re: Using .lib and .dll in D applications

2016-06-19 Thread captaindet via Digitalmars-d-learn
On 2016-06-20 06:33, moe wrote: I see where I went wrong. I thought that it's possible to only use the .lib file without the source code of dbar. Having access to the source makes what I am trying somewhat pointless. Is it otherwise possible to provide some functionality without having to give

Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:33:36 UTC, moe wrote: I see where I went wrong. I thought that it's possible to only use the .lib file without the source code of dbar. Having access to the source makes what I am trying somewhat pointless. Is it otherwise possible to provide some functionality

Re: Non movable structs

2016-06-19 Thread Adrian Matoga via Digitalmars-d
On Sunday, 19 June 2016 at 02:06:59 UTC, deadalnix wrote: Long story short, I need structs that do not move. I'm sure there are many other use cases. I needed that for a struct member function to be passed as delegate for a fiber. The easiest way I found was to malloc the struct.

Re: Cross platform android ldc compiler

2016-06-19 Thread Jacob Carlborg via Digitalmars-d
On 2016-06-18 18:39, Andre Pany wrote: You are right. I thought it would be possible to create ios applications also from a linux system. But as you need OS X, the docker approach isn't possible. It should work for Android though. -- /Jacob Carlborg

Re: Possible bug in std.path?

2016-06-19 Thread Hugo via Digitalmars-d
Further, notice what happens if I remove the buildNormalizedPath: mytestapp dir1 ..\ "another dir\" Argument 0: 'mytestapp ' Argument 1: 'dir' Argument 2: '..\' Argument 3: 'another dir"' Apparently the backslash is still being interpreted as an escape when followed by a double quote, even if

Re: Possible bug in std.path?

2016-06-19 Thread ag0aep6g via Digitalmars-d
On 06/19/2016 02:23 PM, Hugo wrote: On Friday, 20 May 2016 at 17:41:22 UTC, Adam D. Ruppe wrote: [...] Use GetCommandLine to fetch the original thing the user typed, then process it yourself. [...] Then why doesn't the following code produce the expected output? [...] auto wargs =

Re: Non movable structs

2016-06-19 Thread Mathias Lang via Digitalmars-d
Normally, you would need to disable both identity opAssign and postblit and it should work. At the moment, it works for the struct itself, however it breaks when the struct is nested in another one. There are a couple of issues I am currently looking into fixing (after an IRC discussion with

Re: More suggestions for find()

2016-06-19 Thread qznc via Digitalmars-d
On Saturday, 18 June 2016 at 18:54:28 UTC, Andrei Alexandrescu wrote: Got this link from the reddit discussion around the blog article: http://effbot.org/zone/stringlib.htm. The Bloom-filter-style trick looks quite cool. Anyone interested in running some more experiments? Thx! -- Andrei

Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
In the following code, the `foo` function doesn't work when casting to an immutable or shared type. Can anyone please explain what is happening here? Is there any way of returning such variables byRef from a malloc'd chunk of memory? import core.stdc.stdlib; ref T foo(T)() { int* foo

Re: Phobos Action Items

2016-06-19 Thread qznc via Digitalmars-d
On Sunday, 19 June 2016 at 06:28:45 UTC, deadalnix wrote: On Sunday, 19 June 2016 at 05:37:01 UTC, Walter Bright wrote: On 6/18/2016 10:22 PM, Suliman wrote: 8. create a greenthreads module that works like Goroutines But we already have fibers, I thought that they are same with Goroutines

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit" attribute could solve this issue and other cases where the

Re: More suggestions for find()

2016-06-19 Thread Andrei Alexandrescu via Digitalmars-d
On 06/19/2016 06:38 AM, qznc wrote: Unfortunately, Im currently traveling and lost my bag with laptop at the airport. Bummer. I hope you find it! -- Andrei

Weird compiler

2016-06-19 Thread mogu via Digitalmars-d
Today, I'm working on a private GUI tool which must be run at linux and windows. It's awful that I compile a little 64bit program(or -m32mscoff) in windows must have visual studio which has tremendous size installed even though I only need a linker. It's weird that a compiler compiles to

Re: Phobos Action Items

2016-06-19 Thread John Colvin via Digitalmars-d
On Sunday, 19 June 2016 at 01:01:30 UTC, Nicholas Wilson wrote: On Saturday, 18 June 2016 at 20:04:50 UTC, Walter Bright wrote: 9. create a module that enables code to be run on GPUs (John Colvin is doing work on this, ask him how to help!) Now that I'm on my (southern hemisphere) winter

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 18, 2016 21:55:31 Joerg Joergonson via Digitalmars-d-learn wrote: > I wanted to switch to std.container.Array but it doesn't seem to > mimic [] for some odd ball reason. D's dynamic arrays are really quite weird in that they're sort of containers and sort of not. So, pretty

Re: Phobos Action Items

2016-06-19 Thread deadalnix via Digitalmars-d
On Sunday, 19 June 2016 at 06:37:03 UTC, ZombineDev wrote: I agree. BTW, what do you think about improving the compiler's understanding of Fibers (AFAIU they're purely a runtime thing), so e.g. they're usable at CTFE. See this for more details:

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread Dicebot via Digitalmars-d
On Sunday, 19 June 2016 at 08:33:40 UTC, Johan Engelen wrote: On Sunday, 19 June 2016 at 08:06:09 UTC, Dicebot wrote: This important feature and can't be simply removed. For example, std.experimental.logger also relies on it. Do you mean it relies on __FILE__ being a template parameter

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: import core.stdc.stdlib; import std.traits; ref T foo(T)() { alias Type = Unqual!(T); Type* foo = cast(Type*) malloc(Type.sizeof * 8); return *foo; } void main(string[]

GPGPU work and Identifiers

2016-06-19 Thread Nicholas Wilson via Digitalmars-d
This thread is partly to announce that i will be adding to LDC the ability to generate code for GPUs through OpenCL, CUDA (and if i have time) Metal in my fork at https://github.com/thewilsonator/ldc and partly to request the reservation of the relevant Version identifiers. (Do I do this by a

Re: Possible bug in std.path?

2016-06-19 Thread Hugo via Digitalmars-d
On Friday, 20 May 2016 at 17:41:22 UTC, Adam D. Ruppe wrote: [...] Use GetCommandLine to fetch the original thing the user typed, then process it yourself. [...] Then why doesn't the following code produce the expected output? import std.stdio, std.file, std.path; version (Windows) {

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 12:45 PM, Gary Willoughby wrote: On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: import core.stdc.stdlib; import std.traits; ref T foo(T)() { alias Type = Unqual!(T); Type* foo = cast(Type*) malloc(Type.sizeof * 8);

Re: Why do I get this error when casting to an immutable or shared byRef return type?

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 10:45:25 UTC, Gary Willoughby wrote: On Sunday, 19 June 2016 at 10:35:59 UTC, Gary Willoughby wrote: ... A more correct example: In the second example, the problem is this: alias Type = Unqual!(T); You are declaring the function to return T, which in your

Re: Phobos Action Items

2016-06-19 Thread jmh530 via Digitalmars-d
On Sunday, 19 June 2016 at 06:19:34 UTC, Dicebot wrote: Which is inherently suboptimal and is a part of Go marketing bullshit not worth spending time on. It also requires heavy runtime modifications (because TLS) unless one wants to totally screw plain fibers. Proper action item instead

Re: GPGPU work and Identifiers

2016-06-19 Thread Nicholas Wilson via Digitalmars-d
On Sunday, 19 June 2016 at 12:38:00 UTC, Jakob Bornecrantz wrote: On Sunday, 19 June 2016 at 11:12:50 UTC, Nicholas Wilson wrote: This thread is partly to announce that i will be adding to LDC the ability to generate code for GPUs through OpenCL, CUDA (and if i have time) Metal in my fork at

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit"

Re: D-Man culture

2016-06-19 Thread Bill Baxter via Digitalmars-d-announce
Whew! I thought this was going to be a scathing critique of some lurking anti-feministic culture in the D world. Glad to see it's just about some cute D-shaped characters! On Sun, Jun 19, 2016 at 10:30 AM, Walter Bright via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: >

What exactly does the compiler switch -betterC do?

2016-06-19 Thread Gary Willoughby via Digitalmars-d-learn
When compiling, what exactly does the -betterC flag do? The command help says "omit generating some runtime information and helper functions" but what does this really mean? Is there any specifics somewhere?

Re: D casting broke?

2016-06-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 19:59:28 UTC, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly and we see that T' derives from b which derives from a directly. So B!b is an entirely derived from A!a and hence the cast should be successful I

Re: D casting broke?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 11:19 PM, Joerg Joergonson wrote: On Sunday, 19 June 2016 at 20:21:35 UTC, ag0aep6g wrote: [...] No. B!b is derived from A!b, not from A!a. `b` being derived from `a` does not make A!b derived from A!a. why not? This doesn't seem logical! Template parameters simply don't work

Re: Using .lib and .dll in D applications

2016-06-19 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo". Assuming that "dfoo" has no access to "dbar" other than the .lib file. You can't do it

Re: Unmanaged drop in replacemet for [] and length -= 1

2016-06-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 19, 2016 15:59:41 Joerg Joergonson via Digitalmars-d-learn wrote: > If foreach removes all/any of the elements of a container then > something is broke. That's exactly what happens with a basic input range, and if it doesn't happen with a forward range, it's just because copying

Workaround for RefCounted with classes would work?

2016-06-19 Thread Bienlein via Digitalmars-d
Hello, RefCounted so far works well with structs, but not with classes (see http://wiki.dlang.org/DIP74). I have now set up a little kludge where a struct takes a class as a template parameter. The struct with the containing object, which is of the type of the struct's template type, is

D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
import std.stdio; class X { X Parent; } class x : X { } class a : x { void Do() { auto p = cast(A!a)(this.Parent); // works as long as we are in A assert(p !is null); } } class A(T : a) : X { X Parent = new X(); T _y = new T(); } class b : a { } class

Re: D casting broke?

2016-06-19 Thread ag0aep6g via Digitalmars-d-learn
On 06/19/2016 09:59 PM, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly ok and we see that T' derives from b which derives from a directly. ok So B!b is an entirely derived from A!a No. B!b is derived from A!b, not from A!a. `b`

Re: GPGPU work and Identifiers

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 18:23:06 UTC, Jakob Bornecrantz wrote: That will be annoying, the LDC that works with SPIR-V wont be able to produce MSVC compatible exes. Lets hope they mainline it soon. One possible solution for this would be a thin driver executable that parses just enough of

Re: Performance issue in struct initialization

2016-06-19 Thread Basile B. via Digitalmars-d
On Sunday, 19 June 2016 at 20:52:52 UTC, deadalnix wrote: On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in

Re: GPGPU work and Identifiers

2016-06-19 Thread Jakob Bornecrantz via Digitalmars-d
On Sunday, 19 June 2016 at 14:04:15 UTC, Nicholas Wilson wrote: On Sunday, 19 June 2016 at 12:38:00 UTC, Jakob Bornecrantz wrote: On Sunday, 19 June 2016 at 11:12:50 UTC, Nicholas Wilson wrote: This thread is partly to announce that i will be adding to LDC the ability to generate code for GPUs

Re: Using .lib and .dll in D applications

2016-06-19 Thread moe via Digitalmars-d-learn
On Sunday, 19 June 2016 at 18:00:07 UTC, Mike Parker wrote: On Sunday, 19 June 2016 at 17:33:43 UTC, moe wrote: Unfortunatelly I still don't get it. I would like to have an independant project "dbar". The created lib is then used in another project "dfoo". Assuming that "dfoo" has no

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread Dicebot via Digitalmars-d
On 06/19/2016 11:33 AM, Johan Engelen wrote: > On Sunday, 19 June 2016 at 08:06:09 UTC, Dicebot wrote: >> This important feature and can't be simply removed. For example, >> std.experimental.logger also relies on it. > > Do you mean it relies on __FILE__ being a template parameter (instead of > a

Re: Performance issue in struct initialization

2016-06-19 Thread deadalnix via Digitalmars-d
On Sunday, 19 June 2016 at 11:11:18 UTC, Basile B. wrote: On Saturday, 23 April 2016 at 13:37:31 UTC, Andrei Alexandrescu wrote: https://issues.dlang.org/show_bug.cgi?id=15951. I showed a few obvious cases, but finding the best code in general is tricky. Ideas? -- Andrei A new "@noinit"

Re: More suggestions for find()

2016-06-19 Thread deadalnix via Digitalmars-d
On Sunday, 19 June 2016 at 11:49:06 UTC, Andrei Alexandrescu wrote: On 06/19/2016 06:38 AM, qznc wrote: Unfortunately, Im currently traveling and lost my bag with laptop at the airport. Bummer. I hope you find it! -- Andrei Not in D, but:

Re: D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 20:21:35 UTC, ag0aep6g wrote: On 06/19/2016 09:59 PM, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly ok and we see that T' derives from b which derives from a directly. ok So B!b is an entirely derived

[Issue 15341] segfault with std.signals slots

2016-06-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15341 hba...@hotmail.com changed: What|Removed |Added Status|NEW |ASSIGNED

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 21:13:00 UTC, Johan Engelen wrote: On Sunday, 19 June 2016 at 21:11:59 UTC, Johan Engelen wrote: (I think we can pretty much inline anything the user throws at us) (as long as it is not a naked asm function) Another example is `alloca`, which you might not want to

Re: Phobos: __FILE__ as template default parameter

2016-06-19 Thread Johan Engelen via Digitalmars-d
On Sunday, 19 June 2016 at 21:40:20 UTC, David Nadlinger wrote: On Sunday, 19 June 2016 at 21:13:00 UTC, Johan Engelen wrote: On Sunday, 19 June 2016 at 21:11:59 UTC, Johan Engelen wrote: (I think we can pretty much inline anything the user throws at us) (as long as it is not a naked asm

const and mutable opApply's

2016-06-19 Thread Oleg B via Digitalmars-d-learn
Hello struct WTable { ... private enum opApply_body = q{ if( smt ) { foreach( f; 0 .. size-1 ) foreach( t; f+1 .. size ) if( auto r = dlg(f,t,data[getIndex(f,t)]) ) return r; } else {

Re: Possible bug in std.path?

2016-06-19 Thread Adam D. Ruppe via Digitalmars-d
On Sunday, 19 June 2016 at 15:36:08 UTC, Hugo wrote: I thought the proper way to call GetCommandLineW was precisely through CommandLineToArgvW, now I am lost. Typically, yes, but you are saying you don't like what CommandLineToArgvW does (it is responsible for handling quotes and backslash

Re: GPGPU work and Identifiers

2016-06-19 Thread David Nadlinger via Digitalmars-d
On Sunday, 19 June 2016 at 20:20:38 UTC, David Nadlinger wrote: Such a separate driver could then also be used as part of the regular distribution to improve the performance on memory-constrained all-at-once builds, by freeing all the frontend/LLVM memory (i.e., terminating the process) before

Re: D casting broke?

2016-06-19 Thread Joerg Joergonson via Digitalmars-d-learn
On Sunday, 19 June 2016 at 20:18:14 UTC, Adam D. Ruppe wrote: On Sunday, 19 June 2016 at 19:59:28 UTC, Joerg Joergonson wrote: This should be completely valid since B!T' obviously derives from A!T directly and we see that T' derives from b which derives from a directly. So B!b is an entirely

  1   2   >