Re: Classical bug
On Tuesday, 27 January 2015 at 12:02:59 UTC, Vladimir Panteleev wrote: Always. But the check seems very simple, and is easily circumvented. This compiles: byte[] func() { byte[1024] buffer; auto p = buffer[0..3]; return p; } I think this is the first step of a long and difficult way. byte[] func(byte[] a) { return a[0..1]; } byte[] func1() { byte[1024] buffer; return func(buffer[1...$]); } byte[] func2() { static byte[1024] buffer; return func(buffer[1..$]); }
Re: NEW asm.dlang.org site
Thanks for the good work! It would be really nice if in the future we could compare DMD, GDC and LDC (and SDC when it becomes more usable) at asm.dlang.org. (Btw a nice choice of name :) ) I have a couple of questions about the output when looking at a C++[1] program and the same in GDC[2] and DMD[3](I am not very familiar with assembly): 1) Syntax: AFAIU, (_D)main pushes 3 and 4 to the stack and calls (example.)add. Then (example.)add loads them from the stack in two registers and adds them. IIRC, dmd passes parameters in reverse order (of the normal C way) and that's why pushing and loading 3 and 4 from the stack is in reverse order. However why does DMD use hex instead of decimal notation? [I was also a little confused about positive vs negative indexing of bp and the order of src and dst in the arguments to movl, but then I noticed that I am comparing x86 and x86_64, so I managed to answer those questions myself :D ] 2) _Dmain: I also noticed that the output of gdc-4.4 and gdc-4.6 does not include a label for _Dmain (nor the regular C main). Is this a problem of the disassembly, or just how older version of GDC produced code? [1]: http://goo.gl/mUQKiX (permalink at http://gcc.godbolt.org/) [2]: http://goo.gl/CmYbrZ (permalink at http://explore.dgnu.org/) [3]: http://goo.gl/ZHHVuZ (permalink at http://asm.dlang.org/) On Monday, 26 January 2015 at 23:46:24 UTC, Iain Buclaw wrote: Hi, It is my pleasure to release a new site onto the community. An Interactive DMD compiler. http://asm.dlang.org/ Inspired by Matt Godbolt's GCC Explorer[1], and my own hosted version that uses GDC[2]. I was asked by Andrei to fork and make a working protoype that uses DMD. All work is hosted on Github[3], and we are planning on moving it to part of the D-Programming-Language repositories. Please share, contribute, and destroy! Regards Iain. [1]: http://gcc.godbolt.org/ [2]: http://explore.dgnu.org/ [3]: https://github.com/ibuclaw/gcc-explorer/
Re: extern(C) symbol conflicts
Does this work? void main() { version(test1)test1.cfunction(); else test2.cfunction(); } All symbols belong to modules.
Re: Virtual functions and inheritance
V Tue, 27 Jan 2015 04:38:57 + David Monagle via Digitalmars-d-learn digitalmars-d-learn@puremagic.com napsáno: Hi guys, I'm a former C++ developer and really enjoying working with D now. I have a question that I hope some of you may be able to answer. class Parent { @property string typeName() { return typeof(this).stringof; } } class Child : Parent { } void main() { auto p = new Parent; auto c = new Child; assert(p.typeName == Parent); assert(p.typeName == Child); } I'm looking for an explanation as to why this doesn't work, then a suggestion for how I may achieve child classes being able to generate a string description of their own type, without redefining the typeName property on each child. (I'm currently solving this with a mixin, but I was hoping for a better solution. I'm assuming it doesn't work because either typeof(this) or .stringof is evaluated at compile time? You can use this T: class Parent { @property string typeName(this T)() { return T.stringof; } } class Child : Parent { } void main() { auto p = new Parent; auto c = new Child; assert(p.typeName == Parent); assert(c.typeName == Child); }
[Issue 14052] `dmd -deps` lists imports from failed __traits(compiles) blocks
https://issues.dlang.org/show_bug.cgi?id=14052 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Kenji Hara k.hara...@gmail.com --- For the module dependency tracking, -deps should list all modules that were trying to import in the compiled code. Therefore current -deps output is legitimete and not have to be changed. --
D Management Site
Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful.
[website redesign] PR for the one with the big red menu bar
PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color.
Re: extern(C) symbol conflicts
On 1/27/15 5:57 AM, Walter Bright wrote: On 1/26/2015 11:06 AM, Steven Schveighoffer wrote: Is there a good reason why we shouldn't allow the duplicate declaration in multiple modules? I understand for D symbols -- those are actually different symbols. D's interface to C and C++ does not adopt C and C++ semantics, in particular, it does not adopt C and C++ name lookup rules, function overloading rules, template instantiation rules, etc. This is on purpose to reduce the complexity of the language. I never said anything about C++. I don't see how that is relevant. C has no overloading rules or template instantiation rules. As in C and C++, it is up to the D programmer to follow the One Definition Rule when interfacing with those languages. Declaring the same function in multiple modules is a bad idea. The problem I see is that C bindings are easy to make. If I need to reference I function, I just declare it. If some other library writer needs the same function, he declares it. But now, if anyone wants to use both libraries, you have to pick one or the other, even though they are the same. I understand the idea behind keeping the lookup rules consistent. But C lookup rules ARE simple. I would say if two extern(C) declarations are identical (i.e. same parameter types, same attributes), they don't conflict. What does this break? -Steve
Oplink PR Ping
I created a PR for optlink about 7 months ago and I don't think it's been looked at. PR: https://github.com/DigitalMars/optlink/pull/16 Bug: https://issues.dlang.org/show_bug.cgi?id=4831 Can someone take a look?
Re: D Management Site
Jonathan Marler johnnymar...@gmail.com wrote: On Tuesday, 27 January 2015 at 18:25:21 UTC, Andrei Alexandrescu wrote: On 1/27/15 10:10 AM, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. We used http://trello.com for a while, it didn't catch up. Stuff we're working on, help welcome: http://goo.gl/N28FaC Stuff we're currently not working on, help welcome: http://goo.gl/lqKrsT Thanks! Andrei Yes looking at PRs and Issues on github does solve the problems I posted. There are other issues I could list but I didn't know that the community has already tired this before (trello). Maybe not the best use of my time then. I will say I agreed with your post about us needing to focus on the important features. Since you have a much bigger picture of what's important to get done, could you list a few features you think are the highest priority to get done that aren't being worked on? I could take a gander and try to tackle one. Thanks. I will, and soon. I've been planning to do so since Jan 1st.
Re: static class vs. static struct
On 01/27/2015 08:58 AM, Piotrek wrote: Nice list. :) 1. static variable struct A{int a} // no static before declaration static A s; //note that static is used for struct variable storage class (lifetime) static int b; etc. 2. static declaration static struct A{int a}; //static used for context unnesting static int fun(){}; // static used also for removing scope context Of course that includes static member functions, where the 'this' pointer is removed. Actually, static opCall is kind of different because it makes the type itself callable. etc. 3. static if static if(compile_time_cond) { //this section of code will be taken into the binary, used for meta programming } Another use of 'static' that means at compile time: static assert 4. Module initialization and deinitialization: static this shared static this static ~this shared static ~this 5. Module import: static import std.stdio; Ali
Re: One area where D has the edge
On Tuesday, 27 January 2015 at 15:09:36 UTC, Laeeth Isharc wrote: I cannot speak about small team experiences. Our projects usually take around 30+ developers. That it is a decent sized team to have to coordinate and it puts emphasis on very different questions. The context I am thinking of is much leaner - more like special forces than the regular army (I mean in terms of flexibility and need to respond quickly to changing circumstances) - although the sums at stake are likely comparable to larger teams (the area is hedge fund portfolio management). In terms of server applications, yes when the applications are deployed usually the memory usage might not be optimal. For you that is less important, and I suppose that comes from the intrinsic nature of the situation. You have beefy machines serving many users, I suppose? I am thinking of a purpose where there are only a handful of users, but the data sets may be larger than we are used to working with, requiring more work than just plain map reduce, and where rapid iteration and prototyping is important. Also to minimize cognitive overload and complexity. A friend has written an article on big data in finance for Alpha magazine, and I will post a link here once it has been published. One problem in economics is you have to forecast the present, because the numbers are published with a lag and themselves reflect decisions taken months previously. But markets are forward looking and discount a future that may be imagined but cannot be understood based only on hard facts. So we need all the help we can get, particularly during an epoch where things change all the time, (eurchf fx rate moved forty percent in a day...). Bridgewater have taken the work of Hal Varian and applied it to use media and web analytics to get a good live cut of economic activity and inflation. Although it is not a tough problem theoretically, people don't actually do as much as they could yet - I think finance is behind tech companies, but they are catching up. Another fund that my friend writes about uses employee sentiment to pick stocks to be long and short of - they manage a few billion and have done quite well. However that is why profiling and language knowledge is required. Yes, I can imagine, and it sounds like not just that Java is the best option for you, but perhaps the only viable one. I am curious though - what do you think the memory footprint is as a ratio to C++ before and after fine tuning? And what proportion of development time does this take? Actually we use more than just Java. JVM languages, .NET languages, C++ (only on the realm of JNI/PInvoke/COM), JavaScript Memory optimizations only take place if really requested by the customer, from their acceptance tests, which is seldom the case. Usually one to two sprints might be spent. Fine tuning a Java application is no different than other compiled languages, it just requires to know which knobs to turn. I liked a quote by a certain C++ guru talking about the experience of a Facebook, to the effect that a sensible first draft written in C++ would perform decently, whereas this was not true always of other languages. Now their trade off between programmer productivity and execution efficiency is extreme, but is this merely an edge case of little relevance for the rest of us, or is it a Gibsonian case of the future being already here, and just not evenly distributed? I am no expert, but I wonder if the latter may be more true than generally appreciated. For example, foreach allocates and a simple for does not, so choose wisely how to iterate. Would love to hear any other insights you have on this topic. There ought to be a FAQ on getting along with the GC for fun and profit. Java ONE, Skills Matter and Microsoft BUILD have performance talks every now and then. Then there is the mechanical sympathy blog and mailing list. http://mechanical-sympathy.blogspot.de/ The thing that Java still looses in memory management, even in commercial JVMs, is lack of value types since escape analysis algorithms are not very aggressive, but support is being designed and will land partially in Java 9 and Java 10 time frame. That was my real point - and that it does really matter in some areas, and that these are growing very quickly. (I appreciate that someone reading my post quickly would see the 15% power thing and focus on that, which was not so much my point - although I am still suspicious of the idea that Java will always keep up with native code without doing a lot of extra work). People on the Slashdot thread were saying what is the point of D. But the way I saw it, where is the real competition for my use case? I can't be extravagant with memory, but I still need rapid development and productivity. We all have a tendency to think that what we know from experience and reading is the full picture, but the
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On Tuesday, 27 January 2015 at 15:45:47 UTC, bearophile wrote: Gan: How can I make it use less CPU/RAM? Most tiny classes probably should be structs. More generally, use a struct every time you don't need a class. You can start with those two: struct SBRange { double left = 0.0, right = 0.0, top = 0.0, bottom = 0.0; } struct Point(T) { T x, y; } This probably isn't enough to solve your problems, but it's a start. Bye, bearophile Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? On a second question, do I ever need to manually release objects I create with new?
Re: Oplink PR Ping
On Tuesday, 27 January 2015 at 19:35:44 UTC, H. S. Teoh wrote: On Tue, Jan 27, 2015 at 07:01:02PM +, Jonathan Marler via Digitalmars-d wrote: I created a PR for optlink about 7 months ago and I don't think it's been looked at. PR: https://github.com/DigitalMars/optlink/pull/16 Bug: https://issues.dlang.org/show_bug.cgi?id=4831 Can someone take a look? Probably Walter is the only person who is qualified to look at optlink PRs. Maybe ping him directly? T How do I ping him directly?
Re: [website redesign] PR for the one with the big red menu bar
On 1/27/15 3:02 PM, anonymous wrote: PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color. This one has my vote. -Steve
[Issue 2138] Allow more than 65535 files in Zip archives
https://issues.dlang.org/show_bug.cgi?id=2138 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/8cc228c4e97b5bc2be2e6ed338faf5bcaed6336b Fix Issue 2138 - Allow more than 65535 files in Zip archives Fixed by adding support for reading and writing Zip64 archives https://github.com/D-Programming-Language/phobos/commit/ad5ae8767fbe54f9e0b15aa12d64e81daeaf43db Merge pull request #2914 from fgda/issue_2138 Fix Issue 2138 - Allow more than 65535 files in Zip archives --
Kythe
Google just open sourced https://github.com/google/kythe. Would it help Calypso? -- Andrei
Re: D Management Site
On Tuesday, 27 January 2015 at 18:25:21 UTC, Andrei Alexandrescu wrote: On 1/27/15 10:10 AM, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. We used http://trello.com for a while, it didn't catch up. Stuff we're working on, help welcome: http://goo.gl/N28FaC Stuff we're currently not working on, help welcome: http://goo.gl/lqKrsT Thanks! Andrei Yes looking at PRs and Issues on github does solve the problems I posted. There are other issues I could list but I didn't know that the community has already tired this before (trello). Maybe not the best use of my time then. I will say I agreed with your post about us needing to focus on the important features. Since you have a much bigger picture of what's important to get done, could you list a few features you think are the highest priority to get done that aren't being worked on? I could take a gander and try to tackle one. Thanks.
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile
Re: Calypso and the future of D
On Tuesday, 27 January 2015 at 16:39:40 UTC, Elie Morisse wrote: On Monday, 26 January 2015 at 19:35:11 UTC, Laeeth Isharc wrote: I posted some thoughts on web docs writeup of C+= interface here. http://forum.dlang.org/thread/fmjehcyzhnirybmnj...@forum.dlang.org#post-fmjehcyzhnirybmnjloj:40forum.dlang.org Do you think we could make binaries of calypso available for download ? I know it is alpha, but it is so strategically important, and just getting clang to build is not always so easy given the stuff in gcc 4.9 with size__align_t ? We should mention calypso in the web docs, and link to it too (with appropriate caveats). It feel slightly too early, Calypso shouldn't be far from getting most of the C++ standard library to work but it still chokes on most tangles of templates (afaics it all boils down to a few issues). Also operators, function templates and merging latest LDC would be nice and not a lot of work away (last merge was mid-October, before better Win64 ABI support). As soon as this is done I'll make builds for Windows and Linux users. Thanks. People like to play with things when it is easy, and bear in mind what the present alternative is. But I respect your desire to maintain a standard of quality.
Re: std.zip
On 2015-01-26 at 03:41, Vladimir Panteleev wrote: How about submitting this patch as a pull request? Thanks for this suggestion. The expanded patch is now merged: https://github.com/D-Programming-Language/phobos/pull/2914
Re: accept @pure @nothrow @return attributes
On 27/01/2015 18:01, Jonathan Marler wrote: On Tuesday, 27 January 2015 at 17:18:11 UTC, Nick Treleaven wrote: On 27/01/2015 16:49, Jonathan M Davis via Digitalmars-d wrote: abstract also applies to classes, as does final. Yes, but they actually only affect the *functions* belonging to the class, not the variables. A class is not a variable. I think you may have missed the point. I believe what Jonathan is saying is that if you turn abstract into @abstract then you have to consider how to solve the abstract class issue. Do you change it to: @abstract class ? Yes, because it affects the class's functions, not its variable members. Same thing with final. Since the same keywords are used in a lot of different contexts, if you change how it is used in one context then it's going to be inconsistent with how it's used in the other contexts (like with a function or a class). Then if you want consistency (which is the point of why we are discussing this change in the first place) you have to change every context it is used in. If you follow through with your proposal, you'll end up putting a '@' character before almost every keyword in the language In that case I don't think you've really grokked my proposal. It only requires 5 changes to attributes for consistency (and that's counting @pure and @nothrow).
Re: D Management Site
On 1/27/15 10:10 AM, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. We used http://trello.com for a while, it didn't catch up. Stuff we're working on, help welcome: http://goo.gl/N28FaC Stuff we're currently not working on, help welcome: http://goo.gl/lqKrsT Thanks! Andrei
[Issue 2138] Allow more than 65535 files in Zip archives
https://issues.dlang.org/show_bug.cgi?id=2138 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 14053] Hello world generates bloat in the object file
https://issues.dlang.org/show_bug.cgi?id=14053 --- Comment #4 from Iain Buclaw ibuc...@gdcproject.org --- The best thing DMD can do is to not rely on these artificial function helpers, and just inline whatever code it is they're emitting. --
Re: One area where D has the edge
Out of curiosity, what is lacking in the current commercial offerings for hedge fund management? Why not use an existing engine? In the general sense, lots is lacking across the board. I started a macro fund in 2012 with a former colleague from Citadel in partnership with another company, with the idea that they would provide infrastructure as they had experience in this domain. I should not say more, but let's say that I was not so happy with my choice of corporate partner. This experience made me think more carefully about the extent to which one needs to understand and control technology in my business. One of the things that was striking was the very limited set of choices available for a portfolio management system. Macro involves trading potentially any liquid product in any developed (and sometimes less developed) market, so it doesn't fit well with product offerings that have a product silo mentality. One uses a portfolio management system very intensively, so user interface matters. But very few of the offerings available seemed even to be passable. We ended up going with these guys who have a decent system because it was spun out of a hedge fund but if you asked me about passable alternatives, I do not know if there are any. http://www.tfgsystems.com/ There are of course specific challenges for macro and for startup funds that may not be generally true of the domain - it is a big area and what people need may be different. Larger funds use a combination of third party technologies and their own bits, but I am not sure that everyone is perfectly happy with what they have. I formerly jointly ran fixed income in London for Citadel, a big US fund, so have some background in the area. Things changed a lot since then, and I certainly wouldn't want to speak about Citadel. It's a funny domain, because the numbers are more like a large business, but there are not all that many people involved. People on the investment side don't necessarily have a technology background, or have the time and attention to spare to hone their specification of exactly how they want things to work. So one can have a strange experience of on paper being in a situation where one ought to have one's pick of systems, but in practice feeling starved of resources and control. This is one of the reasons I decided to spend time refreshing my technology skills, even though by conventional wisdom the basic tenets of opportunity cost and division of labour would suggest there is no point. Things have changed a lot in the past twenty years, and the only way to keep up is to get one's hands dirty now and then. Again on the resources front - given what happened in 2008, there has been an understandable focus on reporting, compliance, and the like. It's a surprisingly brittle business because your costs are fixed, whereas revenues depend on performance and assets and investment strategies tend to intrinsically experience an ebb and flow whilst it is human nature to extrapolate performance and investors, being human, tend to chase returns. So it's not today necessarily the fashion to have a large group of people to develop ideas and tools that might pay off, but where it is hard to demonstrate that they will beforehand. There has been a cultural change in the industry accompany its institutionalisation, so it's today much more 'corporate' in mindset than it once was, and this shift has not only positive aspects. In many cases, you can kind of do what you want in theory using Bloomberg. The problem is that it is closed, and with a restrictive API, so if you want to refine your analysis, that becomes limiting. But because you can do a lot that way (and it is presented very attractively) it's not so easy to justify rebuilding some functionality from scratch in order to have control. To take am almost trivial example, Bloomberg offers the ability to receive an alert by email when market hit various price conditions (or certain very basic technical analysis indicators are triggered). That's valuable, but not enough for various reasons: one needs to maintain the alerts by hand (last I checked); I don't trust email for delivery of something important; and I want to be able to consider more complex conditions. One could do this in a spreadsheet, but that's not in my opinion the way to run a business. Python is fine for this kind of thing, but I would rather engineer the whole thing in a better way, since the analytics are shared between functions. Or to take another example, charting and data management platforms for institutional traders remain unsatisfactory. It's not easy to pull data in to Bloomberg, and to do so in an automated way where your data series are organized. One wants to have all the data in one place and be able to run analyses on them, and I am not aware of a satisfactory platform available for this. Quite honestly,
Re: Oplink PR Ping
On Tue, Jan 27, 2015 at 07:01:02PM +, Jonathan Marler via Digitalmars-d wrote: I created a PR for optlink about 7 months ago and I don't think it's been looked at. PR: https://github.com/DigitalMars/optlink/pull/16 Bug: https://issues.dlang.org/show_bug.cgi?id=4831 Can someone take a look? Probably Walter is the only person who is qualified to look at optlink PRs. Maybe ping him directly? T -- Written on the window of a clothing store: No shirt, no shoes, no service.
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile Thanks. I'll give structs a try. When I start the program, it runs fine at 35mb of ram. It only keeps 15 objects stored in the arrays at a time so why do you think my ram usage increases to 700+ after many hours?
Re: static class vs. static struct
On 01/27/2015 08:33 AM, Piotrek wrote: Non-static means nested. Hmm,this can be misleading. Nesting in structs doesn't introduce context pointer. You must be thinking of structs nested inside user-defined types. Structs that are nested inside functions do have the context pointer. Ali
[Issue 14053] Hello world generates bloat in the object file
https://issues.dlang.org/show_bug.cgi?id=14053 Iain Buclaw ibuc...@gdcproject.org changed: What|Removed |Added CC||ibuc...@gdcproject.org --- Comment #3 from Iain Buclaw ibuc...@gdcproject.org --- I believe this would be the change in https://github.com/D-Programming-Language/dmd/pull/3552 As I understand it, the symbols are put on comdat, so would be emitted in compiles, but cleaned out in the link phase (or maybe post-strip). --
Re: DlangUI
On Saturday, 14 June 2014 at 19:40:58 UTC, Jim Hewes wrote: Very nice, thanks. I'm looking forward to trying it out when I can find the time. I'm not a big fan of bindings/wrappers. Jim This is looks fantastic. I tried the demo but I get an error: SDL_GL_CreateContext failed: Failed creating OpenGL context Running Mac OS 10.10.2 on 2011 Macbook Pro
Re: accept @pure @nothrow @return attributes
On Tue, 27 Jan 2015 08:47:43 +, Paolo Invernizzi wrote: On Tuesday, 27 January 2015 at 08:07:11 UTC, ketmar wrote: On Tue, 27 Jan 2015 01:32:21 +, Mike wrote: i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. I'm interested! I'm interested! ;-P Our jobs are similar: we have to scout out new technologies for our companies, and, with an hand on the hearth and fingers crossed, we have to judge the risks/benefits about spending money and time on them. It's not an easy job in my opinion, expecially nowadays with all that trees in the forest... I strongly believe in D, and we have migrated all our major projects over it, but sometimes, when I'm alone with my thoughts, I not sure if the force is strong in me like at the beginning... Well, we'll see: alea iacta est. i believe in D too, and i want it to succeed -- not only for me. that's why i'm writing here. i'm not attacking it for the sake of attack, and i deliberately took the position of outcast. signature.asc Description: PGP signature
[Issue 13726] Build Phobos and Druntime with stack frames enabled (-gs)
https://issues.dlang.org/show_bug.cgi?id=13726 --- Comment #15 from Sobirari Muhomori dfj1es...@sneakemail.com --- (In reply to Walter Bright from comment #2) Every bit of performance matters. D is constantly being compared for speed with other tools. Building phobos for maximum debugging support is completely at odds with performance. Not for debugging, but for decent newbie user experience. --
Re: Virtual functions and inheritance
On Tuesday, 27 January 2015 at 08:19:46 UTC, Daniel Kozák wrote: You can use this T: class Parent { @property string typeName(this T)() { return T.stringof; } } class Child : Parent { } void main() { auto p = new Parent; auto c = new Child; assert(p.typeName == Parent); assert(c.typeName == Child); } OTOH: void main() { auto p = new Parent; auto c = new Child; assert(p.typeName == Parent); assert(c.typeName == Child); p = c; assert(p.typeName == Parent); } It will still use the static type of the object that it's called on, not the dynamic type.
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 08:07:11 UTC, ketmar wrote: On Tue, 27 Jan 2015 01:32:21 +, Mike wrote: i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. I'm interested! I'm interested! ;-P Our jobs are similar: we have to scout out new technologies for our companies, and, with an hand on the hearth and fingers crossed, we have to judge the risks/benefits about spending money and time on them. It's not an easy job in my opinion, expecially nowadays with all that trees in the forest... I strongly believe in D, and we have migrated all our major projects over it, but sometimes, when I'm alone with my thoughts, I not sure if the force is strong in me like at the beginning... Well, we'll see: alea iacta est. --- Paolo
Re: static class vs. static struct
For several times I've met struct(or static struct) usage in Phobos for singleton pattern implementation. Unfortunately now i can remember only core.runtime.Runtime. So I've got a question. Why do Phobos guys use struct or static struct for or singleton pattern implementation? Why don't use static final class for this purpose?
[Issue 13726] Build Phobos and Druntime with stack frames enabled (-gs)
https://issues.dlang.org/show_bug.cgi?id=13726 Sobirari Muhomori dfj1es...@sneakemail.com changed: What|Removed |Added URL||http://forum.dlang.org/thre ||ad/ossuvfmqthllgdpgzntm@for ||um.dlang.org --
Re: Array List object?
Gan: //Initializing the array tiles = new SBTile[](0); This is often useless. //Clearing the array tiles = []; This doesn't clear the array, it rebinds it to a null pointer. Bye, bearophile
Re: static class vs. static struct
On Tuesday, 27 January 2015 at 09:01:39 UTC, ref2401 wrote: For several times I've met struct(or static struct) usage in Phobos for singleton pattern implementation. Unfortunately now i can remember only core.runtime.Runtime. So I've got a question. Why do Phobos guys use struct or static struct for or singleton pattern implementation? Why don't use static final class for this purpose? I do not think this is a singleton pattern (no instance). I see it much more like namespace in case of core.runtime.Runtime. And yes static final class could do that too but struct looks better than final class and you can disable this on structs
[Issue 5452] Signed file lengths and positions
https://issues.dlang.org/show_bug.cgi?id=5452 Sobirari Muhomori dfj1es...@sneakemail.com changed: What|Removed |Added URL||http://forum.dlang.org/post ||/klhjighswudjvhscrfty@forum ||.dlang.org --- Comment #2 from Sobirari Muhomori dfj1es...@sneakemail.com --- (In reply to AndyC from comment #1) I don't know if that's still true, if it is you should open a new bug report with some test code. It's a semantical issue, see the linked discussion. --
Re: One area where D has the edge
On Tuesday, 27 January 2015 at 06:08:34 UTC, Laeeth Isharc wrote: There was also this one from 1998 that was very small http://www.javaworld.com/article/2076641/learn-java/an-introduction-to-the-java-ring.html Java has some history running on small devices. Cheers, uri Indeed, and I remember that well. However I was less interested in embedded devices and what java could do under conditions of small memory, and more interested in its memory efficiency on servers in managing much larger data sets. Since it seems to me we are still early in the unfolding of current trends, and what is true today mostly for google and Facebook may be more widely true for others tomorrow. I do appreciate that java is comparable in execution speed to native code in many cases. Is its memory footprint really comparable? And if you have a small team, and not much time, how does that change things - D vs Java? I don't think for D GC matters so much as not real time and you can easily preallocate buffers. But don't let me stop you talking about small devices. I cannot speak about small team experiences. Our projects usually take around 30+ developers. In terms of server applications, yes when the applications are deployed usually the memory usage might not be optimal. However that is why profiling and language knowledge is required. Fine tuning a Java application is no different than other compiled languages, it just requires to know which knobs to turn. For example, foreach allocates and a simple for does not, so choose wisely how to iterate. If scratch arrays are required multiple times, just allocate it once for the complete lifetime of the class. Always use StringBuilder for string manipulations. And many other tricks. The thing that Java still looses in memory management, even in commercial JVMs, is lack of value types since escape analysis algorithms are not very aggressive, but support is being designed and will land partially in Java 9 and Java 10 time frame. So by Java 10 according to the planned features, there will be value types and even the open source JVM will have some form of JIT cache. Including the large amount of available libraries. As for D, it surely has its place and I am looking forward to language adoption. -- Paulo
Re: accept @pure @nothrow @return attributes
On Tue, 27 Jan 2015 01:32:21 +, Mike wrote: In fact, it is the attitude against change that has put me on the fence about D, when I was quite an advocate about a year ago. It has also made me reluctant to put forth the necessary effort to study and make any significant contributions because the controversy, as exhibited here, would likely erase my entire investment. Instead, I have begun exploring other options while keeping one foot on the raft. heh. i was very passionate about D, and i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. signature.asc Description: PGP signature
Re: Using dub
Oope, yeah, and it ran.
[Issue 14036] Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError
https://issues.dlang.org/show_bug.cgi?id=14036 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/73d7a44eb18f6889ef32e02fd15a8c567e8cfb6d fix Issue 14036 - Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError This changes FinalizeError to be thrown only when an Exception is thrown, with the disadvantage of not catching non-Exception Throwables and the advantage of preserving the stack trace for the code that caused InvalidMemoryOperationError. https://github.com/D-Programming-Language/druntime/commit/cfe3eb5a2bf0d9a67fba8aa621c8a076c8c74124 Merge pull request #1123 from CyberShadow/pull-20150124-201947 fix Issue 14036 - Do not throw FinalizeError on OutOfMemoryError or Inva... --
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 08:07:11 UTC, ketmar wrote: heh. i was very passionate about D, and i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. A head of a 1000 employee software company would certainly have the power to change that rather than spending his time complaining on a NG.
Re: accept @pure @nothrow @return attributes
On Tue, 27 Jan 2015 08:30:43 +, Jonathan Marler wrote: On Tuesday, 27 January 2015 at 07:50:36 UTC, ketmar wrote: On Tue, 27 Jan 2015 02:11:55 +, Jonathan Marler wrote: This has become quite frustrating. I'm not sure how else to explain myself so maybe I'm just being dumb. you are dumb. you can be dumb for some time, and then BANG! your proposal is silently made right. yet you're still dumb. that is The Way Of D. that is the way of D...sad... I may have to agree with you on some of your points. Even after explaining my idea 3 or 4 times, it seemed to fall on deaf ears, or more specifically, uninterested ears that didn't try to understand. It's very frustrating when you take the time to write up an idea and no one bothers read it well enough to understand it, let alone take a few minutes to think about it. D is by far the best language I've worked with, but there's still work to be done. It has been quite disheartening when I try to discuss anything in the forums. People are very quick to respond to posts without fully reading them and the meat of the content gets lost in a slew of responses that miss the point. I'm not sure what I'm doing wrong or how this can be improved. But this pattern seems to keep happening no matter what topic is discussed. Not sure how to solve this...I'll think on this tomorrow. you just have to write alot of unpleasant things, and then you'll be twitted by the most of the readers. and then you'll get no feedback on your posts at all, but that means that you'll not get a negative feedback too. for me it's amusing to see how my rants becoming the things. and i know that i can write anything i want to, 'cause almost nobody is reading my posts anyway. but for this particular issue... i'm enraged by the fact that it was commited without discussion at all. my ER got some controversal reactions, and i was believe that anything controversal is discussed first, and only then it may be accepted. but it looks like Walter is don't care about D users, the only thing he cares of is will this be usable for me? yes, i know that this is a personal attack. and i know that it's a project of Walter after all, so he can do anything he want to. but D is the best language i've seen and used, that's why i'm so passionate about it (and rude alot of times, i know). my only excuse is that (as i told) that almost nobody is reading my posts. ;-) signature.asc Description: PGP signature
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 08:44:19 UTC, deadalnix wrote: On Tuesday, 27 January 2015 at 08:07:11 UTC, ketmar wrote: heh. i was very passionate about D, and i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. A head of a 1000 employee software company would certainly have the power to change that rather than spending his time complaining on a NG. If I have interpreted this post in the correct way, this is a very unfair comment, deadline. --- Paolo
Re: accept @pure @nothrow @return attributes
On Tue, 27 Jan 2015 08:44:17 +, deadalnix wrote: On Tuesday, 27 January 2015 at 08:07:11 UTC, ketmar wrote: heh. i was very passionate about D, and i started the process of migration of all our work projects (i'm a head of software company with ~100 employees, if anybody is interested) to D. but then i realised that D -- being a best programming language i've seen in my life -- is a toy project. just think about it as a personal toy. and then you'll know what expect from it. A head of a 1000 employee software company would certainly have the power to change that rather than spending his time complaining on a NG. i don't know where you found that 1000 number, i was talking about 100. it's a very different thing. and then: do you proposing a fork? sure, i can do that. actually, i'm using a very different D already (heh, people that are interested in my public code -- noone, actually -- may notice that all my modules are aliced now; that's 'cause i want them to fail early instead of being asked why they errored in the middle). but will it be good for D? i'm not making my fork public for a reason. and i'm writing here for a reason too. did you notice that almost all of my topics (not that many, actually) got a lenghty discussion? isn't that a sign that i'm talking about important things? signature.asc Description: PGP signature
Re: 521 days, 22 hours, 7 minutes and 52 seconds...
On Monday, 26 January 2015 at 20:35:31 UTC, Andrei Alexandrescu wrote: On 1/26/15 12:30 PM, Dicebot wrote: We couldn't merge it into std.experimental before because you have stated that even std.experimental modules shouldn't have a breaking changes normally. It was 2 reviews ago. Now you have reconsidered, which is understandable considering how long has it been taking, but pretending that was intended to work that way does not make you look good :( PS I was in favor for very lax initial requirements for experimental packages for this very reason. Now I remember. I admit I was wrong. -- Andrei I thought the idea was that there should be no _known_ pending breaking changes when mergin into std.experimental. Thus std.experimental would be for fixing problems that are found when the package is actually used. Breaking changes for fixing those would be perfectly fine. 1. review = if problems found = fix all known problems and repeat the review 2. once everyting seems ok in review = merge to std.experimental 3. if a new problem requiring a breaking change is found = fix it 4. once no new problems have been found for a while = seems ok = merge to std 5. if a new problem requiring a breaking change is found = can't fix it, maybe try to cirmumvent it somehow etc. (no breaking changes unless it's critical)
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 08:30:46 UTC, Jonathan Marler wrote: People are very quick to respond to posts without fully reading them and the meat of the content gets lost in a slew of responses that miss the point. I'm not sure what I'm doing wrong or how this can be improved. But this pattern seems to keep happening no matter what topic is discussed. Not sure how to solve this...I'll think on this tomorrow. Isn't it more that one or two individuals don't get your point and keep arguing while the others got it? Anyway, the discussions on the rust dev list appears to be more educated than on the D forums, so maybe the people with a theoretical background gave up on D and was piqued by the potential given by linear typing? I think so... but they might get fed up with it eventually and in the mean time D has the opportunity to get the semantics right... From a political perspective it is better to leave the syntax as it is until the semantics of the language are frozen. If you keep changing the syntax then people will eventually be fed up with changes and it might be more difficult to push through a full redesign... Which in my opinion is needed. It is better to stay 25% flawed then eventually clean it up so that it is only 5% flawed, than to go from 25% bad to 20% bad to 15% and then people get fed up with changes and it is frozen at 15% flawed. The problem in the D community is that there is no planning. Syntax clean up should be a workgroup effort, not a metamorphic mutation process.
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 07:50:36 UTC, ketmar wrote: On Tue, 27 Jan 2015 02:11:55 +, Jonathan Marler wrote: This has become quite frustrating. I'm not sure how else to explain myself so maybe I'm just being dumb. you are dumb. you can be dumb for some time, and then BANG! your proposal is silently made right. yet you're still dumb. that is The Way Of D. that is the way of D...sad... I may have to agree with you on some of your points. Even after explaining my idea 3 or 4 times, it seemed to fall on deaf ears, or more specifically, uninterested ears that didn't try to understand. It's very frustrating when you take the time to write up an idea and no one bothers read it well enough to understand it, let alone take a few minutes to think about it. D is by far the best language I've worked with, but there's still work to be done. It has been quite disheartening when I try to discuss anything in the forums. People are very quick to respond to posts without fully reading them and the meat of the content gets lost in a slew of responses that miss the point. I'm not sure what I'm doing wrong or how this can be improved. But this pattern seems to keep happening no matter what topic is discussed. Not sure how to solve this...I'll think on this tomorrow.
Re: 521 days, 22 hours, 7 minutes and 52 seconds...
On Tuesday, 27 January 2015 at 09:07:30 UTC, tn wrote: On Monday, 26 January 2015 at 20:35:31 UTC, Andrei Alexandrescu wrote: On 1/26/15 12:30 PM, Dicebot wrote: We couldn't merge it into std.experimental before because you have stated that even std.experimental modules shouldn't have a breaking changes normally. It was 2 reviews ago. Now you have reconsidered, which is understandable considering how long has it been taking, but pretending that was intended to work that way does not make you look good :( PS I was in favor for very lax initial requirements for experimental packages for this very reason. Now I remember. I admit I was wrong. -- Andrei I thought the idea was that there should be no _known_ pending breaking changes when mergin into std.experimental. Thus std.experimental would be for fixing problems that are found when the package is actually used. Breaking changes for fixing those would be perfectly fine. 1. review = if problems found = fix all known problems and repeat the review 2. once everyting seems ok in review = merge to std.experimental 3. if a new problem requiring a breaking change is found = fix it 4. once no new problems have been found for a while = seems ok = merge to std 5. if a new problem requiring a breaking change is found = can't fix it, maybe try to cirmumvent it somehow etc. (no breaking changes unless it's critical) I found out I quite like the Rust's way of doing this because it's changing so much and so fast -- plain and simple, unstable features are put behind feature gates and the only way for the end user to use unstable API is to explicitly mark it as allowing the unstable code. This also goes well with RFC review process. Once the feature is stabilized, no changes to user code are required, no imports to be changed etc. This allows them to merge in ridiculous amount of PRs/day and test everything out live without affecting the core stable API.
Re: static class vs. static struct
On Tue, 27 Jan 2015 09:40:08 +, Daniel Kozak wrote: import std.stdio; import std.conv; struct S { @disable this(); } final class C { } void main() { writeln(C.sizeof); writeln(S.sizeof); } blind guess: vmt with toString() from Object? ;-) signature.asc Description: PGP signature
Re: Using dub
On Tuesday, 27 January 2015 at 07:44:12 UTC, Rikki Cattermole wrote: On 27/01/2015 8:40 p.m., Joel wrote: On Tuesday, 27 January 2015 at 07:25:18 UTC, Rikki Cattermole wrote: On 27/01/2015 8:03 p.m., Joel wrote: I'm having trouble using dub. Nothing seems to work (-h works though). I would like an example or two of how to get an app going (stand alone for now). I'm using the Mac OS. Lets use Devisualization.Window as an example. Assuming in a safe directory and dmd/dub on PATH variable: $ git clone https://github.com/Devisualization/window.git $ cd window $ dub build de_window:test $ ./de_window_test For simple test app: $ mkdir myapp $ cd myapp $ dub init $ nano source/app.d // edit // ctrl + x, y $ dub build $ ./myapp // or $ dub run I get this (dub isn't in the path): Joels-MacBook-Pro:window joelcnz$ ../dub build de_window:test Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/dil-master Failed to load package in /Users/joelcnz/.dub/packages/dil-master: Got .excludedSourceFiles of type string - expected array. Failed to parse package description in /Users/joelcnz/.dub/packages/dplug-0.0.2 Failed to load package in /Users/joelcnz/.dub/packages/dplug-0.0.2: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.1.6 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.1.6: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/.dub/packages/gfm-1.3.3 Failed to load package in /Users/joelcnz/.dub/packages/gfm-1.3.3: Expected version number in version spec: * Failed to parse package description in /Users/joelcnz/jpro/dpro2/OtherPeoples/window Error executing command build: Expected version number in version spec: * Try again after doing: $ rm -rf ~/.dub Something seems ugh, weird. If that doesn't, than its time for dub bug reporting. I've tried an earlier version of dub, similar problem. It was better another time I tried it. I got this now (I didn't do any thing to the dub file): Joels-MacBook-Pro:window joelcnz$ ../../dub build de_window:test Failed to parse package description for dil in /Users/joelcnz/.dub/packages/dil-master/. Failed to load package in /Users/joelcnz/.dub/packages/dil-master/: Got .excludedSourceFiles of type string - expected array. Failed to parse package description for dil in /Users/joelcnz/.dub/packages/dil-master/. Failed to load package in /Users/joelcnz/.dub/packages/dil-master/: Got .excludedSourceFiles of type string - expected array. Building
[Issue 14036] Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError
https://issues.dlang.org/show_bug.cgi?id=14036 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
Re: core.exception.InvalidMemoryOperationError@(0)
On Tue, 27 Jan 2015 06:46:20 +, Bayan Rafeh wrote: This is the first serious project I do with D and now you're lost to other C-like languages, methinks. ;-) signature.asc Description: PGP signature
[Issue 13726] Build Phobos and Druntime with stack frames enabled (-gs)
https://issues.dlang.org/show_bug.cgi?id=13726 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added URL|http://forum.dlang.org/thre |http://forum.dlang.org/post |ad/ossuvfmqthllgdpgzntm@for |/ossuvfmqthllgdpgzntm@forum |um.dlang.org|.dlang.org --
Re: static class vs. static struct
On Tuesday, 27 January 2015 at 09:36:49 UTC, Daniel Kozak wrote: On Tuesday, 27 January 2015 at 09:01:39 UTC, ref2401 wrote: For several times I've met struct(or static struct) usage in Phobos for singleton pattern implementation. Unfortunately now i can remember only core.runtime.Runtime. So I've got a question. Why do Phobos guys use struct or static struct for or singleton pattern implementation? Why don't use static final class for this purpose? I do not think this is a singleton pattern (no instance). I see it much more like namespace in case of core.runtime.Runtime. And yes static final class could do that too but struct looks better than final class and you can disable this on structs import std.stdio; import std.conv; struct S { @disable this(); } final class C { } void main() { writeln(C.sizeof); writeln(S.sizeof); }
Re: Array List object?
And it's named dynamic array, instead of Array List object, it's not a class instance. Bye, bearophile
[Issue 2138] Allow more than 65535 files in Zip archives
https://issues.dlang.org/show_bug.cgi?id=2138 FG h...@fgda.pl changed: What|Removed |Added Keywords||pull CC||h...@fgda.pl --- Comment #1 from FG h...@fgda.pl --- https://github.com/D-Programming-Language/phobos/pull/2914 This solves the issue with limited number of items allowed in older zip archives, but for files over 4 GB, encryption, or preserving file attributes (especially when moving files between platforms) something other than std.zip would have to be used. --
Re: D Management Site
On 2015-01-27 19:10, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. I would assume you mean something not just for the D core project but for the whole D community. Like, is someone working on a GUI library, who is working on database adapters, and so on. -- /Jacob Carlborg
Re: About variant
I can do this import std.variant; struct Alpha { Variant something; this(Variant v){ something = v; } static Alpha build(T)(T v){ return Alpha( cast(Variant)v ); } } void main(){ auto a = Alpha.build!(int)( 6); auto b = Alpha.build!(string)( hello); auto l = new Alpha[](2); l[0] = a; l[1] = b; } If someone has better
Re: Oplink PR Ping
On Tuesday, 27 January 2015 at 20:44:53 UTC, Andrei Alexandrescu wrote: On 1/27/15 12:42 PM, Andrei Alexandrescu wrote: On 1/27/15 12:31 PM, Jonathan Marler wrote: I still haven't figured out how to email someone without knowing their email address. http://goo.gl/go5Dks -- Andrei I got destroyed - his Send email to Walter Bright button doesn't work... -- Andrei I bet that Walter is aiming for the Zero Inbox :) That's part of his strategy for that!
Re: About variant
On Tuesday, 27 January 2015 at 21:00:16 UTC, Justin Whear wrote: On Tue, 27 Jan 2015 20:46:59 +, bioinfornatics wrote: void main(){ auto a = Alpha!(int)( 6); auto b = Alpha!(string)( hello); The Alpha struct is not a template, only the constructor is. Remove the explicit instantiations and IFTI does the work: void main(){ auto a = Alpha( 6); auto b = Alpha( hello); Oh really cool
Re: [website redesign] PR for the one with the big red menu bar
On 1/27/15, anonymous via Digitalmars-d digitalmars-d@puremagic.com wrote: PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color. I'm never going to like red. It's not easy on the eyes, the focus should be int the middle where the text is, and the red is distracting.
Re: One area where D has the edge
On Tuesday, 27 January 2015 at 19:27:43 UTC, Laeeth Isharc wrote: One of the things that was striking was the very limited set of choices available for a portfolio management system. Macro involves trading potentially any liquid product in any developed (and sometimes less developed) market, so it doesn't fit well with product offerings that have a product silo mentality. One uses a portfolio management system very intensively, so user interface matters. I have to admit that I know very little about hedge funds, so this is all quite new and intriguing for me (and therefore pique my interest! ;^). I am using Google Cloud for creating App Engine web apps, but I have wanted to experiment with Google's cloud computing offerings for a while. Do you think that Compute Engine and Big Query would be suitable for your needs? Or is it required that you have all your data on site locally? Google has pretty good stability (SLA), but I guess they were very slow for a few hours during the olympics or so a couple of years ago (some load balancing mechanism that went bananas). There are of course specific challenges for macro and for startup funds that may not be generally true of the domain - it is a big area and what people need may be different. Larger funds use a combination of third party technologies and their own bits, but I am not sure that everyone is perfectly happy with what they have. So, basically there might be a market for tailoring solutions so that client can gain strategic benefits? that they will beforehand. There has been a cultural change in the industry accompany its institutionalisation, so it's today much more 'corporate' in mindset than it once was, and this shift has not only positive aspects. Ah, I sense you are going against the stream by getting your hands dirty in a DIY way. Good! :) becomes limiting. But because you can do a lot that way (and it is presented very attractively) it's not so easy to justify rebuilding some functionality from scratch in order to have control. So Bloomberg have basically commoditized the existing practice, in a way, thus reinforcing a particular mindset of how things ought to be done, perhaps? And maybe you see some opportunities in doing things differently? :-) are triggered). That's valuable, but not enough for various reasons: one needs to maintain the alerts by hand (last I checked); For legal reasons? in my opinion the way to run a business. Python is fine for this kind of thing, but I would rather engineer the whole thing in a better way, since the analytics are shared between functions. Not sure what you mean by the functions, do you mean technical computations or people (like different functional roles)? automated way where your data series are organized. One wants to have all the data in one place and be able to run analyses on them, and I am not aware of a satisfactory platform available for this. How large are the datasets? needs as a professional. By building it oneself, one has control and can work towards excellence. The combination of incremental improvements, small in themselves, is underestimated in our world today as a contribution to success. Yes, and you can also tailor the interface to the user, so professionals can eventually get more done or be less frustrated by getting rid of the clutter. Or in some cases where I try to make the interface so simple that no learning (and therefore confusion) is necessary, which is kind of important for functions that are used seldom. But it sounds like you are creating tools for yourself, so that might not apply in your case? Pragmatically, I am an old C programmer, and there is a limit to how much I can learn in the time available. It seems to me Sound like D might be a good starting point for you, an incremental upgrade from C. I can do everything I need in D in a way that is scalable for practical purposes. Some of what I want to do is totally straightforward scripting, and some is more ambitious. It is nice to be able to use a single language, if it's the right tool for the job (and if not, then interoperability matters). If sociomantic (and that advertising company linked to in the blog post from a while back about using D for big data) can do what they do, I can't imagine it will be limiting for me for a while. I will check it out, but there is a beauty to starting with the smallest useful version, and knowing that you can scale if you need to. If you need very high performance on a single CPU then you probably need a compiler that will generate good SIMD code for you, but I suppose you could try out a tool like Intel's experimental vectorizing compiler https://ispc.github.io/ or something else that can vectorize and link it in if D is too slow for you. I recognize this reply is meandering a bit - since the major topic is use of D for big data in finance, whereas I am touching on
Re: Kythe
On 2015-01-27 19:55, Andrei Alexandrescu wrote: Google just open sourced https://github.com/google/kythe. Would it help Calypso? -- Andrei I had a quick look and my first impression is that it would not help. -- /Jacob Carlborg
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile Thanks. I'll give structs a try. When I start the program, it runs fine at 35mb of ram. It only keeps 15 objects stored in the arrays at a time so why do you think my ram usage increases to 700+ after many hours? Curiously, my CPU usage went from 10% to 5% after I changed to structs on Point and Range. Though my memory still climbs high.
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 18:21:37 UTC, Nick Treleaven wrote: On 27/01/2015 18:01, Jonathan Marler wrote: On Tuesday, 27 January 2015 at 17:18:11 UTC, Nick Treleaven wrote: On 27/01/2015 16:49, Jonathan M Davis via Digitalmars-d wrote: abstract also applies to classes, as does final. Yes, but they actually only affect the *functions* belonging to the class, not the variables. A class is not a variable. I think you may have missed the point. I believe what Jonathan is saying is that if you turn abstract into @abstract then you have to consider how to solve the abstract class issue. Do you change it to: @abstract class ? Yes, because it affects the class's functions, not its variable members. Same thing with final. Since the same keywords are used in a lot of different contexts, if you change how it is used in one context then it's going to be inconsistent with how it's used in the other contexts (like with a function or a class). Then if you want consistency (which is the point of why we are discussing this change in the first place) you have to change every context it is used in. If you follow through with your proposal, you'll end up putting a '@' character before almost every keyword in the language In that case I don't think you've really grokked my proposal. It only requires 5 changes to attributes for consistency (and that's counting @pure and @nothrow). Problem Summary: Using an '@' symbol for some function attributes and not others is weird. void foo() pure @safe const; Current Reason: keywords don't use a '@' and non-keywords use a '@' Your Solution: Have attributes that apply to variables use no '@' and all other attributes use a '@'. You've changed the cutoff from keywords to whether or not they apply to variables. How does this solve the original problem (stated above)? void foo() @pure @safe const; // OR public @pure final @safe foo(); How is this more consistent? This doesn't solve the problem is just shuffles around the cases when we use '@' and when we don't. Note: not to mention that it still looks horrible to use '@'. There's no reason the language needs to require a '@' on a keyword. The only reason is to make things consistent but if you're not making things more consistent, as shown above.
Re: About variant
On Tue, 27 Jan 2015 20:46:59 +, bioinfornatics wrote: void main(){ auto a = Alpha!(int)( 6); auto b = Alpha!(string)( hello); The Alpha struct is not a template, only the constructor is. Remove the explicit instantiations and IFTI does the work: void main(){ auto a = Alpha( 6); auto b = Alpha( hello);
Re: D Management Site
On Tuesday, 27 January 2015 at 20:59:10 UTC, Jacob Carlborg wrote: On 2015-01-27 19:10, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. I would assume you mean something not just for the D core project but for the whole D community. Like, is someone working on a GUI library, who is working on database adapters, and so on. I wasn't going to explore this anymore but since you asked :) Yes it would apply to the whole D community. I jotted down some notes to summarize some of my initial thoughts on the features it could provide...here they are: Problems mapped to Features - Problem: Knowing what people want. Features: Priority Points Problem: Knowing what the leadership wants. Features: Priority Points and Follow Developers Problem: Knowing what isn't being worked on. Features: Job Managment Problem: Getting the status of a job Features: Job Managment Problem: Asking leadership what to work on Features: Messages Problem: Notification of work being done Features: Messages Features - * Job Management Tracks what people are working on. * Priority Points Everyone can distribute their 100 priority points to the features they want. It's important that everyone get's 100 points. It allows a person to realize that if they want a feature done, it is going to take resources away from other features. * Follow Developers their actions show up in your feed their priority points for each issue are shown first * Messages send messages to developers get notifications of activity, when work is done, if a PR needs to be reviewd * Timeline can add dev time estimates * ranking?? * track who's looking at what (if someone clicks on a link, it tracks that the link was clicked) * add dependencies between jobs * link a job to a PR
Re: static class vs. static struct
On Tuesday, 27 January 2015 at 18:24:29 UTC, Ali Çehreli wrote: On 01/27/2015 08:33 AM, Piotrek wrote: Non-static means nested. Hmm,this can be misleading. Nesting in structs doesn't introduce context pointer. You must be thinking of structs nested inside user-defined types. Structs that are nested inside functions do have the context pointer. Ali What you wrote about the structs is true. However I was referring to other thing. I just wanted to emphasize (with my poor English) that also classes and structs *nested in struct* doesn't contain the additional context pointer. As opposed to class nested in class. Then I think we'd better not say that non-static means nested. Piotrek
Print to Win Printer
How do I print to a Windows printer from a console program? Thanks for your assistance.
Re: static class vs. static struct
On Tuesday, 27 January 2015 at 18:18:02 UTC, Ali Çehreli wrote: On 01/27/2015 08:58 AM, Piotrek wrote: Nice list. :) 1. static variable struct A{int a} // no static before declaration static A s; //note that static is used for struct variable storage class (lifetime) static int b; etc. 2. static declaration static struct A{int a}; //static used for context unnesting static int fun(){}; // static used also for removing scope context Of course that includes static member functions, where the 'this' pointer is removed. Actually, static opCall is kind of different because it makes the type itself callable. etc. 3. static if static if(compile_time_cond) { //this section of code will be taken into the binary, used for meta programming } Another use of 'static' that means at compile time: static assert 4. Module initialization and deinitialization: static this shared static this static ~this shared static ~this 5. Module import: static import std.stdio; Ali Thanks for comments, Mr. Professor. On duty as usual ;) Let me here thank for your book which I've been reading for some time. Piotrek
Window creation, for phobos?
I have dream! A dream, dream dream. A dream to see GUI's easy to use in D! I must admit it will be hard, but it's time. Prime time I mean! Now enough gabble. I'm proposing to get Devisualization.Window PR'd into phobos. This cannot happen right now. It's blocked on many fronts. 1) Objective-C bridge. The most obvious one for OSX 2) An image definition depends on color 3) OpenGL loading mechanism such as Derelict-GL3 4) X11 bindings for posix (easy not an issue) 5) More WinAPI bindings (easy not an issue) 6) Cocoa bindings (easy not an issue, just dependent on the bridge) 7) A color definition So this idea will take a long time to happen, and that's ok. First off, Derelict-Util/Derelict-GL3 is a biggy here. Its old code, lets admit it. Its also a standard for loading shared library functions. So Mike Parker, would you be willing for this to be PR'd? And if so, are we ok with this? Manu Evans has said he is working on a color module, any update on that? Jacob Carlborg, how far off is the objective-c bridge? Has any definitions to e.g. Cocoa been started either? Once we have a color definition then it'll be time to start work on an image definition/implementation. There is a few already present, ae, dlib and Devisualization.Image exist. The color implementation will change, but most of the code should not for each. Anyone willing to start working on something? The benefits of this will greatly outweigh the work that this will take to do and maintain. Just having a standard window + context interface will greatly make GUI toolkits more interchangeable. Not to mention for game development.
Re: [website redesign] PR for the one with the big red menu bar
On Tue, Jan 27, 2015 at 09:21:20PM +0100, Andrej Mitrovic via Digitalmars-d wrote: On 1/27/15, anonymous via Digitalmars-d digitalmars-d@puremagic.com wrote: PR: https://github.com/D-Programming-Language/dlang.org/pull/869 - For details see here. Live version: http://ag0aep6g-dlang.rhcloud.com - If you've visited this before, you may have to clear your cache to see the proper logo color. I'm never going to like red. It's not easy on the eyes, the focus should be int the middle where the text is, and the red is distracting. I like the design, but yeah, the red is a little too prominent. Maybe a more saturated red might work better? Also, I still think the horizon above Mars should be a darker color, to provide more visual contrast before the big red column begins to stretch down the page. T -- Too many people have open minds but closed eyes.
Re: Oplink PR Ping
On Tuesday, 27 January 2015 at 19:55:06 UTC, H. S. Teoh wrote: On Tue, Jan 27, 2015 at 07:48:15PM +, Jonathan Marler via Digitalmars-d wrote: On Tuesday, 27 January 2015 at 19:35:44 UTC, H. S. Teoh wrote: On Tue, Jan 27, 2015 at 07:01:02PM +, Jonathan Marler via Digitalmars-d wrote: I created a PR for optlink about 7 months ago and I don't think it's been looked at. PR: https://github.com/DigitalMars/optlink/pull/16 Bug: https://issues.dlang.org/show_bug.cgi?id=4831 Can someone take a look? Probably Walter is the only person who is qualified to look at optlink PRs. Maybe ping him directly? T How do I ping him directly? Email him? T I still haven't figured out how to email someone without knowing their email address. Could we get a developer to work on that? Maybe I'll file a bug report. Internet Bug: Unable to email someone without knowing their email address Silly internet, why didn't Al Gore think of this!
Re: extern(C) symbol conflicts
On 1/27/15 3:11 PM, Jacob Carlborg wrote: On 2015-01-27 19:13, Steven Schveighoffer wrote: I would say if two extern(C) declarations are identical (i.e. same parameter types, same attributes), they don't conflict. What does this break? It it's extern(C), shouldn't just the name matter? For instance, if one library tags it as pure, but another does not. I think an error in that case is warranted. -Steve
Re: Problem with coupling shared object symbol visibility with protection
On 26.01.2015 23:24, Walter Bright wrote: The problem here is that you don't want to make someHelperFunc() export because that would mean users could call it directly, but you want it to be available for cross shared library calls. The cross shared library call happens if a template is instanced from a different shared library / executable than the module it was originally located in. exporting a template and then having the user instantiate outside of the library doesn't make a whole lot of sense, because the instantiation won't be there in the library. The library will have to instantiate every use case. If the compiler knows the library instantiated it, it won't re-instantiate it locally. The problem is not about into which binary the template is generated to (this must be the binary where it is used), but how to access private non-templated methods called by the template. From the core.time.FracSec example: export struct FracSec { ///... static FracSec from(string units)(long value) if(units == msecs || units == usecs || units == hnsecs || units == nsecs) { immutable hnsecs = cast(int)convert!(units, hnsecs)(value); _enforceValid(hnsecs); return FracSec(hnsecs); } private static void _enforceValid(int hnsecs) { if(!_valid(hnsecs)) throw new TimeException(FracSec must ...); } ///... } _enforceValid() could also be a free function. It is likely to be compiled into druntime.dll, but needs to be exported from the DLL to be callable by the instantiation of the template function in another DLL. The private forbids exporting, though.
Re: accept @pure @nothrow @return attributes
On 2015-01-27 17:49, Jonathan M Davis via Digitalmars-d wrote: IMHO, if we have to search for a way to make them consistent, then there's no point. We're just going to end up with making things more consistent in one way and less in another without necessarily making it any easier for anyone to keep track of, so we'd just be shuffling things around. I think that there needs to be a clear and solid benefit to changing which attributes have @ and which don't, or we shouldn't mess with them. We could change all attributes to be compiler recognized UDA's, which would require prefixing them with @. All current attributes would be removed. This is of course a major breaking change and will not happen. Since they would be UDA's it would be possible to disambiguate with other UDA's with the same name in another module. -- /Jacob Carlborg
Re: Oplink PR Ping
Jonathan Marler wrote in message news:ziogluwispkhxncgr...@forum.dlang.org... I still haven't figured out how to email someone without knowing their email address. Could we get a developer to work on that? Maybe I'll file a bug report. The trick is to find their email address, then use that to send the email. Walter's email address if visible online if you look hard enough: http://forum.dlang.org/thread/50dad8ba.8030...@digitalmars.com
Re: Oplink PR Ping
On Tuesday, 27 January 2015 at 20:44:53 UTC, Andrei Alexandrescu wrote: On 1/27/15 12:42 PM, Andrei Alexandrescu wrote: On 1/27/15 12:31 PM, Jonathan Marler wrote: I still haven't figured out how to email someone without knowing their email address. http://goo.gl/go5Dks -- Andrei I got destroyed - his Send email to Walter Bright button doesn't work... -- Andrei Yes, me too I tried that button in the last 30 minutes...
About variant
Dear that do a lot time wehere I not used std.variant. i would like to hide extra cast from user by using a generic ctor import std.variant; struct Alpha { Variant something; this(T)(T v){ something = cast(Variant)v; } } void main(){ auto a = Alpha!(int)( 6); auto b = Alpha!(string)( hello); auto l = new Alpha[](2); l[0] = a; l[1] = b; } but that do not works. Someone know a trick? thanks
Re: forcing @nogc on class destructors
On Saturday, 24 January 2015 at 23:28:35 UTC, Jerry Morrison wrote: This is the first I've heard that allocating GC memory in a destructor will crash. That's an unexpected gotcha. I'd expect to be able to reliably do I/O or throw an exception. Strategy 1. Fix the GC's limitation. (One fewer pitfall to baby-sit.) I expect this to happen sooner rather than later. GC is currently a very hot topic, with several people working on different aspects of it (performance, preciseness...). Strategy 2. Have the compiler inform the programmer. (The compiler can't catch all bugs but it should do what it can. Arguably this is a GC bug, not mine.) Might be worthwhile if we don't manage to remove the GC limitation before, say, 2.068. But it will also trigger some false positives. It's unfortunate that currently the class/struct distinction is tightly coupled with the memory management strategy. Strategy 3. Put bold warnings in the reference http://dlang.org/class.html#destructors and all tutorials. That's useful but insufficient. Programmers will carry assumptions from other programming languages. Even those who read the D reference won't all remember that detail when it matters. Agreed. Strategy 4. Accept such crashes. (No good. The D home page promises safety.) Strongly agreed. IMNSHO we should try hard to detect errors already at compile time, even if it means disallowing potentially harmless things. It's just that in this case, the right thing to do is to fix the GC (and make writeln @nogc). This btw also applies to the other problems destructors have, like that the order of destruction of objects referring to each other is undefined. The GC should try to zero all references that it knows are GC managed, and are no longer life, before calling the destructor.
Re: accept @pure @nothrow @return attributes
Jonathan M Davis via Digitalmars-d píše v Út 27. 01. 2015 v 08:49 -0800: On Tuesday, January 27, 2015 11:47:04 Nick Treleaven via Digitalmars-d wrote: On 27/01/2015 02:27, Jonathan M Davis via Digitalmars-d wrote: You're right. I forgot about those two. But it's still the case that the number of function attributes that don't have @ on them is_far_ greater than the number of those that do. But I explained that most function attributes don't only apply to functions but to variables as well: public, protected, package, private, static, const, immutable, inout, and deprecated So it can be consistent that the above don't use @. These only affect functions, not variables, so should be @attributes IMO: final, override, abstract These affect both: return, ref So if we want some kind of consistency, we can achieve it by adding @ for final, override, abstract, and removing it for 'return'. abstract also applies to classes, as does final. Also, if we end up adding any new attributes later, they're bound to have @ on them to avoid requiring a keyword (which is why we have @ on some of them in the first place), and if the new attribute applies to variables or types as well, then the division that you're suggesting falls apart. IMHO, if we have to search for a way to make them consistent, then there's no point. We're just going to end up with making things more consistent in one way and less in another without necessarily making it any easier for anyone to keep track of, so we'd just be shuffling things around. I think that there needs to be a clear and solid benefit to changing which attributes have @ and which don't, or we shouldn't mess with them. Exactly I do not think we can (want to) be 100% consistent . Even If I really like to see every attribute to be with or without @ (because consistency). I do not think it will be perfect. For eg. one of things I like about D is how easy I can switch from PHP, Java C# or C++. Even rewrite some of my code from PHP consist with following steps: 1.) remove $ 2.) replace :: and - for . 3.) some minor changes (sometimes nothing) So I would prefer if private, public, protected, final, static stay without @, but D specific things like pure,immutable,nothrow,nogc,safe,trust,disable,deprecated... would go with @ if I speak about immutable(const) I only mean function attribut not storage. And It would be perfect if all theese must be on the right side: // OK public final void someFunc() @immutable @safe @nogc @nothrow { } // OK public final immutable(int) someFunc() @immutable @safe @nogc @nothrow { return 5 } // Deprecated public final immutable int someFunc() @immutable @safe @nogc @nothrow { return 5 } // Error or Deprecated public final @immutable int someFunc() @safe @nogc @nothrow { return 5 }
Re: accept @pure @nothrow @return attributes
On Tuesday, 27 January 2015 at 21:15:16 UTC, Daniel Kozak wrote: Jonathan M Davis via Digitalmars-d píše v Út 27. 01. 2015 v 08:49 -0800: On Tuesday, January 27, 2015 11:47:04 Nick Treleaven via Digitalmars-d wrote: On 27/01/2015 02:27, Jonathan M Davis via Digitalmars-d wrote: You're right. I forgot about those two. But it's still the case that the number of function attributes that don't have @ on them is_far_ greater than the number of those that do. But I explained that most function attributes don't only apply to functions but to variables as well: public, protected, package, private, static, const, immutable, inout, and deprecated So it can be consistent that the above don't use @. These only affect functions, not variables, so should be @attributes IMO: final, override, abstract These affect both: return, ref So if we want some kind of consistency, we can achieve it by adding @ for final, override, abstract, and removing it for 'return'. abstract also applies to classes, as does final. Also, if we end up adding any new attributes later, they're bound to have @ on them to avoid requiring a keyword (which is why we have @ on some of them in the first place), and if the new attribute applies to variables or types as well, then the division that you're suggesting falls apart. IMHO, if we have to search for a way to make them consistent, then there's no point. We're just going to end up with making things more consistent in one way and less in another without necessarily making it any easier for anyone to keep track of, so we'd just be shuffling things around. I think that there needs to be a clear and solid benefit to changing which attributes have @ and which don't, or we shouldn't mess with them. Exactly I do not think we can (want to) be 100% consistent . Even If I really like to see every attribute to be with or without @ (because consistency). I do not think it will be perfect. For eg. one of things I like about D is how easy I can switch from PHP, Java C# or C++. Even rewrite some of my code from PHP consist with following steps: 1.) remove $ 2.) replace :: and - for . 3.) some minor changes (sometimes nothing) So I would prefer if private, public, protected, final, static stay without @, but D specific things like pure,immutable,nothrow,nogc,safe,trust,disable,deprecated... would go with @ if I speak about immutable(const) I only mean function attribut not storage. And It would be perfect if all theese must be on the right side: // OK public final void someFunc() @immutable @safe @nogc @nothrow { } // OK public final immutable(int) someFunc() @immutable @safe @nogc @nothrow { return 5 } // Deprecated public final immutable int someFunc() @immutable @safe @nogc @nothrow { return 5 } // Error or Deprecated public final @immutable int someFunc() @safe @nogc @nothrow { return 5 } Good idea. The only think I would change is when an attribute appears on the right side, why not omit the '@' symbol :) Other then that I like the consistency of putting the attributes in the same place. But even if you kept the '@' symbol I would still prefer your proposal over what we have now. It's more consistent and no longer looks weird. When someone new comes along it makes sense and doesn't look like a hack.
Re: Oplink PR Ping
On 1/27/15 12:42 PM, Andrei Alexandrescu wrote: On 1/27/15 12:31 PM, Jonathan Marler wrote: I still haven't figured out how to email someone without knowing their email address. http://goo.gl/go5Dks -- Andrei I got destroyed - his Send email to Walter Bright button doesn't work... -- Andrei
Re: Oplink PR Ping
On 1/27/15 12:31 PM, Jonathan Marler wrote: I still haven't figured out how to email someone without knowing their email address. http://goo.gl/go5Dks -- Andrei
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile Thanks. I'll give structs a try. When I start the program, it runs fine at 35mb of ram. It only keeps 15 objects stored in the arrays at a time so why do you think my ram usage increases to 700+ after many hours? Curiously, my CPU usage went from 10% to 5% after I changed to structs on Point and Range. Though my memory still climbs high. Force a GC.collect() now and again. Disable it at the beginning too.
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On 28/01/2015 11:30 a.m., Gan wrote: On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote: On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile Thanks. I'll give structs a try. When I start the program, it runs fine at 35mb of ram. It only keeps 15 objects stored in the arrays at a time so why do you think my ram usage increases to 700+ after many hours? Curiously, my CPU usage went from 10% to 5% after I changed to structs on Point and Range. Though my memory still climbs high. Force a GC.collect() now and again. Disable it at the beginning too. I did a test and ran GC.collect() every loop but my memory usage continues to rise. I can see how you'd be able to lower CPU usage by running GC.collect() every now and then but right now I'm stuck on the memory issue. Perhaps my problem lies in the C++ library SFML? I had a quick look at your code. I think its safe to assume the SFML isn't the problem. Whats happening is on every iteration of the event loop, you are allocating, holding a reference somewhere and continuing on. The GC even if it does run cannot release that memory as it is still held. At this point maybe strip out what happens on each loop iteration to find out what is holding references. Divide and conquer.
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On Tuesday, 27 January 2015 at 22:30:13 UTC, Gan wrote: On Tuesday, 27 January 2015 at 21:36:51 UTC, Rikki Cattermole wrote: On 28/01/2015 9:59 a.m., Gan wrote: On Tuesday, 27 January 2015 at 19:59:08 UTC, Gan wrote: On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote: Gan: Is there some special stuff I gotta do extra with structs? Do they need manually allocated and released? Most of your usages of tiny structs should be by value. So just keep in mind they are values. Even when you iterate with a foreach on a mutable array of them :-) On a second question, do I ever need to manually release objects I create with new? Usually not. How much advanced do you want to be? :-) Bye, bearophile Thanks. I'll give structs a try. When I start the program, it runs fine at 35mb of ram. It only keeps 15 objects stored in the arrays at a time so why do you think my ram usage increases to 700+ after many hours? Curiously, my CPU usage went from 10% to 5% after I changed to structs on Point and Range. Though my memory still climbs high. Force a GC.collect() now and again. Disable it at the beginning too. I did a test and ran GC.collect() every loop but my memory usage continues to rise. I can see how you'd be able to lower CPU usage by running GC.collect() every now and then but right now I'm stuck on the memory issue. Perhaps my problem lies in the C++ library SFML? I commented out some stuff and it appears my massive memory consumption comes from my tile.redraw function: void redraw() { undrawn = false; canvas.clear(); //Add stars for (int i = 0; i controller.starsPerTile; i++) { Random gen; gen.seed(unpredictableSeed); int x = uniform(0, controller.tileSize, gen); int y = uniform(0, controller.tileSize, gen); double s = uniform(0, 1, gen) / 1.0; double size = (s * (controller.starSizeMax - controller.starSizeMin)) + controller.starSizeMin; if (x - size / 2 0) { x += size / 2; } if (y - size / 2 0) { y += size / 2; } if (x + size / 2 controller.tileSize) { x -= size / 2; } if (y + size / 2 controller.tileSize) { y -= size / 2; } drawStar(canvas, x, y, size, size); } canvas.display(); } void drawStar(RenderTarget target, int centerX, int centerY, double width, double height) { CircleShape star; if (controller.multiColor == false) { star = controller.stars[0]; } else { Random gen; gen.seed(unpredictableSeed); star = controller.stars[uniform(0, controller.stars.length - 1, gen)]; } star.position = Vector2f(centerX, centerY); star.origin = Vector2f(0.5, 0.5); star.scale = Vector2f(width / 100.0, height / 100.0); target.draw(star); } Would you know why this is using hundreds of mb of rams?
Re: vibe.d error
Bumping as it's still not possible to install lib event via dub. On Sunday, 25 January 2015 at 17:41:38 UTC, Phil wrote: dub init name vibe.d cd name dub Results in Fetching libevent 2.0.1+2.0.16... Error executing command upgrade: Failed to download http://code.dlang.org/packages/libevent/2.0.1%252B2.0.16.zip: 404 Not Found I'm not sure if the error is the file not being there or dub looking there. Is there a workaround for this? Thanks
Re: About variant
On Tue, 27 Jan 2015 21:55:37 +, bioinfornatics wrote: On Tuesday, 27 January 2015 at 21:00:16 UTC, Justin Whear wrote: On Tue, 27 Jan 2015 20:46:59 +, bioinfornatics wrote: void main(){ auto a = Alpha!(int)( 6); auto b = Alpha!(string)( hello); The Alpha struct is not a template, only the constructor is. Remove the explicit instantiations and IFTI does the work: void main(){ auto a = Alpha( 6); auto b = Alpha( hello); Oh really cool or this: import std.variant; struct Alpha { Variant something; this(T) (T v) { something = cast(Variant)v; } } void main () { Alpha a = 6; Alpha b = hello; } signature.asc Description: PGP signature
Re: forcing @nogc on class destructors
On Saturday, 24 January 2015 at 23:28:35 UTC, Jerry Morrison wrote: On Saturday, 24 January 2015 at 15:04:47 UTC, Ola Fosheim Grøstad wrote: If the classes are written for RAII then the destructors have to be called in reverse order of the constructors. IIRC D does not guarantee this when you use the GC. So to do it right there is a lot of GC overhead. Yes, but the usability question is what do programmers expect? How much do they assume before turning to the docs? Unfortunately, I think D is now entrenched in Java/C#ish expectations. Which is no good, since the main advantage D can have over those languages is to restrict the language semantics to a level where D has an inherent performance (timeliness) advantage. My expectations from a GC in a system level programming language would be to give max priority to fast collection at the expense of features (lean and mean). It's a big stretch to expect LIFO behavior from garbage collection. It's not a stretch to expect logging to work. What does logging in a destructor tell you? The destructor might not execute until the program terminates. You might not expect LIFO from the GC, but can you trust library authors to ensure that it does assume LIFO when manual memory management becomes commonplace? D needs to define what it means by safe and convenient. It is currently very much up in there air when it applies and when it does not.
Re: static class vs. static struct
On 01/27/2015 01:33 PM, Piotrek wrote: On Tuesday, 27 January 2015 at 18:24:29 UTC, Ali Çehreli wrote: On 01/27/2015 08:33 AM, Piotrek wrote: Non-static means nested. Hmm,this can be misleading. Nesting in structs doesn't introduce context pointer. Oh, I misread what you wrote. Sorry... classes and structs *nested in struct* doesn't contain the additional context pointer. As opposed to class nested in class. Then I think we'd better not say that non-static means nested. Piotrek Makes sense. Ali
Re: D Management Site
On Tuesday, 27 January 2015 at 18:10:10 UTC, Jonathan Marler wrote: Would people want and use a website that tracks who's working on what in the D Programming Language? People would go to the site and be able to find out what's being worked on, what's not being worked on, who's working on what, what bugs are being worked on. People will have to use the site and submit what they are working on though. I'd be willing to write such a site if people think it would be useful. I really like this idea. It's hard to figure out what's even being worked on without reviewing git.
Re: Using dub
On Tuesday, 27 January 2015 at 08:08:19 UTC, Joel wrote: Oope, yeah, and it ran. Thanks Rikki, I wiped off the dub installation. Now, no errors. The small program worked too. I don't now how to set up the dub executable to work with out doing stuff like this - '../dub' (Mac OS 10.10.1) Joels-MacBook-Pro:window joelcnz$ ../../dub build de_window:test Building package de_window:test in /Users/joelcnz/jpro/dpro2/OtherPeoples/window/ Fetching de_util 0.0.4 (getting selected version)... Placing de_util 0.0.4 to /Users/joelcnz/.dub/packages/... Fetching x11 1.0.5 (getting selected version)... Placing x11 1.0.5 to /Users/joelcnz/.dub/packages/... Fetching de_image 0.3.4 (getting selected version)... Placing de_image 0.3.4 to /Users/joelcnz/.dub/packages/... Fetching derelict-util 1.9.0 (getting selected version)... Placing derelict-util 1.9.0 to /Users/joelcnz/.dub/packages/... Fetching derelict-gl3 1.0.12 (getting selected version)... Placing derelict-gl3 1.0.12 to /Users/joelcnz/.dub/packages/... Building de_util:core 0.0.4 configuration library, build type debug. Running dmd... Building de_image:interfaces 0.3.4 configuration library, build type debug. Running dmd... Building de_image:mutable 0.3.4 configuration library, build type debug. Running dmd... Building x11 1.0.5 configuration library, build type debug. Running dmd... Building de_window:interfaces 0.0.8 configuration library, build type debug. Running dmd... Building derelict-util 1.9.0 configuration library, build type debug. Running dmd... Building derelict-gl3 1.0.12 configuration library, build type debug. Running dmd... Building de_window:test 0.0.8 configuration application, build type debug. Compiling using dmd... Linking... Joels-MacBook-Pro:window joelcnz$ ls LICENSE dub.json README.md dub.selections.json WindowsAPI interfaces cocoa_library libde_window_interfaces.a de_window_test platforms dub test
[Issue 12888] Include template constraints in JSON output
https://issues.dlang.org/show_bug.cgi?id=12888 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/32f0f33f6a6ff5c7e76ac6e481b2ba0c2607d71f Issue 12888 - Include template constraints in JSON output https://github.com/D-Programming-Language/dmd/commit/821e13137c51169504b054b672c00b48c4571fa1 Merge pull request #3657 from Hackerpilot/issue-12888 Issue 12888 - Include template constraints in JSON output --
Re: Window creation, for phobos?
On 1/28/2015 7:04 AM, Rikki Cattermole wrote: First off, Derelict-Util/Derelict-GL3 is a biggy here. Its old code, lets admit it. Its also a standard for loading shared library functions. So Mike Parker, would you be willing for this to be PR'd? And if so, are we ok with this? I have no objections to anything from Derelict being included. My opinion on whether or not graphics and windowing packages belong in Phobos is another matter :-) But feel free to do whatever you need to do with Derelict.
Re: I left my program open for 9 hours and it used up 700mb of ram, could someone review it?
On Tuesday, 27 January 2015 at 22:39:31 UTC, Gan wrote: Would you know why this is using hundreds of mb of rams? Hi, What type is CircleShape? If it is a class, or otherwise contains pointers, then this is probably the source of your problem. You are storing high-entropy data (floating-point / random numbers) within the same type as one containing pointers. This is problematic with a non-precise GC, because the GC will consider the random numbers as possibly pointers, thus pinning random objects within the memory address space. You should be able to work around this problem by: - Making CircleShape a static struct without any pointers - If you need to have pointers associated with CircleShape: splitting pointers and non-pointers into separate arrays of structs - Manually managing memory allocations, and storing the CircleShape instances outside the managed D heap - Building your program for x86_64 - 64 bits of address space will make fake pointer pinning very unlikely - Using a precise GC - none are currently available for D, but one is under development: https://github.com/D-Programming-Language/druntime/pull/1057