Re: Where the F*** is phobos on OSX nowadays ?
On 2015-08-11 10:01, John Colvin wrote: well if you're sane, then you had homebrew install it to /usr/local/lib/ and /usr/local/include/d2/ If you're sane you'll be using DVM ;) -- /Jacob Carlborg
Re: std.data.json formal review
Am 11.08.2015 um 19:30 schrieb deadalnix: Ok some actionable items. 1/ How big is a JSON struct ? What is the biggest element in the union ? Is that element really needed ? Recurse. See http://s-ludwig.github.io/std_data_json/stdx/data/json/value/JSONValue.payload.html The question whether each field is really needed obviously depends on the application. However, the biggest type is BigInt that, form a quick look, contains a dynamic array + a bool field, so it's not as compact as it could be, but also not really large. There is also an additional Location field that may sometimes be important for good error messages and the like and sometimes may be totally unneeded. However, my goal when implementing this has never been to make the DOM representation as efficient as possible. The simple reason is that a DOM representation is inherently inefficient when compared to operating on the structure using either the pull parser or using a deserializer that directly converts into a static D type. IMO these should be advertised instead of trying to milk a dead cow (in terms of performance). 2/ As far as I can see, the element are discriminated using typeid. An enum is preferable as the compiler would know values ahead of time and optimize based on this. It also allow use of things like final switch. Using a tagged union like structure is definitely what I'd like to have, too. However, the main goal was to build the DOM type upon a generic algebraic type instead of using a home-brew tagged union. The reason is that it automatically makes different DOM types with a similar structure interoperable (JSON/BSON/TOML/...). Now Phobos unfortunately only has Algebraic, which not only doesn't have a type enum, but is currently also really bad at keeping static type information when forwarding function calls or operators. The only options were basically to resort to Algebraic for now, but have something that works, or to first implement an alternative algebraic type and get it accepted into Phobos, which would delay the whole process nearly indefinitely. 3/ Going from the untyped world to the typed world and provide an API to get back to the untyped word is a loser strategy. That sounds true intuitively, but also from my experience manipulating JSON in various languages. The Nodes produced by this lib need to be manipulatable as the unstructured values they represent. It isn't really clear to me what you mean by this. What exactly about JSONValue can't be manipulated like the unstructured values [it] represent[s]? Or do you perhaps mean the JSON - deserialize - manipulate - serialize - JSON approach? That definitely is not a loser strategy*, but yes, it is limited to applications where you have a partially fixed schema. However, arguably most applications fall into that category. * OT: My personal observation is that sadly the overall tone in the community has generally become a lot less friendly over the last months. I'm a bit worried about where this may lead in the long term.
Re: std.data.json formal review
Am 11.08.2015 um 20:15 schrieb Dmitry Olshansky: On 11-Aug-2015 20:30, deadalnix wrote: Ok some actionable items. 1/ How big is a JSON struct ? What is the biggest element in the union ? Is that element really needed ? Recurse. +1 Also most JS engines use nan-boxing to fit type tag along with the payload in 8 bytes total. At least the _fast_ path of std.data.json should take advantage of similar techniques. But the array field already needs 16 bytes on 64-bit systems anyway. We could surely abuse some bits there to at least not use up more for the type tag, but before we go that far, we should first tackle some other questions, such as the allocation strategy of JSONValues during parsing, the Location field and BigInt/Decimal support. Maybe we should first have a vote about whether BigInt/Decimal should be supported or not, because that would at least solve some of the controversial tradeoffs. I didn't have a use for those personally, but at least we had the real-world issue in vibe.d's implementation that a ulong wasn't exactly representable. My view generally still is that the DOM representation is something for convenient manipulation of small chunks of JSON, so that performance is not a priority, but feature completeness is.
Re: countUntil for SortedRange
On Tuesday, 11 August 2015 at 19:30:02 UTC, Laeeth Isharc wrote: Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best way to do that? It's not clear that countUntil treats a SortedRange specially. I could get the lowerBound and then length or walkLength (can't remember which applies). But I figure there must be a better way. Thanks. Laeeth. Yeah, I was wrong when I said it was treated specially. lowerBound followed by length should do it without any notable inefficiencies. I guess you could wrap it as `sortedCountUntil` for convenience if you like.
Re: Release D 2.068.0
On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin I am sorry, but this release is horrible. It is a first time when I am force to do nothing with my codebase. Everything works as expected. So there is definitely something wrong :).
Re: std.data.json formal review
Am 04.08.2015 um 19:14 schrieb deadalnix: On Tuesday, 4 August 2015 at 13:10:11 UTC, Sönke Ludwig wrote: This is how it used to be in the vibe.data.json module. I consider that to be a mistake now for multiple reasons, at least on this abstraction level. My proposal would be to have a clean, strongly typed JSONValue and a generic jsvar like struct on top of that, which is defined independently, and could for example work on a BSONValue, too. The usage would simply be var value = parseJSONValue(...);. That is not going to cut it. I've been working with these for ages. This is the very kind of scenarios where dynamically typed languages are way more convenient. I've used both quite extensively and this is clear cut: you don't want what you call the strongly typed version of things. I've done it in many languages, including in java for instance. jsvar interface remove the problematic parts of JS (use ~ instead of + for concat strings and do not implement the opDispatch part of the API). I just said that jsvar should be supported (even in its full glory), so why is that not going to cut it? Also, in theory, Algebraic already does more or less exactly what you propose (forwards operators, but skips opDispatch and JS-like string operators).
Re: Release D 2.068.0
On Tue, Aug 11, 2015 at 15:08:21 -0700, Bill Baxter via Digitalmars-d-announce wrote: New to brew... getting errors with this on Yosemite: Error: Permission denied - /usr/local/etc/dmd.conf and sudo brew install refuses to do so. /usr/local is Apple's domain on Yosemite now. IIRC, even root can't touch it in 10.11. --Ben
Re: Release D 2.068.0
On Tuesday, 11 August 2015 at 22:08:50 UTC, Bill Baxter wrote: On Tue, Aug 11, 2015 at 12:52 AM, John Colvin via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin brew update brew reinstall dmd :) New to brew... getting errors with this on Yosemite: Error: Permission denied - /usr/local/etc/dmd.conf and sudo brew install refuses to do so. --bb Did you by any chance have dmd installed from the installer before-hand? What does `brew doctor` give you?
Re: Release D 2.068.0
On Tuesday, 11 August 2015 at 22:30:04 UTC, Ben Boeckel wrote: On Tue, Aug 11, 2015 at 15:08:21 -0700, Bill Baxter via Digitalmars-d-announce wrote: New to brew... getting errors with this on Yosemite: Error: Permission denied - /usr/local/etc/dmd.conf and sudo brew install refuses to do so. /usr/local is Apple's domain on Yosemite now. IIRC, even root can't touch it in 10.11. --Ben Not true. AFAIK /usr/local is the only bit of /usr that *is* available for third-parties.
Re: D for Game Development
On 8/11/2015 12:57 AM, Benjamin Thaut wrote: Also the front end transition from C++ to D hits me hard also. It's going to hit everyone hard who works on the front end.
Code Reviewer
Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea is to have 6 final implementations ( 3 compile-time and 3 runtime) . I think am basically done with the coding, but being a beginner myself, I feel I need some do some critics so I can improve (especially on the compiletime ones). I could have uploaded direct but I think the code may be way too long. Help will be dearly appreciated.
Re: Release D 2.068.0
On Tue, Aug 11, 2015 at 3:28 PM, John Colvin via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On Tuesday, 11 August 2015 at 22:08:50 UTC, Bill Baxter wrote: On Tue, Aug 11, 2015 at 12:52 AM, John Colvin via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin brew update brew reinstall dmd :) New to brew... getting errors with this on Yosemite: Error: Permission denied - /usr/local/etc/dmd.conf and sudo brew install refuses to do so. --bb Did you by any chance have dmd installed from the installer before-hand? No, just installed brew last night. What does `brew doctor` give you? Ah, that mentions that a bunch of paths aren't writeable and suggests I chown them. Warning: /usr/local/bin isn't writable. Warning: /usr/local/etc isn't writable. Warning: /usr/local/sbin isn't writable. Warning: The /usr/local directory is not writable. Might be something to do with corp setup. brew install went fine but said it was changing all those dirs to be group-writeable and group 'admin'. But they don't appear to be so now: $ ls -ld /usr/local/bin drwxr-xr-x 77 root wheel 2618 Aug 10 18:06 /usr/local/bin Running the chmod and chgrp commands from the brew install over again does allow the 'brew install dmd' command to complete without error. --bb
Re: D for Game Development
On Monday, 10 August 2015 at 05:23:20 UTC, Walter Bright wrote: On 8/9/2015 9:26 PM, Tofu Ninja wrote: On Sunday, 9 August 2015 at 20:51:32 UTC, Walter Bright wrote: On 8/9/2015 4:38 AM, Manu via Digitalmars-d wrote: On 9 August 2015 at 15:31, Walter Bright via Digitalmars-d I agree, and now we ship a Phobos DLL, resolving that issue. Really? Where is it? (I can't see it in the distribution). Should be in the bin directory. There is no Phobos dll, only Phobos lib. There's linux/lib32/libphobos2.so, for example. But that is linux. You can't say phobos dll because everyone then expects dlls to work on windows, which still isn't the case. Its correct that we have a shared library version of phobos on linux, but a shared library version of phobos on windows is still in the future. I'm currently working on it, but there are so many issues with the language design, the export keyword, the module level visibility system the unittests etc etc that its going to take some more time. Also the front end transition from C++ to D hits me hard also.
Re: Where the F*** is phobos on OSX nowadays ?
On Tuesday, 11 August 2015 at 04:51:03 UTC, deadalnix wrote: And why does it keep moving ? Why isn't it in some place where linker will find it ? Is that really worth it to have every build system to have to jump through hoops to find it, and to break it on a regular basis ? well if you're sane, then you had homebrew install it to /usr/local/lib/ and /usr/local/include/d2/ :p
DWT fails to build with DMD 2.068.0
Hi, Is there an updated release for DWT - it fails to build with the latest version of DMD - mainly casting errors... Thanks. Regards, Mike.
Re: Release D 2.068.0
On Tuesday, 11 August 2015 at 08:27:00 UTC, Marc Schütz wrote: Packages for openSUSE 13.1, 13.2, Factory and Tumbleweed are now available in devel:languages:D. http://download.opensuse.org/repositories/devel:/languages:/D/ Please could you update/correct the entry here to reflect that: http://wiki.dlang.org/Compilers#Package_and.2For_binary_availability.2C_by_platform_and_compiler thanks :)
[Issue 14901] [reg 2.067/2.068] template static shared this() run multiple times with separate compilation
https://issues.dlang.org/show_bug.cgi?id=14901 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #2 from Walter Bright bugzi...@digitalmars.com --- The cause of this is not excessive instantiation, it is the fragile name generation system. --
Re: D for Game Development
On Monday, 10 August 2015 at 19:31:55 UTC, David Gileadi wrote: …[insert your language here] has a long way to go… :) Yes, the real culprit is getting really good IDE support, and for that one need to write a high quality analyzer that can provide more information than a compiler. As far as the language goes, I'd prefer a minimalistic core language backed up with a normalizing and caching solver. I don't really think fast initial compile time is all that important, if he compiler caches intermediate results intelligently I think one can get decent compilation speeds still.
Re: Release D 2.068.0
Packages for openSUSE 13.1, 13.2, Factory and Tumbleweed are now available in devel:languages:D. http://download.opensuse.org/repositories/devel:/languages:/D/
Suggestion: arrays.
From dlang: Static array properties are: ... .dup Create a dynamic array of the same size and copy the contents of the array into it. .idup Create a dynamic array of the same size and copy the contents of the array into it. The copy is typed as being immutable. ... Dynamic array properties are: ... .dup Create a dynamic array of the same size and copy the contents of the array into it. .idup Create a dynamic array of the same size and copy the contents of the array into it. The copy is typed as being immutable. D 2.0 only ... The problem: 'dup' is an abbreviation of 'duplicate'. However, for static arrays, result is not a true duplicate of the source. But, for dynamic arrays, result is a true duplicate. So the same abbreviation produces two different effects. Bugsource? Suggested solution: For static arrays, replace '.dup' with '.dyn' (and similarly for 'idup'). Use of 'dyn' would also add clarity.
Re: D for Game Development
On Monday, 10 August 2015 at 19:34:26 UTC, rsw0x wrote: On Monday, 10 August 2015 at 19:31:55 UTC, David Gileadi wrote: On 8/10/15 12:25 PM, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= ola.fosheim.grostad+dl...@gmail.com wrote: [...] …[insert your language here] has a long way to go… :) Which is why I think people are attracted towards D. It's very close to being there. The large elephant in the room is the garbage collector. Every way to work around it feels like a massive, ugly hack. Yes, it is not a good fit for D. Although, I find the Pony-lang approach interesting, but that is an actor language so it should not be compared to D, but to vibe.d. Pony uses a per heap GC, a cross actor GC, and actor collection (collecting the whole actor and heap when the actor cannot receive more messages). Each actor (fiber in D) does not have a stack, the stack is per thread so I believe you yield when the stack has been unwound, they only use C-ABI when calling C functions. But they also have an advanced pointer type system that can distinguish between at least 6 different reference-aliasing situations (or was it 12?). https://www.youtube.com/watch?v=KvLjy8w1G_U Anyway, it is refreshing. Maybe D can pick up some ideas from Pony.
[Issue 14905] duplicate error message: 'Warning: statement is not reachable'
https://issues.dlang.org/show_bug.cgi?id=14905 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- (In reply to Timothee Cour from comment #2) (In reply to Kenji Hara from comment #1) They're not true duplication. If the error messages print their enclosing functions, the messages will be: main.d(3): Warning: statement is not reachable in 'main.fun!a.fun' main.d(3): Warning: statement is not reachable in 'main.fun!b.fun' But it doesn't. Either way, that's a technicality, it's the same root cause and should not result in dups. Technically they're not dup. The two errors come from two different instantiated functions. So, I think the two errors should not be merged into one. --
Re: Suggestion: arrays.
On Tuesday, 11 August 2015 at 08:59:50 UTC, DLearner wrote: From dlang: Static array properties are: ... .dup Create a dynamic array of the same size and copy the contents of the array into it. .idup Create a dynamic array of the same size and copy the contents of the array into it. The copy is typed as being immutable. ... Dynamic array properties are: ... .dup Create a dynamic array of the same size and copy the contents of the array into it. .idup Create a dynamic array of the same size and copy the contents of the array into it. The copy is typed as being immutable. D 2.0 only ... The problem: 'dup' is an abbreviation of 'duplicate'. However, for static arrays, result is not a true duplicate of the source. But, for dynamic arrays, result is a true duplicate. So the same abbreviation produces two different effects. Bugsource? Suggested solution: For static arrays, replace '.dup' with '.dyn' (and similarly for 'idup'). Use of 'dyn' would also add clarity. 2 choices: 1) break people's code and documentation by renaming .dup on static arrays 2) have 2 equivalent names for the same thing Neither is likely to happen. If you want it for your own code: T[] dyn(T, size_t n)(T[n] a) { return a.dup; }
Re: Release D 2.068.0
On Tuesday, 11 August 2015 at 09:04:42 UTC, John Colvin wrote: On Tuesday, 11 August 2015 at 08:27:00 UTC, Marc Schütz wrote: Packages for openSUSE 13.1, 13.2, Factory and Tumbleweed are now available in devel:languages:D. http://download.opensuse.org/repositories/devel:/languages:/D/ Please could you update/correct the entry here to reflect that: http://wiki.dlang.org/Compilers#Package_and.2For_binary_availability.2C_by_platform_and_compiler thanks :) Done.
[Issue 14905] duplicate error message: 'Warning: statement is not reachable'
https://issues.dlang.org/show_bug.cgi?id=14905 Timothee Cour timothee.co...@gmail.com changed: What|Removed |Added CC||timothee.co...@gmail.com --- Comment #2 from Timothee Cour timothee.co...@gmail.com --- (In reply to Kenji Hara from comment #1) They're not true duplication. If the error messages print their enclosing functions, the messages will be: main.d(3): Warning: statement is not reachable in 'main.fun!a.fun' main.d(3): Warning: statement is not reachable in 'main.fun!b.fun' But it doesn't. Either way, that's a technicality, it's the same root cause and should not result in dups. Here's the message that prompted me to file this bug: inifiled/source/inifiled.d(33): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable inifiled/source/inifiled.d(42): Warning: statement is not reachable when compiling Dscanner with local modification to get latest libdparse. --
Re: Binary file grammar
On Monday, 10 August 2015 at 12:29:43 UTC, wobbles wrote: I have to read a binary file. I can use std.stdio.File.rawRead to do this (and it's even typesafe, awesome!!) [...] https://github.com/atilaneves/cerealed If that doesn't do what you need, I've done something wrong. Atila
Re: Release D 2.068.0
On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin brew update brew reinstall dmd :)
[Issue 14900] 2.068.0 change log example does not compile
https://issues.dlang.org/show_bug.cgi?id=14900 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||rejects-valid --- Comment #6 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4876 --
[Issue 14889] ICE: Assertion `o-dyncast() == DYNCAST_DSYMBOL' failed.
https://issues.dlang.org/show_bug.cgi?id=14889 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords|ice-on-valid-code |pull Hardware|x86_64 |All OS|Linux |All --- Comment #1 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4876 --
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #1 from Walter Bright bugzi...@digitalmars.com --- Throwing in a destructor is a nightmare, it makes my brain hurt just trying to figure out what 'should' happen. I've proposed before that destructors should be nothrow. --
Re: D for Game Development
On Sun, Aug 9, 2015 at 12:33 AM, Walter Bright via Digitalmars-d digitalmars-d@puremagic.com wrote: On 8/9/2015 12:18 AM, Iain Buclaw via Digitalmars-d wrote: If the libraries were shared, this would reduce linking time, which in various benchmarks I've done is where most small projects spend the majority of their time doing. But no one has as of yet come up with a feasibly implementable idea to do that. We ship Phobos as a shared library on Linux, OSX and FreeBSD. on OSX I only see libphobos2.a (including dmd 2.068)
Re: vibe.d 0.7.24 released
On Monday, 10 August 2015 at 17:27:56 UTC, Sönke Ludwig wrote: A new vibe.d release is out. Apart from support for the 2.068 D frontend, some of the major changes are: - The vibe.web.web module adds support for convenient WebSocket routes - Renamed SSL to TLS (with compatibility aliases, of course) - Json.opDispatch and Bson.opDispatch are scheduled for deprecation There are a lots of additional changes and bug fixes listed in the change log: http://vibed.org/blog/posts/vibe-release-0.7.24 Homepage: http://vibed.org/ DUB package: http://code.dlang.org/packages/vibe-d GitHub: https://github.com/rejectedsoftware/vibe.d Thanks for the work. vibe.d is awesome
[Issue 14901] [reg 2.067/2.068] template static shared this() run multiple times with separate compilation
https://issues.dlang.org/show_bug.cgi?id=14901 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- (In reply to Walter Bright from comment #2) The cause of this is not excessive instantiation, it is the fragile name generation system. Yes, the ultimate root issue is it. But if the code for the instance make!bar is generated and stored only in b.obj, the problem does not happen. So, the regression from 2.067 is introduced by the excessive instantiation. The issue should be fixed ASAP. --
Re: D fund
On Mon, 10 Aug 2015 16:58:13 +, vladde wrote: Will the swag feature http://dlangcomicstrips.tumblr.com/ ? you told them about our little secret! how dare you?!. p.s. no, i'm not the author. signature.asc Description: PGP signature
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 --- Comment #3 from David Nadlinger c...@klickverbot.at --- Note that all those cases do not (yet) fail because of the throwing dtors. It's that the dtors aren't even invoked in the first place. --
[Issue 14901] [reg 2.067/2.068] template static shared this() run multiple times with separate compilation
https://issues.dlang.org/show_bug.cgi?id=14901 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added CC||schvei...@yahoo.com --- Comment #4 from Steven Schveighoffer schvei...@yahoo.com --- Does this have any bearing/relation to https://issues.dlang.org/show_bug.cgi?id=14517 ? --
[Issue 11581] Given T..., new T[0] does not work
https://issues.dlang.org/show_bug.cgi?id=11581 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull, rejects-valid --- Comment #2 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4878 --
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 --- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com --- Imagine resource management with reference counting, then destructors can throw due to environmental issues. (stdio.File destructor throws) --
Re: Binary file grammar
On Tue, 11 Aug 2015 07:51:37 +, Atila Neves wrote: On Monday, 10 August 2015 at 12:29:43 UTC, wobbles wrote: I have to read a binary file. I can use std.stdio.File.rawRead to do this (and it's even typesafe, awesome!!) [...] https://github.com/atilaneves/cerealed If that doesn't do what you need, I've done something wrong. a strange thing: i myself used only cerealed, but somehow keep thinking that it was orange, and speaking about orange. i should setup autoreplacement in my nntp client... signature.asc Description: PGP signature
Re: Release D 2.068.0
On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: See the changelog for more details. http://dlang.org/changelog.html#2.068.0 Something that's not obvious about phobos `hexString` CT template, it's not reflected in the DDOC, but it works with the `import` expression, and i think it was the primary goal, for example if you have an hex dump that's likely to represent some ASCII chars, in a file named file.txt: --- import std.conv; writeln( hexString!(import(file.txt))); --- Coedit users can use this easily because the folder of a runnable module is always added to the string import path (-J). For example they just have to put the dump files into the folder where stand the script...et voilà compile file run works directly without error about the import() folder.
Re: D fund
On 11/08/2015 4:58 a.m., vladde wrote: On Monday, 10 August 2015 at 01:34:24 UTC, Walter Bright wrote: On 8/9/2015 6:52 AM, Andrei Alexandrescu wrote: There will be a possibility with the D Language Foundation, hopefully by the end of this year. -- Andrei Looking forward to it. We can also use the foundation to sell some D swag so that people will get something for their donation. After all, nothing is cooler than wearing a D t-shirt to a C++/Java/Go/Rust convention! Will the swag feature http://dlangcomicstrips.tumblr.com/ ? Yeah who is making them? I'd love to add them as part of my stream!
Re: D fund
On 08/10/2015 01:10 PM, Tofu Ninja wrote: Would be great if D could have full time paid devs working on it. Totally. That would be a dream job @_@
Re: Suggestion: arrays.
On Tuesday, 11 August 2015 at 09:08:57 UTC, John Colvin wrote: 2 choices: 1) break people's code and documentation by renaming .dup on static arrays 2) have 2 equivalent names for the same thing Neither is likely to happen. If you want it for your own code: T[] dyn(T, size_t n)(T[n] a) { return a.dup; } The OP could also make it a property to make it even more similar. Perhaps the least amount of work would be if alias worked on functions (I don't see anything in the docs about that). The broader issue that it is very easy to mix up static and dynamic arrays remains.
Problem with dmd 2.068 Win 32
Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake?
Re: vibe.d 0.7.24 released
I can't understand why I can't build vibed with 2.068 C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(631): Error: '_d_monitorenter' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(631): Error: '_d_monitorexit' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(622): Error: function 'vibe.core.drivers.libevent2.Libevent 2ManualEvent.emit' is nothrow yet may throw I wrote in dub.json: vibe-d: 0.7.24 but it's downloading 0.7.23 version. After command dub upgrade I am getting: D:\code\httpAppdub upgrade Upgrading project in D:\code\httpApp Error executing command upgrade: Root package httpapp contains reference to invalid package vibe-d
Re: Binary file grammar
On Tuesday, 11 August 2015 at 07:51:39 UTC, Atila Neves wrote: On Monday, 10 August 2015 at 12:29:43 UTC, wobbles wrote: I have to read a binary file. I can use std.stdio.File.rawRead to do this (and it's even typesafe, awesome!!) [...] https://github.com/atilaneves/cerealed If that doesn't do what you need, I've done something wrong. Atila Yep, this seems to do the job! I'll investigate tonight, and pester you later :D
Re: vibe.d 0.7.24 released
On Monday, 10 August 2015 at 18:23:25 UTC, Sönke Ludwig wrote: The main technical reason was CT reflections issues (the particular case was that they had always been erroneously recognized as input ranges) and the fact that any API change involving the Json struct would potentially be a silently breaking change. Another thing that I personally always felt was that the syntax had the effect of unconsciously hiding bugs, because it *looks* like static field access, so your brain thinks that the compiler checks for things like spelling mistakes. Aye, good points. Ideally, I'd love to see statically defined structs for everything with easy to/from serialization. The serialization part is easy - the trickier part is getting the right struct definition. I started working on an analyzer thing that takes a real world data sample and creates a struct from it. Actually, my main reason for doing that was reverse engineering a third party API - reading a struct definition is easier than reading json IMO - but it'd have nice benefits for these too. Most dynamic types really are static, you just don't always know the layout at compile time. But with a bit of ahead-of-time analyzers of the data, we can basically bridge that without needing a whole lot of extra work.
[Issue 14901] [reg 2.067/2.068] template static shared this() run multiple times with separate compilation
https://issues.dlang.org/show_bug.cgi?id=14901 --- Comment #5 from Kenji Hara k.hara...@gmail.com --- (In reply to Steven Schveighoffer from comment #4) Does this have any bearing/relation to https://issues.dlang.org/show_bug.cgi?id=14517 ? Unfortunately, it is not related with. --
Re: vibe.d 0.7.24 released
Am 11.08.2015 um 15:28 schrieb Suliman: I can't understand why I can't build vibed with 2.068 C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(631): Error: '_d_monitorenter' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(631): Error: '_d_monitorexit' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core\drivers\libevent2.d(622): Error: function 'vibe.core.drivers.libevent2.Libevent 2ManualEvent.emit' is nothrow yet may throw I wrote in dub.json: vibe-d: 0.7.24 but it's downloading 0.7.23 version. After command dub upgrade I am getting: D:\code\httpAppdub upgrade Upgrading project in D:\code\httpApp Error executing command upgrade: Root package httpapp contains reference to invalid package vibe-d That's probably due to an annoying side effect of the metadata cache. Try to rerun after doing dub clean-caches.
Re: vibe.d 0.7.24 released
On Tuesday, 11 August 2015 at 14:14:10 UTC, Suliman wrote: I still can't get 0.7.24. My config is: dependencies: { vibe-d: 0.7.24 }, [...] Try going to your packages directory and actually deleting the 0.7.23 folder? (Remember, backup!)
Re: Problem with dmd 2.068 Win 32
On Tuesday, 11 August 2015 at 15:04:29 UTC, MGW wrote: Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake? See the changelog. The compiler is now pickier if you forgot to link something explicitly.
Re: vibe.d 0.7.24 released
I still can't get 0.7.24. My config is: dependencies: { vibe-d: 0.7.24 }, D:\code\httpAppdub clean-caches D:\code\httpAppdub build Fetching vibe-d 0.7.23 (getting selected version)... Placing vibe-d 0.7.23 to C:\Users\bubenkov_di\AppData\Roaming\dub\packages\... Selected package vibe-d 0.7.23 does not match the dependency specification 0.7.2 4 in package httpapp. Need to dub upgrade? Selected package libasync 0.7.5 does not match the dependency specification 0.7. 1 in package vibe-d. Need to dub upgrade? Building vibe-d 0.7.23 configuration libevent, build type debug. Running dmd... C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core \drivers\libevent2.d(631): Error: '_d_monitorenter' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core \drivers\libevent2.d(631): Error: '_d_monitorexit' is not nothrow C:\Users\bubenkov_di\AppData\Roaming\dub\packages\vibe-d-0.7.23\source\vibe\core \drivers\libevent2.d(622): Error: function 'vibe.core.drivers.libevent2.Libevent 2ManualEvent.emit' is nothrow yet may throw
Re: vibe.d 0.7.24 released
Am 11.08.2015 um 16:14 schrieb Suliman: I still can't get 0.7.24. My config is: dependencies: { vibe-d: 0.7.24 }, D:\code\httpAppdub clean-caches D:\code\httpAppdub build (...) C:\Users\bubenkov_di\AppData\Roaming\dub\packages\... Selected package vibe-d 0.7.23 does not match the dependency specification 0.7.24 in package httpapp. Need to dub upgrade? Did you try to run dub upgrade again after the clean-caches? This is necessary, because dub.selections.json is supposed to be able to manually override dependency specifications in dub.json.
Re: D fund
On Tuesday, 11 August 2015 at 14:26:45 UTC, Nick Sabalausky wrote: On 08/10/2015 01:10 PM, Tofu Ninja wrote: Would be great if D could have full time paid devs working on it. Totally. That would be a dream job @_@ I know right, where can I apply?
[Issue 14906] New: dmd dumps core at incorrect enum declaration
https://issues.dlang.org/show_bug.cgi?id=14906 Issue ID: 14906 Summary: dmd dumps core at incorrect enum declaration Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: sdegtia...@yahoo.com dmd v2.067.1 dumps core at this simple code: enum A; void f(A) {} The enum declaration is obviously incorrect and wouldn't compile anyway. However, dmd crashes at once with no error echoed. --
Re: Problem with dmd 2.068 Win 32
Thanks to all! The problem is localized!
Re: Problem with dmd 2.068 Win 32
On Tuesday, 11 August 2015 at 15:04:29 UTC, MGW wrote: Hi! My project has an error link: Error 42: Symbol Undefined _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception On dmd 2.067.* everything gathered without mistakes. Where to look for a mistake? Try ddemangle (part of the distribution). ddemangle _D6object9Exception6__ctorMFNaNbNfAyaAyakC6object9ThrowableZC9Exception - pure nothrow @safe Exception object.Exception.__ctor(immutable(char)[], immutable(char)[], uint, object.Throwable) In the current release @nogc was added. https://github.com/D-Programming-Language/druntime/blob/v2.068.0/src/object.d#L1614 You either have a wrong import paths (check which dmd.conf is used with 'dmd -v non_existent') or a stable object_.di file.
Re: Problem with dmd 2.068 Win 32
On Tuesday, 11 August 2015 at 15:10:57 UTC, Dominikus Dittes Scherkl wrote: See the changelog. The compiler is now pickier if you forgot to link something explicitly. That shouldn't affect an Exception constructor through since they are part of the core druntime. I suspect it has to do with the update leaving some old files behind... might help to clean out the old dir and reinstall the dmd.
Re: Problem with dmd 2.068 Win 32
On Tuesday, 11 August 2015 at 15:18:31 UTC, Martin Nowak wrote: You either have a wrong import paths (check which dmd.conf is used with 'dmd -v non_existent') or a stable object_.di file. Or maybe a stale .obj or .lib file, referencing the old symbol. Try a make clean too - delete any .obj and .lib files in your project directory and rebuild.
Re: Where the F*** is phobos on OSX nowadays ?
On Tuesday, 11 August 2015 at 16:12:12 UTC, Sebastiaan Koppe wrote: On Tuesday, 11 August 2015 at 08:01:53 UTC, John Colvin wrote: On Tuesday, 11 August 2015 at 04:51:03 UTC, deadalnix wrote: And why does it keep moving ? Why isn't it in some place where linker will find it ? Is that really worth it to have every build system to have to jump through hoops to find it, and to break it on a regular basis ? well if you're sane, then you had homebrew install it to /usr/local/lib/ and /usr/local/include/d2/ :p Does homebrew install to those folders by default? yes
Re: Where the F*** is phobos on OSX nowadays ?
On Tuesday, 11 August 2015 at 08:01:53 UTC, John Colvin wrote: On Tuesday, 11 August 2015 at 04:51:03 UTC, deadalnix wrote: And why does it keep moving ? Why isn't it in some place where linker will find it ? Is that really worth it to have every build system to have to jump through hoops to find it, and to break it on a regular basis ? well if you're sane, then you had homebrew install it to /usr/local/lib/ and /usr/local/include/d2/ :p Does homebrew install to those folders by default?
[Issue 14907] New: DMD crash when using template name as a default value of template's typed argument
https://issues.dlang.org/show_bug.cgi?id=14907 Issue ID: 14907 Summary: DMD crash when using template name as a default value of template's typed argument Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: czda...@gmail.com Hey, this code makes the compiler crash (I know it isn't valid): module main; private struct Template( void var = Template ) {} void main() { Template!() instance; } --
DDT 0.13.0 released - DUB configurations support.
A new DDT release (nicknamed Candy Kingdom ) is out, please read the changelog: https://github.com/bruno-medeiros/DDT/releases/tag/Release_0.13.0 This is Release Candidate quality, there might be a few undiscovered bugs with the recently introduced functionality. -- Bruno Medeiros https://twitter.com/brunodomedeiros
Re: std.data.json formal review
On Tuesday, 11 August 2015 at 17:08:39 UTC, Atila Neves wrote: On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila I forgot to give warnings that the two week period was about to be up, and was unsure from comments if this would be ready for voting, so let's give it another two days unless there are objections. Atila Ok some actionable items. 1/ How big is a JSON struct ? What is the biggest element in the union ? Is that element really needed ? Recurse. 2/ As far as I can see, the element are discriminated using typeid. An enum is preferable as the compiler would know values ahead of time and optimize based on this. It also allow use of things like final switch. 3/ Going from the untyped world to the typed world and provide an API to get back to the untyped word is a loser strategy. That sounds true intuitively, but also from my experience manipulating JSON in various languages. The Nodes produced by this lib need to be manipulatable as the unstructured values they represent.
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 ki...@gmx.net changed: What|Removed |Added CC||ki...@gmx.net --- Comment #4 from ki...@gmx.net --- Well, what 'should' happen looks pretty straight-forward to me - the dtors of all live temporaries are to be called in any case, and any exceptions thrown by dtors are to be linked to an exception chain. That's what D already does for params/locals, as shown by case 1. I just find it sad that such a horrible bug can make it into a 2nd fresh release. It's literally one of the first things I was thinking about when tackling proper destruction of complex expression trees for LDC. We definitely need more testing, and define test cases and expected outcomes before implementing new, non-trivial features. --
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 --- Comment #5 from David Nadlinger c...@klickverbot.at --- *** Issue 14902 has been marked as a duplicate of this issue. *** --
[Issue 14902] Temporaries in argument expressions not properly destructed on throw (argprefix)
https://issues.dlang.org/show_bug.cgi?id=14902 David Nadlinger c...@klickverbot.at changed: What|Removed |Added Status|NEW |RESOLVED CC||c...@klickverbot.at Resolution|--- |DUPLICATE --- Comment #2 from David Nadlinger c...@klickverbot.at --- Apparently we both reported an issue within seconds of each other. Closing this one for the one Walter commented on. *** This issue has been marked as a duplicate of issue 14903 *** --
Re: Binary file grammar
On Tuesday, 11 August 2015 at 13:40:52 UTC, wobbles wrote: On Tuesday, 11 August 2015 at 07:51:39 UTC, Atila Neves wrote: On Monday, 10 August 2015 at 12:29:43 UTC, wobbles wrote: I have to read a binary file. I can use std.stdio.File.rawRead to do this (and it's even typesafe, awesome!!) [...] https://github.com/atilaneves/cerealed If that doesn't do what you need, I've done something wrong. Atila Yep, this seems to do the job! I'll investigate tonight, and pester you later :D Pester away! That's what I get for putting it out there. :P Atila
Re: DDT 0.13.0 released - DUB configurations support.
On Tuesday, 11 August 2015 at 17:03:35 UTC, Bruno Medeiros wrote: A new DDT release (nicknamed Candy Kingdom ) is out, please read the changelog: https://github.com/bruno-medeiros/DDT/releases/tag/Release_0.13.0 This is Release Candidate quality, there might be a few undiscovered bugs with the recently introduced functionality. Great work! Thanks. Is the next one going to be Ice Kingdom?
Re: std.data.json formal review
On 11-Aug-2015 20:30, deadalnix wrote: On Tuesday, 11 August 2015 at 17:08:39 UTC, Atila Neves wrote: On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila I forgot to give warnings that the two week period was about to be up, and was unsure from comments if this would be ready for voting, so let's give it another two days unless there are objections. Atila Ok some actionable items. 1/ How big is a JSON struct ? What is the biggest element in the union ? Is that element really needed ? Recurse. +1 Also most JS engines use nan-boxing to fit type tag along with the payload in 8 bytes total. At least the _fast_ path of std.data.json should take advantage of similar techniques. 2/ As far as I can see, the element are discriminated using typeid. An enum is preferable as the compiler would know values ahead of time and optimize based on this. It also allow use of things like final switch. 3/ Going from the untyped world to the typed world and provide an API to get back to the untyped word is a loser strategy. That sounds true intuitively, but also from my experience manipulating JSON in various languages. The Nodes produced by this lib need to be manipulatable as the unstructured values they represent. -- Dmitry Olshansky
Re: std.data.json formal review
On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote: Start of the two week process, folks. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ Atila I forgot to give warnings that the two week period was about to be up, and was unsure from comments if this would be ready for voting, so let's give it another two days unless there are objections. Atila
[Issue 14903] Destructors for arguments completely broken
https://issues.dlang.org/show_bug.cgi?id=14903 --- Comment #6 from ki...@gmx.net --- --- import core.stdc.stdio; struct Struct { int a = 6; ~this() { printf(dtor\n); throw new Exception(big bang); } } int foo(bool doThrow) { printf(foo()\n); if (doThrow) throw new Exception(bla); return 1; } void main() { bool doThrow = true; int r = Struct().a + foo(doThrow); } --- DMD 2.068.0, Win32: foo() dtor dtor dtor ... crash Works as expected if there's only a single throw (either in foo() or in dtor). --
countUntil for SortedRange
Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best way to do that? It's not clear that countUntil treats a SortedRange specially. I could get the lowerBound and then length or walkLength (can't remember which applies). But I figure there must be a better way. Thanks. Laeeth.
Re: Infinity loop with dates comparison
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote: Date startDate = Date.fromISOExtString(2014-08-01); [...] Date nextday; while (nextday currentDate) { nextday = startDate + 1.days; writeln(nextday); } startDate doesn't change, so every iteration just sets nextday to 2014-08-01 + 1 day = 2014-08-02.
Re: Infinity loop with dates comparison
On Tuesday, 11 August 2015 at 19:56:02 UTC, Suliman wrote: The code look very trivial, but I am getting infinity loop like: 2014-Aug-02 2014-Aug-02 2014-Aug-02 ... 2014-Aug-02 Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current day is not finished writeln(startDate); writeln(currentDate); Date nextday; while (nextday currentDate) { nextday = startDate + 1.days; writeln(nextday); } This isn't a D problem, you just always set nextday to the same value that doesn't change (startDate + 1.days). Maybe what you meant was: nextday = startDate; while (nextday currentDate) { nextday = nextday + 1.days; writeln(nextday); }
Infinity loop with dates comparison
The code look very trivial, but I am getting infinity loop like: 2014-Aug-02 2014-Aug-02 2014-Aug-02 ... 2014-Aug-02 Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current day is not finished writeln(startDate); writeln(currentDate); Date nextday; while (nextday currentDate) { nextday = startDate + 1.days; writeln(nextday); }
Re: Infinity loop with dates comparison
On Tue, Aug 11, 2015 at 07:56:00PM +, Suliman via Digitalmars-d-learn wrote: [...] Date startDate = Date.fromISOExtString(2014-08-01); Date currentDate = to!(Date)(Clock.currTime()-1.days); //because current day is not finished writeln(startDate); writeln(currentDate); Date nextday; while (nextday currentDate) { nextday = startDate + 1.days; ^ Because you're always computing from startDate, which is constant. That should be 'nextday' instead. writeln(nextday); } T -- Making non-nullable pointers is just plugging one hole in a cheese grater. -- Walter Bright
Re: std.data.json formal review
On Tuesday, 11 August 2015 at 21:27:48 UTC, Sönke Ludwig wrote: That is not going to cut it. I've been working with these for ages. This is the very kind of scenarios where dynamically typed languages are way more convenient. I've used both quite extensively and this is clear cut: you don't want what you call the strongly typed version of things. I've done it in many languages, including in java for instance. jsvar interface remove the problematic parts of JS (use ~ instead of + for concat strings and do not implement the opDispatch part of the API). I just said that jsvar should be supported (even in its full glory), so why is that not going to cut it? Also, in theory, Algebraic already does more or less exactly what you propose (forwards operators, but skips opDispatch and JS-like string operators). Ok, then maybe there was a misunderstanding on my part. My understanding was that there was a Node coming from the parser, and that the node could be wrapped in some facility providing a jsvar like API. My position is that it is preferable to have whatever DOM node be jsvar like out of the box rather than having to wrap it into something to get that.
Re: Where the F*** is phobos on OSX nowadays ?
Not at all, I am using dvm and I like it. But OTOH it makes things sometimes wierd. My common habit is to do something like this: dmd somefile ./somefile. But without dvm I use latest (current installed vesion of dmd) but with dvm I use last setup vesion. And often I do not know which version of dmd I am using. Jacob Carlborg via Digitalmars-d digitalmars-d@puremagic.com napsal Út, srp 11, 2015 v 11∶04 : On 2015-08-11 10:01, John Colvin wrote: well if you're sane, then you had homebrew install it to /usr/local/lib/ and /usr/local/include/d2/ If you're sane you'll be using DVM ;) -- /Jacob Carlborg
Re: Release D 2.068.0
On Tue, Aug 11, 2015 at 12:52 AM, John Colvin via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin brew update brew reinstall dmd :) New to brew... getting errors with this on Yosemite: Error: Permission denied - /usr/local/etc/dmd.conf and sudo brew install refuses to do so. --bb
Convert a hex color string into r,g,b components.
When programming i have encountered a simple ( i think ) problem, yet i can't get my head around it. I am trying to convert a string ( like #FF00FF for magenta ) into a color. I figured out that i need to skip the first character '#' and then using chunks range convert each pair of 2 chars into a number and assign it to specific component. The snippet looks like this Color color; auto chunk = chunks( str[1..$], 2 ); color.r = to!ubyte( chunk.front, 16 ); chunk.popFront; color.g = to!ubyte( chunk.front, 16 ); chunk.popFront; color.b = to!ubyte( chunk.front, 16 ); chunk.popFront; But the compilation fails, stating /usr/include/dlang/dmd/std/conv.d(295): Error: template std.conv.toImpl cannot deduce function from argument types !(ubyte)(Take!string, int), candidates are: /usr/include/dlang/dmd/std/conv.d(361):std.conv.toImpl(T, S)(S value) if (isImplicitlyConvertible!(S, T) !isEnumStrToStr!(S, T) !isNullToStr!(S, T)) /usr/include/dlang/dmd/std/conv.d(475):std.conv.toImpl(T, S)(ref S s) if (isRawStaticArray!S) /usr/include/dlang/dmd/std/conv.d(491):std.conv.toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) is(typeof(S.init.opCast!T()) : T) !isExactSomeString!T !is(typeof(T(value /usr/include/dlang/dmd/std/conv.d(542):std.conv.toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) is(T == struct) is(typeof(T(value /usr/include/dlang/dmd/std/conv.d(591):std.conv.toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) is(T == class) is(typeof(new T(value /usr/include/dlang/dmd/std/conv.d(295):... (9 more, -v to show) ... source/engine/graphics/core.d(43): Error: template instance std.conv.to!ubyte.to!(Take!string, int) error instantiating I would really love to solve this problem using ranges, because i am learning how to use them. Unfortunately even such a simple task seems so hard for me ;(
Re: Convert a hex color string into r,g,b components.
On Tuesday, 11 August 2015 at 22:11:51 UTC, Marcin Szymczak wrote: /usr/include/dlang/dmd/std/conv.d(295): Error: template std.conv.toImpl cannot deduce function from argument types !(ubyte)(Take!string, int), candidates are: I don't think to! with the base given works on the chunked ranges, it just works on regular strings. I would really love to solve this problem using ranges, because i am learning how to use them. Unfortunately even such a simple task seems so hard for me ;( meh, I'd just slice the string.
Re: Where the F*** is phobos on OSX nowadays ?
On Tuesday, 11 August 2015 at 05:40:01 UTC, Brad Anderson wrote: On Tuesday, 11 August 2015 at 04:51:03 UTC, deadalnix wrote: And why does it keep moving ? Why isn't it in some place where linker will find it ? Is that really worth it to have every build system to have to jump through hoops to find it, and to break it on a regular basis ? The problem, as usual, is Apple just breaking things willy nilly. https://issues.dlang.org/show_bug.cgi?id=14801 Say what you will about Microsoft but at least with them you don't have to fix a handful of new bugs with every minor OS or IDE upgrade. Slow clap...
Re: std.data.json formal review
On Tuesday, 11 August 2015 at 21:06:24 UTC, Sönke Ludwig wrote: See http://s-ludwig.github.io/std_data_json/stdx/data/json/value/JSONValue.payload.html The question whether each field is really needed obviously depends on the application. However, the biggest type is BigInt that, form a quick look, contains a dynamic array + a bool field, so it's not as compact as it could be, but also not really large. There is also an additional Location field that may sometimes be important for good error messages and the like and sometimes may be totally unneeded. Urg. Looks like BigInt should steal a bit somewhere instead of having a bool like this. That is not really your lib's fault, but that's quite an heavy cost. Consider this, if the struct fit into 2 registers, it will be passed around as such rather than in memory. That is a significant difference. For BigInt itself, and, by proxy, for the JSON library. Putting the BigInt thing aside, it seems like the biggest field in there is an array of JSONValues or a string. For the string, you can artificially limit the length by 3 bits to stick a tag. That still give absurdly large strings. For the JSONValue case, the alignment on the pointer is such as you can steal 3 bits from there. Or as for string, the length can be used. It seems very realizable to me to have the JSONValue struct fit into 2 registers, granted the tag fit in 3 bits (8 different types). I can help with that if you want to. However, my goal when implementing this has never been to make the DOM representation as efficient as possible. The simple reason is that a DOM representation is inherently inefficient when compared to operating on the structure using either the pull parser or using a deserializer that directly converts into a static D type. IMO these should be advertised instead of trying to milk a dead cow (in terms of performance). Indeed. Still, JSON nodes should be as lightweight as possible. 2/ As far as I can see, the element are discriminated using typeid. An enum is preferable as the compiler would know values ahead of time and optimize based on this. It also allow use of things like final switch. Using a tagged union like structure is definitely what I'd like to have, too. However, the main goal was to build the DOM type upon a generic algebraic type instead of using a home-brew tagged union. The reason is that it automatically makes different DOM types with a similar structure interoperable (JSON/BSON/TOML/...). That is a great point that I haven't considered. I'd go the other way around about it: providing a compatible typeid based struct from the enum tagged one for compatibility. It can even be alias this so the transition is transparent. The transformation is not bijective, so that'd be great to get the most restrictive form (the enum) and fallback on the least restrictive one (alias this) when wanted. Now Phobos unfortunately only has Algebraic, which not only doesn't have a type enum, but is currently also really bad at keeping static type information when forwarding function calls or operators. The only options were basically to resort to Algebraic for now, but have something that works, or to first implement an alternative algebraic type and get it accepted into Phobos, which would delay the whole process nearly indefinitely. That's fine. Done is better than perfect. Still API changes tend to be problematic, so we need to nail that part at least, and an enum with fallback on typeid based solution seems like the best option. Or do you perhaps mean the JSON - deserialize - manipulate - serialize - JSON approach? That definitely is not a loser strategy*, but yes, it is limited to applications where you have a partially fixed schema. However, arguably most applications fall into that category. Yes.
[Issue 14907] DMD crash when using template name as a default value of template's typed argument
https://issues.dlang.org/show_bug.cgi?id=14907 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||ice, pull Hardware|x86_64 |All OS|Windows |All --- Comment #1 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4882 --
Re: Derelict, SDL, and OpenGL3: Triangle Tribulations
On Wednesday, 12 August 2015 at 05:35:30 UTC, Mike Parker wrote: One of the best I've seen is by Anton Gerdelan [1]. The four [1] http://antongerdelan.net/opengl/index.html
[Issue 14874] __traits(getFunctionAttributes) does not support the new `return` attribute
https://issues.dlang.org/show_bug.cgi?id=14874 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0c1fd7108015d06e120178b7d8de6cd7caad6283 Merge pull request #4868 from MetaLang/master Fix Issue 14874 - __traits(getFunctionAttributes) does not support the new `return` attribute --
Re: Derelict, SDL, and OpenGL3: Triangle Tribulations
On Wednesday, 12 August 2015 at 03:32:47 UTC, DarthCthulhu wrote: So, any ideas what I'm doing wrong? Too much to list. I suggest you get going with a good tutorial. One of the best I've seen is by Anton Gerdelan [1]. The four basic tutorials he has on his site will be enough to get you up and running. He used to have a lot more there, but he's published them all in a book. Even though there are numerous free resources online, I think Anton's ebook is well worth the ~$9.00 you pay for it. His tutorials are quite detailed and do a lot more than showing you a bunch of code to copy and paste. Work your way through that book and you'll know your way around well enough to do what you need to do for any basic OpenGL renderer.
Re: Derelict, SDL, and OpenGL3: Triangle Tribulations
On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: static this() { DerelictGL3.load; DerelictGL.load; DerelictSDL2.load; SDL_Init(SDL_INIT_VIDEO); } I should point out that *either* DerelictGL3 *or* DerelictGL should be loaded, but never both. DerelictGL actually extends DerelictGL3. When you call load on it, it calls super.load (ditto for reload), with the net effect that you're loading all of the DerelictGL3 stuff twice. If you need the deprecated stuff, just use DerelictGL; if you don't, just use DerelictGL3.
Re: Derelict, SDL, and OpenGL3: Triangle Tribulations
On Wednesday, 12 August 2015 at 05:34:22 UTC, BBasile wrote: For me the following code works: --- import derelict.sdl2.sdl; import derelict.opengl3.gl3; import derelict.opengl3.gl; import std.stdio; static this() { DerelictGL3.load; DerelictGL.load; DerelictSDL2.load; SDL_Init(SDL_INIT_VIDEO); } static ~this() { SDL_Quit(); DerelictGL3.unload; DerelictSDL2.unload; } GLuint initVAO () { // An array of 3 vectors which represents 3 vertices static const GLfloat[] g_vertex_buffer_data = [ -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, ]; // This will identify our vertex buffer GLuint vertexbuffer; // Generate 1 buffer, put the resulting identifier in vertexbuffer glGenBuffers(1, vertexbuffer); // The following commands will talk about our 'vertexbuffer' buffer glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); // Give our vertices to OpenGL. glBufferData(GL_ARRAY_BUFFER, g_vertex_buffer_data.length * GL_FLOAT.sizeof, g_vertex_buffer_data.ptr, GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, null); glBindBuffer(GL_ARRAY_BUFFER, 0); return vertexbuffer; } void main(string[] args) { auto flags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE; auto win = SDL_CreateWindow( null, 50, 50, 800, 600, flags); auto ctxt = SDL_GL_CreateContext(win); DerelictGL3.reload; GLuint vertexbuffer = initVAO(); SDL_Event ev; while (true) { if (SDL_WaitEvent(ev)) { glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBindVertexArray(vertexbuffer); // Draw the triangle glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(vertexbuffer); glBindVertexArray(0); SDL_GL_SwapWindow(SDL_GL_GetCurrentWindow()); } if (ev.type == SDL_QUIT) break; } SDL_DestroyWindow(win); SDL_GL_DeleteContext(ctxt); } --- It looks like it's the window/context creation that fail for you because the OpenGL code is 100% the same. It seems to me that your driver is doing things it isn't actually supposed to do. This code is binding a vertex buffer object with a function which is supposed to bind a vertex array object. The only reason the vbo is bound at all is because of the call to glBindBuffer in the misnamed initVAO -- a function which never even initializes a vao. The spec actually requires a vao to be created and a shader program to be bound, so I would expect a conforming driver to show nothing. I expect a couple of calls to glError will not come up empty.
Re: Release D 2.068.0
On Tue, 11 Aug 2015 20:54:15 +, Daniel Kozak wrote: On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin I am sorry, but this release is horrible. It is a first time when I am force to do nothing with my codebase. Everything works as expected. So there is definitely something wrong :). you should fill a regression bug, i think. signature.asc Description: PGP signature
[Issue 14906] dmd dumps core at incorrect enum declaration
https://issues.dlang.org/show_bug.cgi?id=14906 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||ice, pull Hardware|x86_64 |All OS|Linux |All Severity|normal |major --- Comment #1 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4881 --
Re: Code Reviewer
On 12/08/2015 10:50 a.m., Clayton wrote: Hello everyone, Am looking for someone who could help review my code . As an entry exercise to D am converting 3 C implementations of popular pattern matching algorithms. The idea is to have 6 final implementations ( 3 compile-time and 3 runtime) . I think am basically done with the coding, but being a beginner myself, I feel I need some do some critics so I can improve (especially on the compiletime ones). I could have uploaded direct but I think the code may be way too long. Help will be dearly appreciated. Upload to e.g. Github/gist/pastebin.
Re: Derelict, SDL, and OpenGL3: Triangle Tribulations
On Wednesday, 12 August 2015 at 03:32:47 UTC, DarthCthulhu wrote: So I decided to try some OGL3 stuff in D utilizing the Derelict bindings and SDL. Creating an SDL-OGL window worked fine, but I'm having trouble with doing the most basic thing of rendering a triangle. I get the window just fine and the screen is being properly cleared and buffered, but no triangle. So, any ideas what I'm doing wrong? For me the following code works: --- import derelict.sdl2.sdl; import derelict.opengl3.gl3; import derelict.opengl3.gl; import std.stdio; static this() { DerelictGL3.load; DerelictGL.load; DerelictSDL2.load; SDL_Init(SDL_INIT_VIDEO); } static ~this() { SDL_Quit(); DerelictGL3.unload; DerelictSDL2.unload; } GLuint initVAO () { // An array of 3 vectors which represents 3 vertices static const GLfloat[] g_vertex_buffer_data = [ -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, ]; // This will identify our vertex buffer GLuint vertexbuffer; // Generate 1 buffer, put the resulting identifier in vertexbuffer glGenBuffers(1, vertexbuffer); // The following commands will talk about our 'vertexbuffer' buffer glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer); // Give our vertices to OpenGL. glBufferData(GL_ARRAY_BUFFER, g_vertex_buffer_data.length * GL_FLOAT.sizeof, g_vertex_buffer_data.ptr, GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, null); glBindBuffer(GL_ARRAY_BUFFER, 0); return vertexbuffer; } void main(string[] args) { auto flags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE; auto win = SDL_CreateWindow( null, 50, 50, 800, 600, flags); auto ctxt = SDL_GL_CreateContext(win); DerelictGL3.reload; GLuint vertexbuffer = initVAO(); SDL_Event ev; while (true) { if (SDL_WaitEvent(ev)) { glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glBindVertexArray(vertexbuffer); // Draw the triangle glDrawArrays(GL_TRIANGLES, 0, 3); glDisableVertexAttribArray(vertexbuffer); glBindVertexArray(0); SDL_GL_SwapWindow(SDL_GL_GetCurrentWindow()); } if (ev.type == SDL_QUIT) break; } SDL_DestroyWindow(win); SDL_GL_DeleteContext(ctxt); } --- It looks like it's the window/context creation that fail for you because the OpenGL code is 100% the same.
Re: Release D 2.068.0
On Tue, Aug 11, 2015 at 22:36:47 +, John Colvin via Digitalmars-d-announce wrote: Not true. AFAIK /usr/local is the only bit of /usr that *is* available for third-parties. Ah, mixed it up with this tidbit: The /usr/local folder remains accessible, however; it's a long-running convention in Unix and variants as a place to stash material and software that individual users rely on. El Capitan will also remove files from those directories that don't belong to Apple. So it isn't safe over an upgrade, but is accessible. --Ben
Re: countUntil for SortedRange
On Tuesday, 11 August 2015 at 21:38:49 UTC, John Colvin wrote: On Tuesday, 11 August 2015 at 19:30:02 UTC, Laeeth Isharc wrote: Hi. Basic question: suppose I have a SortedRange and want to find the index of the first entry of an array of structs matching a needle struct. What's the best way to do that? It's not clear that countUntil treats a SortedRange specially. I could get the lowerBound and then length or walkLength (can't remember which applies). But I figure there must be a better way. Thanks. Laeeth. Yeah, I was wrong when I said it was treated specially. lowerBound followed by length should do it without any notable inefficiencies. I guess you could wrap it as `sortedCountUntil` for convenience if you like. Thanks, John. Laeeth
[Issue 13567] Attribute inference for private functions
https://issues.dlang.org/show_bug.cgi?id=13567 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #2 from Walter Bright bugzi...@digitalmars.com --- Example: private void bar() { } void foo() @safe { bar(); } should work. --
Re: Release D 2.068.0
On 12/08/2015 8:54 a.m., Daniel Kozak wrote: On Monday, 10 August 2015 at 08:48:52 UTC, Martin Nowak wrote: Glad to announce D 2.068.0. http://downloads.dlang.org/releases/2.x/2.068.0/ This release comes with many rangified phobos functions, 2 new GC profilers, a new AA implementation, and countless further improvements and fixes. See the changelog for more details. http://dlang.org/changelog.html#2.068.0 -Martin I am sorry, but this release is horrible. It is a first time when I am force to do nothing with my codebase. Everything works as expected. So there is definitely something wrong :). Hahahaha thats funny!
[Issue 10706] Functions that require a sorted range to take a SortedRange?
https://issues.dlang.org/show_bug.cgi?id=10706 Collin Reeser collin.ree...@gmail.com changed: What|Removed |Added CC||collin.ree...@gmail.com --- Comment #1 from Collin Reeser collin.ree...@gmail.com --- I was actually burned by this today. Coinciding with the release of 2.068 (though I didn't initially know the release was upon us!), Travis builds for my project started inexplicably failing. The root cause was that a setSymmetricDifference call, which had been working for many months, was suddenly giving nonsense results. One of the inputs to the call was a .keys() on an associative array. Presumably, it just-so-happened that the .keys() was yielding sorted output, but with the change to the internals of the associative arrays this release, it just-so-happened that the .keys() result wasn't sorted! Since I misunderstood the documentation of setSymmetricDifference to mean is-sortable-by 'less', and not must have been, prior to input, sorted by 'less', I didn't initially put the .sort() call after the .keys() call. Too bad so sad. Figured it out, but lost some time to it. --
[Issue 14908] New: dmd's rewrite is exposed in error message: Error: 's += 1' is not a scalar, it is a S
https://issues.dlang.org/show_bug.cgi?id=14908 Issue ID: 14908 Summary: dmd's rewrite is exposed in error message: Error: 's += 1' is not a scalar, it is a S Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: minor Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: acehr...@yahoo.com The compiler rewrites ++s as 's += 1' and uses it in an error message. This can be confusing especially to new programmers: struct S {} void main() { S s; ++s; } Error: 's += 1' is not a scalar, it is a S Ali --