Re: Official compiler

2016-02-25 Thread Jonathan M Davis via Digitalmars-d
On Friday, 26 February 2016 at 06:19:27 UTC, Walter Bright wrote: I wish LLVM would switch to the Boost license, in particular removing this clause: "Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the

Re: dub: how to reference a compiled package

2016-02-25 Thread asdf via Digitalmars-d-learn
On Friday, 26 February 2016 at 04:03:15 UTC, BBasile wrote: e.g the DMD equivalent for the two previous example is DMD "sourceThis.d" "folder/interface.di" "folder/binary.a" -ofbin/thesoft You can mix unlinked binaries and text-editor source files on commandline? Didn't know that when I

Re: dub: how to reference a compiled package

2016-02-25 Thread Mike Parker via Digitalmars-d-learn
On Friday, 26 February 2016 at 04:03:15 UTC, BBasile wrote: The D interface file must be specified to DUB using "sourceFiles" : ["folder/interface.di"], either in a config or in the globals. The binary, so either a .lib | .a or .obj | .o must be specified to DUB using "DFlags" :

Re: dub: how to reference a compiled package

2016-02-25 Thread Mike Parker via Digitalmars-d-learn
On Friday, 26 February 2016 at 03:19:26 UTC, mahdi wrote: Great! Thanks. I was looking for a feature like `jar` files in Java or `assemblies` in C# where all compiled code and metadata/symbols are stored together inside a single binary file. I think same can be implemented for D language

[Issue 15721] free error when calling Mallocator.dispose on interfaces

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15721 b2.t...@gmx.com changed: What|Removed |Added Summary|std.experimental.allocator |free error when calling

Re: Official compiler

2016-02-25 Thread Walter Bright via Digitalmars-d
On 2/18/2016 1:30 PM, Jonathan M Davis wrote: It's not a strawman. Walter has state previously that he's explicitly avoided looking at the source code for other compilers like gcc, because he doesn't want anyone to be able to accuse him of stealing code, copyright infringement, etc. Now, that's

Re: no size yet for forward reference error

2016-02-25 Thread Walter Bright via Digitalmars-d
On 2/25/2016 9:07 PM, Erik Smith wrote: Good to know that it's a bug - Thanks for the help. I've created an issue to track this: https://issues.dlang.org/show_bug.cgi?id=15726 Thanks for preparing the bug report. You can probably work around the problem for the time being by making one of

[Issue 15721] std.experimental.allocator dispose on interface

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15721 --- Comment #2 from b2.t...@gmx.com --- I think this is safe to change dispose to: void dispose(A, T)(auto ref A alloc, T p) if (is(T == class) || is(T == interface)) { if (!p) return; auto support = (cast(void*) cast(Object) p)[0 ..

[Issue 15721] std.experimental.allocator dispose on interface

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15721 b2.t...@gmx.com changed: What|Removed |Added Component|installer |phobos Hardware|x86_64

Minimise and collect by GC when OutOfMemory

2016-02-25 Thread tcak via Digitalmars-d-learn
Would it be a good idea to call "collect" and "minimize" methods of core.memory.GC when OutOfMemory error is received FOR A LONG RUNNING PROGRAM? or there won't be any benefit of that? Example program: A web server that allocates and releases memory from heap continuously.

[Issue 15721] std.experimental.allocator dispose on interface

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15721 b2.t...@gmx.com changed: What|Removed |Added CC||b2.t...@gmx.com --- Comment #1 from

[Issue 15726] forward reference error for circular classes, RefCounted

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15726 Walter Bright changed: What|Removed |Added CC|

[Issue 15684] secure wiki formatting

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15684 b2.t...@gmx.com changed: What|Removed |Added CC||xemail...@yahoo.co.uk --- Comment #3 from

Re: no size yet for forward reference error

2016-02-25 Thread Erik Smith via Digitalmars-d
Good to know that it's a bug - Thanks for the help. I've created an issue to track this: https://issues.dlang.org/show_bug.cgi?id=15726

Re: all functions that have a first arg of type T

2016-02-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 26 February 2016 at 04:21:15 UTC, BBasile wrote: On Friday, 26 February 2016 at 04:19:29 UTC, BBasile wrote: static if (__traits(isStaticFunction,typeof(m2))) static if (__traits(isStaticFunction, __traits(getMember, vulkan_input, m2 Sorry don't copy paste like this there's a

Re: all functions that have a first arg of type T

2016-02-25 Thread BBasile via Digitalmars-d-learn
On Friday, 26 February 2016 at 04:19:29 UTC, BBasile wrote: static if (__traits(isStaticFunction,typeof(m2))) static if (__traits(isStaticFunction, __traits(getMember, vulkan_input, m2 Sorry don't copy paste like this there's a superfluous right paren. static if

Re: all functions that have a first arg of type T

2016-02-25 Thread BBasile via Digitalmars-d-learn
On Friday, 26 February 2016 at 03:57:25 UTC, Nicholas Wilson wrote: foreach(m; __traits(allMembers, vulkan_input)) { static if (m.endsWith("_T")) { foreach(m2; __traits(allMembers, vulkan_input)) { static if (__traits(isStaticFunction,typeof(m2)))// <- what

Re: dub: how to reference a compiled package

2016-02-25 Thread BBasile via Digitalmars-d-learn
On Thursday, 25 February 2016 at 12:15:42 UTC, mahdi wrote: Hi, Suppose I have a package `mypack` in `~/mypack`. I run `dub` command on this package and have the compiled `mypack` file (OS is Linux). Now I am working on my project. I know how to use the source-code of `mypack` package in

all functions that have a first arg of type T

2016-02-25 Thread Nicholas Wilson via Digitalmars-d-learn
foreach(m; __traits(allMembers, vulkan_input)) { static if (m.endsWith("_T")) { foreach(m2; __traits(allMembers, vulkan_input)) { static if (__traits(isStaticFunction,typeof(m2)))// <- what here? { enum fn =

Re: how to initialise const variables

2016-02-25 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson wrote: struct A { const (void *) p; } struct B { Aa; this(void * _p) { a.p = _p; } } I cannot change the definition of A how do I initialise b.a.p? Use a constructor for A instead of trying to write

Re: dub: how to reference a compiled package

2016-02-25 Thread mahdi via Digitalmars-d-learn
On Friday, 26 February 2016 at 02:49:20 UTC, Mike Parker wrote: On Thursday, 25 February 2016 at 21:06:59 UTC, mahdi wrote: On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright Thanks. Is there a way to use a D library without having access to it's source code? I tried `dmd -lib

Re: how to initialise const variables

2016-02-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 26 February 2016 at 02:48:35 UTC, cym13 wrote: On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson wrote: struct A { const (void *) p; } struct B { Aa; this(void * _p) { a.p = _p; } } I cannot change the definition of A how do I initialise

Re: Official compiler

2016-02-25 Thread Jonathan M Davis via Digitalmars-d
On Friday, 26 February 2016 at 00:56:22 UTC, Walter Bright wrote: On 2/25/2016 3:06 PM, H. S. Teoh via Digitalmars-d wrote: I remember you did a bunch of stuff to the optimizer after the switchover to self-hosting; how much of a difference did that make? Are there any low-hanging fruit left

Re: dub: how to reference a compiled package

2016-02-25 Thread Mike Parker via Digitalmars-d-learn
On Friday, 26 February 2016 at 02:49:20 UTC, Mike Parker wrote: The compiler needs to know about S and its types, and it needs S and its *members*

Re: dub: how to reference a compiled package

2016-02-25 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 25 February 2016 at 21:06:59 UTC, mahdi wrote: On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright Thanks. Is there a way to use a D library without having access to it's source code? I tried `dmd -lib abcd.d` which creates a static library. But still I need to specify

Re: how to initialise const variables

2016-02-25 Thread cym13 via Digitalmars-d-learn
On Friday, 26 February 2016 at 02:32:44 UTC, Nicholas Wilson wrote: struct A { const (void *) p; } struct B { Aa; this(void * _p) { a.p = _p; } } I cannot change the definition of A how do I initialise b.a.p? As you did: void main() { int i = 42;

how to initialise const variables

2016-02-25 Thread Nicholas Wilson via Digitalmars-d-learn
struct A { const (void *) p; } struct B { Aa; this(void * _p) { a.p = _p; } } I cannot change the definition of A how do I initialise b.a.p?

Re: Official compiler

2016-02-25 Thread Chris Wright via Digitalmars-d
On Fri, 26 Feb 2016 00:48:15 +0100, Xavier Bigand wrote: > Is dmd multi-threaded? Not at present. It should be relatively easy to parallelize IO and parsing, at least in theory. I think IO parallelism was removed with the ddmd switch, maybe? But you'd have to identify the files you need to

Re: Official compiler

2016-02-25 Thread Walter Bright via Digitalmars-d
On 2/25/2016 3:06 PM, H. S. Teoh via Digitalmars-d wrote: I remember you did a bunch of stuff to the optimizer after the switchover to self-hosting; how much of a difference did that make? Are there any low-hanging fruit left that could make dmd faster? There's a lot of low hanging fruit in

Re: Official compiler

2016-02-25 Thread Walter Bright via Digitalmars-d
On 2/25/2016 3:06 PM, David Nadlinger wrote: On Thursday, 25 February 2016 at 22:03:47 UTC, Walter Bright wrote: DMD did slow down because it was now being compiled by DMD instead of g++. You can compile it using LDC just fine now. ;) I think we should ask Martin to set that up for the

Re: how do you append arrays?

2016-02-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/25/16 4:39 PM, asdf wrote: if(line != "" && line != history[0]) { string[] x = [line]; foreach(string i; history[0..99]) x ~= i; history = x; } ugh! history = line ~ history[0 .. $ - 1]; What you may want to consider is making

Re: std.xml2 (collecting features)

2016-02-25 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 25 February 2016 at 23:59:04 UTC, crimaniak wrote: Where is only a couple of ad-hoc checks for attributes values. This language is not XPath-compatible, so most easy way to cover a lot of cases is regex check for attributes. Something like

Re: std.xml2 (collecting features)

2016-02-25 Thread crimaniak via Digitalmars-d
On Sunday, 21 February 2016 at 23:57:40 UTC, Adam D. Ruppe wrote: On Sunday, 21 February 2016 at 23:01:22 UTC, crimaniak wrote: I will use it in my experiments, but getElementsBySelector() selector language need to be improved I think. What, specifically, do you have in mind? Where is only

Re: Official compiler

2016-02-25 Thread Xavier Bigand via Digitalmars-d
Le 25/02/2016 03:48, Walter Bright a écrit : On 2/24/2016 6:05 PM, Adam D. Ruppe wrote: I've also heard from big users who want the performance more than compile time and hit difficulty in build scaling.. I know that performance trumps all for many users. But we can have both - dmd and

Re: Pseudo-random numbers in [0, n), covering all numbers in n steps?

2016-02-25 Thread Nicholas Wilson via Digitalmars-d
On Thursday, 25 February 2016 at 17:27:25 UTC, Andrei Alexandrescu wrote: So we have https://dlang.org/phobos/std_random.html#.randomCover which needs to awkwardly allocate memory to keep track of the portions of the array already covered. This could be fixed by devising a PRNG that takes a

Re: Accessing all data in TypeTupple (AliasSeq) and stringify them

2016-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 02/25/2016 12:53 PM, Voitech wrote: template TupleToString(TList...){ string a; foreach(T;TList){ // Error: declaration expected, not 'foreach' a~=T.stringof; } enum string TupleToString=a; } Of course i can use template function, but wanted to know if can omit

Re: The D-9000 robot

2016-02-25 Thread gtku via Digitalmars-d
On Thursday, 25 February 2016 at 22:33:54 UTC, Walter Bright wrote: My gawd, what are we doing: https://i.imgur.com/z8nxId1.gifv Oh yeah, I've seen this the other day on HackerNews. Quite impressive how it walk in the snow.

Re: Accessing all data in TypeTupple (AliasSeq) and stringify them

2016-02-25 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 25 February 2016 at 20:53:12 UTC, Voitech wrote: On Thursday, 25 February 2016 at 14:29:30 UTC, Nicholas Wilson wrote: On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote: [...] You can (see std.meta/(std.traits?) , with recursive templates), but there is nothing

Re: Official compiler

2016-02-25 Thread H. S. Teoh via Digitalmars-d
On Thu, Feb 25, 2016 at 02:03:47PM -0800, Walter Bright via Digitalmars-d wrote: > On 2/25/2016 1:50 PM, Andrei Alexandrescu wrote: > >Good to know, thanks! -- Andrei > > DMD did slow down because it was now being compiled by DMD instead of > g++. Also, dmd was doing multithreaded file I/O, but

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 22:03:47 UTC, Walter Bright wrote: DMD did slow down because it was now being compiled by DMD instead of g++. You can compile it using LDC just fine now. ;) Also, dmd was doing multithreaded file I/O, but that was removed because speed didn't matter . Did

Re: Official compiler

2016-02-25 Thread Atila Neves via Digitalmars-d
On Thursday, 25 February 2016 at 22:38:45 UTC, Atila Neves wrote: On Thursday, 25 February 2016 at 19:55:20 UTC, rsw0x wrote: [...] Would it be possible to point me in the directions of projects where you saw ldc being faster? I didn't try per-module, but on the projects I tried, dmd is

Re: Official compiler

2016-02-25 Thread Atila Neves via Digitalmars-d
On Thursday, 25 February 2016 at 19:55:20 UTC, rsw0x wrote: On Thursday, 25 February 2016 at 19:25:38 UTC, deadalnix wrote: On Thursday, 18 February 2016 at 06:57:01 UTC, Kai Nacke wrote: If we would make GDC or LDC the official compiler then the next question which pops up is about

Re: Calling python code from D

2016-02-25 Thread asdf via Digitalmars-d-learn
On Thursday, 25 February 2016 at 21:46:40 UTC, asdf wrote: Hi, me again. I'm having trouble making a demonstration and not sure if is obsolete or not anyways. :/ Anyways take a look here. http://www.tutorialspoint.com/python/python_further_extensions.htm

The D-9000 robot

2016-02-25 Thread Walter Bright via Digitalmars-d
My gawd, what are we doing: https://i.imgur.com/z8nxId1.gifv

Re: Calling python code from D

2016-02-25 Thread jmh530 via Digitalmars-d-learn
On Thursday, 25 February 2016 at 21:46:40 UTC, asdf wrote: I haven't tried this myself but D is supposed to have excellent interface to C code. Perhaps you can go that route. http://stackoverflow.com/questions/145270/calling-c-c-from-python That question is the reverse, calling C from

Re: Installing DUB on OSX

2016-02-25 Thread Joel via Digitalmars-d-learn
On Thursday, 25 February 2016 at 11:06:09 UTC, Jacob Carlborg wrote: On 2016-02-24 23:11, Joel wrote: Error: Error writing file '../../../.dub/packages/dsfml-2.1.0/libdsfml_system.a' Joels-MacBook-Pro:DGuy joelcnz$ Is the full path of ../../../.dub/packages/dsfml-2.1.0 writable? It is

Re: Official compiler

2016-02-25 Thread Walter Bright via Digitalmars-d
On 2/25/2016 1:50 PM, Andrei Alexandrescu wrote: Good to know, thanks! -- Andrei DMD did slow down because it was now being compiled by DMD instead of g++. Also, dmd was doing multithreaded file I/O, but that was removed because speed didn't matter . As I said, keeping the compiler speed

[Issue 15725] New: [D Builtin Rationale]

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15725 Issue ID: 15725 Summary: [D Builtin Rationale] Product: D Version: D2 Hardware: All URL: http://dlang.org/ OS: All Status: NEW Severity:

Re: Official compiler

2016-02-25 Thread Andrei Alexandrescu via Digitalmars-d
On 02/25/2016 02:55 PM, rsw0x wrote: On Thursday, 25 February 2016 at 19:25:38 UTC, deadalnix wrote: On Thursday, 18 February 2016 at 06:57:01 UTC, Kai Nacke wrote: If we would make GDC or LDC the official compiler then the next question which pops up is about compilation speed ldc is

Re: Calling python code from D

2016-02-25 Thread asdf via Digitalmars-d-learn
On Thursday, 25 February 2016 at 21:40:45 UTC, Wyatt wrote: I have a project I started in Python before I realised I really don't enjoy Python. It's been on the back-burner for a few years and I'd like to start again in D, but there's a particular python module (Mutagen) that I outright

Calling python code from D

2016-02-25 Thread Wyatt via Digitalmars-d-learn
I have a project I started in Python before I realised I really don't enjoy Python. It's been on the back-burner for a few years and I'd like to start again in D, but there's a particular python module (Mutagen) that I outright refuse to reimplement. What's the state of the art in calling

Re: how do you append arrays?

2016-02-25 Thread asdf via Digitalmars-d-learn
On Thursday, 25 February 2016 at 19:21:31 UTC, Steven Schveighoffer wrote: On 2/25/16 2:12 PM, Steven Schveighoffer wrote: I believe you could use std.algorithm.copy, but probably need to do it with retro as well. Heh, or of course use memmove :) -Steve I got the history list working

Re: Installing DUB on OSX

2016-02-25 Thread Joel via Digitalmars-d-learn
On Thursday, 25 February 2016 at 11:06:09 UTC, Jacob Carlborg wrote: On 2016-02-24 23:11, Joel wrote: Error: Error writing file '../../../.dub/packages/dsfml-2.1.0/libdsfml_system.a' Joels-MacBook-Pro:DGuy joelcnz$ Is the full path of ../../../.dub/packages/dsfml-2.1.0 writable? .dub is

[Issue 4763] Few possible changes on std.stdio.File

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4763 Andre changed: What|Removed |Added CC|alver...@gmail.com | --

[Issue 4763] Few possible changes on std.stdio.File

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4763 Andre changed: What|Removed |Added CC|

Re: How to better organize dub project to get 3 exe from same codebase?

2016-02-25 Thread Luis via Digitalmars-d-learn
On Thursday, 25 February 2016 at 20:55:33 UTC, Suliman wrote: On Thursday, 25 February 2016 at 19:09:59 UTC, Suliman wrote: Where to store shared classes? { "name": "123", "authors": [ "Suliman" ], "description": "A minimal D application.",

Re: dub: how to reference a compiled package

2016-02-25 Thread mahdi via Digitalmars-d-learn
On Thursday, 25 February 2016 at 16:45:46 UTC, Chris Wright wrote: On Thu, 25 Feb 2016 12:15:42 +, mahdi wrote: Hi, Suppose I have a package `mypack` in `~/mypack`. I run `dub` command on this package and have the compiled `mypack` file (OS is Linux). Now I am working on my project. I

Re: no size yet for forward reference error

2016-02-25 Thread Marc Schütz via Digitalmars-d
Digger shows that it stopped working after this PR: https://github.com/D-Programming-Language/dmd/pull/4457 I could reduce it as far as this: struct RefCounted(T) { struct Impl { T _payload; } Impl* _store; ~this() { destroy(_store._payload); } } struct

Re: How to better organize dub project to get 3 exe from same codebase?

2016-02-25 Thread Suliman via Digitalmars-d-learn
On Thursday, 25 February 2016 at 19:09:59 UTC, Suliman wrote: Where to store shared classes? { "name": "123", "authors": [ "Suliman" ], "description": "A minimal D application.", "copyright": "Copyright © 2016, Suliman",

Re: Accessing all data in TypeTupple (AliasSeq) and stringify them

2016-02-25 Thread Voitech via Digitalmars-d-learn
On Thursday, 25 February 2016 at 14:29:30 UTC, Nicholas Wilson wrote: On Thursday, 25 February 2016 at 13:16:43 UTC, Voitech wrote: Hi, I have some code processing functions definition in compile time, I want to override them in some other class but not explicitly so created this code:

[Issue 15678] BigInt("") should fail more prominently

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15678 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/3ad0489e36819780a5b9c8a486968f6ae2fe73d3 Merge pull request

Re: no size yet for forward reference error

2016-02-25 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 25 February 2016 at 20:14:20 UTC, Marc Schütz wrote: On Thursday, 25 February 2016 at 17:33:34 UTC, Jonathan M Davis wrote: Actually, both of your examples compile for me - both with master and with 2.070.0. I'm running on x86_64 FreeBSD (which you probably aren't), which

Re: no size yet for forward reference error

2016-02-25 Thread Marc Schütz via Digitalmars-d
On Thursday, 25 February 2016 at 17:33:34 UTC, Jonathan M Davis wrote: Actually, both of your examples compile for me - both with master and with 2.070.0. I'm running on x86_64 FreeBSD (which you probably aren't), which shouldn't matter for this sort of error, but I suppose that it's possible

Re: Swift deprecate i++ and c-style for loop

2016-02-25 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 25 February 2016 at 19:03:12 UTC, Steven Schveighoffer wrote: On 2/24/16 3:47 PM, Ola Fosheim Grøstad wrote: On Wednesday, 24 February 2016 at 18:06:19 UTC, Steven Schveighoffer wrote: I'm quite glad D stuck with the same type for arrays and array slices. And how will you get

Re: Official compiler

2016-02-25 Thread rsw0x via Digitalmars-d
On Thursday, 25 February 2016 at 19:25:38 UTC, deadalnix wrote: On Thursday, 18 February 2016 at 06:57:01 UTC, Kai Nacke wrote: If we would make GDC or LDC the official compiler then the next question which pops up is about compilation speed ldc is still significantly faster than clang,

Re: Unum II announcement

2016-02-25 Thread Nick B via Digitalmars-d
On Thursday, 25 February 2016 at 10:36:08 UTC, Robbert van Dalen wrote: On Wednesday, 24 February 2016 at 21:43:59 UTC, Nick B wrote: On Wednesday, 24 February 2016 at 20:11:39 UTC, Robbert van Dalen wrote: Nick, I've just asked Dr. Gustafson to create a group on his behalf and he was

Silicon Valley D Meetup February 25, 2016

2016-02-25 Thread Ali Çehreli via Digitalmars-d-announce
This time there is no speaker presentation. We will go over D's vision in 2016 and share tips and tricks: http://www.meetup.com/D-Lang-Silicon-Valley/events/228672525/ Ali

Re: How to detect if an array if dynamic or static

2016-02-25 Thread Ali Çehreli via Digitalmars-d-learn
On 02/25/2016 04:47 AM, sigod wrote: > void bar(ref int[] arr) > > Code wouldn't compile if you try to pass static array as `ref` argument. To qualify further, static arrays cannot be passed as slice references because although there is an automatic slicing of static arrays, such slices

Re: Official compiler

2016-02-25 Thread deadalnix via Digitalmars-d
On Thursday, 18 February 2016 at 06:57:01 UTC, Kai Nacke wrote: If we would make GDC or LDC the official compiler then the next question which pops up is about compilation speed ldc is still significantly faster than clang, or gdc than gcc. I don't think this is that much of a valid

Re: no size yet for forward reference error

2016-02-25 Thread Erik Smith via Digitalmars-d
I'm running OSX 10.11.2, DMD v2.070 installed via homebrew with --devel flag. erik

Re: how do you append arrays?

2016-02-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/25/16 2:12 PM, Steven Schveighoffer wrote: I believe you could use std.algorithm.copy, but probably need to do it with retro as well. Heh, or of course use memmove :) -Steve

Re: D in Ubuntu apps ecosystem

2016-02-25 Thread Joakim via Digitalmars-d
On Thursday, 25 February 2016 at 17:27:45 UTC, karabuta wrote: Maybe you might only be thinking about Android or iOS, but Ubuntu Touch (a single Ubuntu OS meant to run across multiple devices from PC to Phones) is really gaining traction. The good news is that QML is officially the way to

Re: How to detect if an array if dynamic or static

2016-02-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/24/16 9:08 PM, Adam D. Ruppe wrote: On Thursday, 25 February 2016 at 01:31:17 UTC, Chris Wright wrote: When you get to GC-allocated stuff, there's no way to tell. The GC is easy, you can simply ask it: http://dpldocs.info/experimental-docs/core.memory.GC.addrOf.1.html "If p references

Re: how do you append arrays?

2016-02-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/25/16 8:24 AM, asdf wrote: On Thursday, 25 February 2016 at 13:06:10 UTC, cym13 wrote: In D the binary operator "~" is used to concatenate both strings (arrays of characters) and arrays. (also the ~= operator is equivalent to lhs = lhs ~ rhs Nic Just a precision: "lhs ~= rhs" isn't

Re: D in Ubuntu apps ecosystem

2016-02-25 Thread Zardoz via Digitalmars-d
On Thursday, 25 February 2016 at 18:05:40 UTC, Adam D. Ruppe wrote: On Thursday, 25 February 2016 at 17:27:45 UTC, karabuta wrote: SIDE NOTE: Ubuntu just lunched a phone with 4GB ram running on a x64 Octacore Arm processors in addition to a table with similar high spec, which can all pretty

[Issue 15723] GC memory leakade depending on source code size

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15723 --- Comment #2 from Denis Shelomovskij --- (In reply to Sobirari Muhomori from comment #1) > That's probably zlib's crc table: 2048 random pointers in bss. So it looks like we actually can't use C libraries statically

Re: How to better organize dub project to get 3 exe from same codebase?

2016-02-25 Thread Suliman via Digitalmars-d-learn
Where to store shared classes?

Re: How to better organize dub project to get 3 exe from same codebase?

2016-02-25 Thread Zardoz via Digitalmars-d-learn
On Thursday, 25 February 2016 at 18:57:08 UTC, Suliman wrote: I have got 3 small projects that have shared code base. At compile time they use few same classes. On runtime they use same config file. How to better to organize work with dub? Try with subpacjages like I did : name "dedcpu"

How to better organize dub project to get 3 exe from same codebase?

2016-02-25 Thread Suliman via Digitalmars-d-learn
I have got 3 small projects that have shared code base. At compile time they use few same classes. On runtime they use same config file. How to better to organize work with dub?

Re: Swift deprecate i++ and c-style for loop

2016-02-25 Thread Steven Schveighoffer via Digitalmars-d
On 2/24/16 3:47 PM, Ola Fosheim Grøstad wrote: On Wednesday, 24 February 2016 at 18:06:19 UTC, Steven Schveighoffer wrote: I'm quite glad D stuck with the same type for arrays and array slices. And how will you get around this when not having a GC? I don't follow. D's arrays will always

Re: Pseudo-random numbers in [0, n), covering all numbers in n steps?

2016-02-25 Thread tn via Digitalmars-d
On Thursday, 25 February 2016 at 18:19:56 UTC, John Colvin wrote: I don't know of an algorithm for generating random permutations that isn't in-place (or O(N) storage), but I'm not an expert on the topic so maybe one does exist. These might be relevant:

Re: Pseudo-random numbers in [0, n), covering all numbers in n steps?

2016-02-25 Thread Andrei Alexandrescu via Digitalmars-d
On 02/25/2016 01:19 PM, John Colvin wrote: I don't think that's a good idea. A prng is closed path through a state space and it doesn't matter where you start on said path, you're going to follow the same closed path through the state space. That's totally fine for some applications - those

Re: no size yet for forward reference error

2016-02-25 Thread bachmeier via Digitalmars-d
On Thursday, 25 February 2016 at 17:33:34 UTC, Jonathan M Davis wrote: Actually, both of your examples compile for me - both with master and with 2.070.0. I'm running on x86_64 FreeBSD (which you probably aren't), which shouldn't matter for this sort of error, but I suppose that it's

Re: Pseudo-random numbers in [0, n), covering all numbers in n steps?

2016-02-25 Thread John Colvin via Digitalmars-d
On Thursday, 25 February 2016 at 17:27:25 UTC, Andrei Alexandrescu wrote: So we have https://dlang.org/phobos/std_random.html#.randomCover which needs to awkwardly allocate memory to keep track of the portions of the array already covered. This could be fixed by devising a PRNG that takes a

[Issue 11176] array.ptr in @safe code

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11176 --- Comment #12 from Steven Schveighoffer --- (In reply to Kenji Hara from comment #11) > I noticed that we already have equivalent but safer way [0]. Under @safe > attribute, it checks the 'arr' boundaries and throws RangeError

Re: Official compiler

2016-02-25 Thread rsw0x via Digitalmars-d
On Thursday, 25 February 2016 at 17:57:49 UTC, David Nadlinger wrote: I'm only playing devil's advocate because many people here make it seem as if there was no cost to supporting multiple compilers, while there most definitely is. This ranges from the blatant duplication of work over PR

Re: D in Ubuntu apps ecosystem

2016-02-25 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 25 February 2016 at 17:27:45 UTC, karabuta wrote: SIDE NOTE: Ubuntu just lunched a phone with 4GB ram running on a x64 Octacore Arm processors in addition to a table with similar high spec, which can all pretty much handle D(even with GC) IMO. You can run D with GC with 16 MB -

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 03:05:21 UTC, Walter Bright wrote: On 2/18/2016 9:52 AM, Kai Nacke wrote: I really like the compiler diversity. Me too. Having 3 major implementations is a great source of strength for D. I like it too. I just think that we can't afford it at this point,

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 02:58:08 UTC, Walter Bright wrote: A big chunk of that was getting D to catch C++ exceptions. And before I did this work, neither GDC nor LDC did, either. It's not a simple matter of just turning it on given Dwarf EH. That's beside the point, the C++ interop

Re: Shared static constructors from C# EXE

2016-02-25 Thread Thalamus via Digitalmars-d-learn
On Thursday, 25 February 2016 at 16:05:37 UTC, Benjamin Thaut wrote: On Thursday, 25 February 2016 at 14:42:14 UTC, Thalamus wrote: your entry point. Hi Guillaume, Thanks for responding so quickly! I had found that wiki page before and I'd been following the "DLLs with a C Interface"

Pseudo-random numbers in [0, n), covering all numbers in n steps?

2016-02-25 Thread Andrei Alexandrescu via Digitalmars-d
So we have https://dlang.org/phobos/std_random.html#.randomCover which needs to awkwardly allocate memory to keep track of the portions of the array already covered. This could be fixed by devising a PRNG that takes a given period n and generates all numbers in [0, n) in exactly n steps.

Re: no size yet for forward reference error

2016-02-25 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 25 February 2016 at 04:23:52 UTC, Erik Smith wrote: Here's a better reduction of the problem. Commenting out either of the lines marked HERE eliminates the error. It's some kind of interaction with templates, RefCounted, and the cross referencing types. erik module

Re: How to detect if an array if dynamic or static

2016-02-25 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 24 February 2016 at 21:48:14 UTC, mahdi wrote: Suppose we have a function like this: void diss(int[] array) ... How can we detect is `array` is static (fixed size) or dynamic, inside the function body? I don't see that anyone has mentioned it but:

D in Ubuntu apps ecosystem

2016-02-25 Thread karabuta via Digitalmars-d
Maybe you might only be thinking about Android or iOS, but Ubuntu Touch (a single Ubuntu OS meant to run across multiple devices from PC to Phones) is really gaining traction. The good news is that QML is officially the way to build apps and D already has dqml(https://github.com/filcuc/dqml).

Re: Can I get more opinions on increasing the logo size on the site please

2016-02-25 Thread anonymous via Digitalmars-d
On Wednesday, 17 February 2016 at 20:11:10 UTC, anonymous wrote: On 10.02.2016 22:31, anonymous wrote: I've shot him an email. No response for a week. Trying a GitHub @-mention now: https://github.com/D-Programming-Language/dlang.org/pull/1212#issuecomment-185381136 No response to that

[Issue 15711] Incorrect type inferring of [char]/string when passed via recursive template, extracting it from a structure field

2016-02-25 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15711 ag0ae...@gmail.com changed: What|Removed |Added Keywords||rejects-valid

Re: Official compiler

2016-02-25 Thread karabuta via Digitalmars-d
On Thursday, 25 February 2016 at 01:53:51 UTC, Walter Bright wrote: On 2/17/2016 4:35 PM, Chris Wright wrote: And since DMD is something like twice as fast as LDC, there's at least some argument in favor of keeping it around. When I meet someone new who says they settled on D in their

Re: Official compiler

2016-02-25 Thread David Nadlinger via Digitalmars-d
On Thursday, 25 February 2016 at 09:04:17 UTC, Russel Winder wrote: I wonder if anyone has noticed, or appreciated that, all the trendy, hipster cloud based CI servers support Go, sometimes C++ and C (sort of), but not Rust, or D. Travis CI, which is probably the one "trendy, hipster" service

Re: dub: how to reference a compiled package

2016-02-25 Thread Chris Wright via Digitalmars-d-learn
On Thu, 25 Feb 2016 12:15:42 +, mahdi wrote: > Hi, > > Suppose I have a package `mypack` in `~/mypack`. I run `dub` command on > this package and have the compiled `mypack` file (OS is Linux). > > Now I am working on my project. I know how to use the source-code of > `mypack` package in the

Re: Official compiler

2016-02-25 Thread karabuta via Digitalmars-d
On Thursday, 18 February 2016 at 11:12:57 UTC, Jonathan M Davis wrote: On Thursday, 18 February 2016 at 06:57:01 UTC, Kai Nacke wrote: even if DMD is the official reference compiler, the download page http://dlang.org/download.html already mentions "strong optimization" as pro of GDC/LDC vs.

  1   2   >