Re: Video of my LDC talk @ FOSDEM'14
Enjoy! Besides the noise, I did! Great talk! And thanks for your efforts to make LDC a success.
Re: Dconf 2014 talks - when to be available
On Tuesday, 27 May 2014 at 02:51:51 UTC, Nick B wrote: Hi Can any one advise when we can expect the conference talks (and perhaps the slides as well) to available to download or via Utube ? I saw some of the streamed talks, but would love to view the rest. The MC said initially that they'd have them up in a day or two most likely, then Andrei said he wanted to stagger their release over a couple weeks like he did last time, apparently to stay on top of reddit for awhile. I'm sure they'll post something in the announcements forum eventually.
Re: DirectX bindings
On Sunday, 3 November 2013 at 05:27:24 UTC, evilrat wrote: https://github.com/evilrat666/directx-d this is it. i think i can't continue on this one anymore, nor do i have time, nor passion. i've made a lot of work and meet (almost) no interest. i will be stay in contact, so any pull request will not be lost, but i think this is my last commit to it. i have encountered lot of obstacles such as UFCS on classes, which makes impossible seamless migration of user code from C++ to D(no, that wasnt real purpose but for me it is important point). i may return later, let say in a year or two when D will be more complete and usable, but for now i take my leave. please take my apologies if one really used this bindings or have high hopes on it.
Re: My D book is now officially coming soon
On Tuesday, 6 May 2014 at 19:58:10 UTC, Nick Sabalausky wrote: On 5/6/2014 9:11 AM, Adam D. Ruppe wrote: On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote: Any way to see the TOC? Hmm, not on the website yet but here it is. [snip] Sounds awesome! Jus got mail from PacktPub: D Cookbook is now released: http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book Congratz!
Re: Video of my LDC talk @ FOSDEM'14
Walter Bright, el 26 de May a las 11:09 me escribiste: On 5/26/2014 10:30 AM, w0rp wrote: On Monday, 26 May 2014 at 17:06:27 UTC, Walter Bright wrote: Youtube has solved all these problems - why not use it? You can view .webm directly in recent Firefox or Chrome versions on Windows, you an also view .webm in IE9 and above provided you have the right codecs installed. It's a perfectly acceptable format. It doesn't work on the browser that comes with Windows. That makes it undesirable if you wish to reach the largest audience with the least friction. Why restrict the audience if you don't have to? What is gained by using .webm that would offset the reduced audience? And there is something magical about digital media. Adding a copy to YouTube doesn't mean your webm copy will vanish. Just have both and everybody is happy. :) -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ -- El trabajo no sólo tara, sino que tarará y seguirá tararando. -- Ricardo Vaporeso
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 10:00:01 UTC, Szymon Gatner wrote: On Tuesday, 6 May 2014 at 19:58:10 UTC, Nick Sabalausky wrote: On 5/6/2014 9:11 AM, Adam D. Ruppe wrote: On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote: Any way to see the TOC? Hmm, not on the website yet but here it is. [snip] Sounds awesome! Jus got mail from PacktPub: D Cookbook is now released: http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book Congratz! Just downloaded the eBook version. Printed version will soon follow, I suppose. It couldn't have arrived at a better time, because I'm re-organizing and revising my code at the moment.
Re: Video of my LDC talk @ FOSDEM'14
Kai Nacke: In the same folder are also the videos of the other LLVM related talk. I have appreciated the An approach for energy consumption analysis of programs using LLVM talk, they even have an annotation that statically enforces a certain function to consume less than a specified amount of energy (expressed in pJ). The SPARK 2014: Hybrid Verification using Proofs and Tests talk is nice, but I have seen it already elsewhere. Bye, bearophile
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 10:00:01 UTC, Szymon Gatner wrote: On Tuesday, 6 May 2014 at 19:58:10 UTC, Nick Sabalausky wrote: On 5/6/2014 9:11 AM, Adam D. Ruppe wrote: On Tuesday, 6 May 2014 at 12:40:48 UTC, Szymon Gatner wrote: Any way to see the TOC? Hmm, not on the website yet but here it is. [snip] Sounds awesome! Jus got mail from PacktPub: D Cookbook is now released: http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book Congratz! I am reading it now, but there is a lot of errata :(.
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 11:43:32 UTC, Kozzi wrote: I am reading it now, but there is a lot of errata :(. What do you mean?
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 11:43:32 UTC, Kozzi wrote: I am reading it now, but there is a lot of errata :(. Well that's a good thing about PDF, because you can fix it and update the version online. Matheus.
Re: My D book is now officially coming soon
I mean there is a lot of typo (for e.g. multiple ';' chars at the end of line, import std.stdio : writeln;;;) on page 2,6,8,10,14 ... On page 19: static Vector fromPoint(float[2] point) { import std.math; Vector v; float x = point[0]; float y= point[1]; v.magnitude = sqrt(x ^^ 2 + y ^^ 2); v.direction = atan2(y, x); return v; }}} // this 3 brackets Vector opBinary(string op : +)(Vector rhs) const { auto point = toPoint(), point2 = rhs.toPoint(); point[0] += point2[0]; point[1] += point2[1];];]; // here return Vector.fromPoint(point);); // and here } That is what I already found Dne Tue, 27 May 2014 13:45:53 +0200 Adam D. Ruppe via Digitalmars-d-announce digitalmars-d-announce@puremagic.com napsal(a): On Tuesday, 27 May 2014 at 11:43:32 UTC, Kozzi wrote: I am reading it now, but there is a lot of errata :(. What do you mean? -- Vytvořeno poštovní aplikací Opery: http://www.opera.com/mail/
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 11:57:05 UTC, Daniel Kozak via Digitalmars-d-announce wrote: I mean there is a lot of typo (for e.g. multiple ';' chars at the end of line, import std.stdio : writeln;;;) Blargh, the code got screwed up something nasty through the revision process (chapter 6 especially, the spacing got totally butchered, the end of virtually every line had random characters, wtf, the file got changed from a .doc to a .docx in that process too which i suspect is to blame) and I thought I fixed all those in the final draft but apparently not... I suspect that'll get better past chapter 1; chapter one needed so much content revision that I didn't spend as much time on the punctuation in the review process.
Re: Video of my LDC talk @ FOSDEM'14
On Monday, 26 May 2014 at 05:59:35 UTC, Kai Nacke wrote: [..] http://video.fosdem.org/2014/K4401/Sunday/LDC_the_LLVMbased_D_compiler.webm I can't watch this on my iPhone.
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 12:05:43 UTC, Adam D. Ruppe wrote: On Tuesday, 27 May 2014 at 11:57:05 UTC, Daniel Kozak via Digitalmars-d-announce wrote: I mean there is a lot of typo (for e.g. multiple ';' chars at the end of line, import std.stdio : writeln;;;) Blargh, the code got screwed up something nasty through the revision process (chapter 6 especially, the spacing got totally butchered, the end of virtually every line had random characters, wtf, the file got changed from a .doc to a .docx in that process too which i suspect is to blame) and I thought I fixed all those in the final draft but apparently not... I suspect that'll get better past chapter 1; chapter one needed so much content revision that I didn't spend as much time on the punctuation in the review process. Tell me about formatting getting lost while re-formatting. But why on earth do people (publishers / editors) still insist on using .doc and .docx (i.e. MS)!? This is to invite disaster. Laziness? Saving money? Nah, you'll work and pay more in the end. Incompetence? I dunno.
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 12:59:59 UTC, Chris wrote: On Tuesday, 27 May 2014 at 12:05:43 UTC, Adam D. Ruppe wrote: On Tuesday, 27 May 2014 at 11:57:05 UTC, Daniel Kozak via Digitalmars-d-announce wrote: I mean there is a lot of typo (for e.g. multiple ';' chars at the end of line, import std.stdio : writeln;;;) Blargh, the code got screwed up something nasty through the revision process (chapter 6 especially, the spacing got totally butchered, the end of virtually every line had random characters, wtf, the file got changed from a .doc to a .docx in that process too which i suspect is to blame) and I thought I fixed all those in the final draft but apparently not... I suspect that'll get better past chapter 1; chapter one needed so much content revision that I didn't spend as much time on the punctuation in the review process. Tell me about formatting getting lost while re-formatting. But why on earth do people (publishers / editors) still insist on using .doc and .docx (i.e. MS)!? This is to invite disaster. Laziness? Saving money? Nah, you'll work and pay more in the end. Incompetence? I dunno. Will epub version be available too?
Re: My D book is now officially coming soon
On Tuesday, 27 May 2014 at 13:27:56 UTC, Szymon Gatner wrote: Will epub version be available too? Yeah, I think it is already on the packt website.
Re: Dconf 2014 talks - when to be available
apparently to stay on top of reddit for awhile. Explain plz
Scott Meyers' DConf 2014 keynote The Last Thing D Needs
http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/ https://news.ycombinator.com/newest (search that page, if not found click More and search again) https://www.facebook.com/dlang.org/posts/855022447844771 https://twitter.com/D_Programming/status/471330026168651777 Andrei
Re: Dconf 2014 talks - when to be available
On 5/27/14, 12:41 AM, Nick B wrote: On Tuesday, 27 May 2014 at 07:14:54 UTC, Joakim wrote: The MC said initially that they'd have them up in a day or two most likely, then Andrei said he wanted to stagger their release over a couple weeks like he did last time, apparently to stay on top of reddit for awhile. I'm sure they'll post something in the announcements forum eventually. perhaps Andrei would like to reply ? Nick The schedule of making recordings available will be similar to that of DConf 2013. -- Andrei
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On 5/27/2014 12:42 PM, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/ https://news.ycombinator.com/newest (search that page, if not found click More and search again) https://www.facebook.com/dlang.org/posts/855022447844771 https://twitter.com/D_Programming/status/471330026168651777 Andrei What? Andrei's keynote isn't first? :( Nonetheless, this Scott Meyers talk is fantastic (and a good choice for first released). Only one thing could've made this better: When the MC finishes his intro, there should be some heavy rock music and laser lights while Scott comes up on stage. :) Oh well, maybe next year...Who's got the fog machine?
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 16:42:35 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/ Thanks, is it possible to put it on Youtube as well? Ustream stutters every second from where I am which makes me feel sorry for the speaker…
Re: My D book is now officially coming soon
On Tuesday, 6 May 2014 at 16:38:51 UTC, Andrei Alexandrescu wrote: http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book I just agreed with Packt to write a foreword for the book. -- Andrei I just read the foreword. It's great!
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
Great, but I think this should be on youtube too, reasons for this is the possibility to change resolution and other features like subtitles for foreigners etc. Matheus.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
That was brilliant. I think Scott made two very good points. D needs people like himself to educate others, and that D should focus on behaviour which makes sense not only in a particular context, but with respect to the other contexts. (Which is what C++ lacks greatly.)
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On 5/27/14, 2:57 PM, w0rp wrote: That was brilliant. I think Scott made two very good points. D needs people like himself to educate others, and that D should focus on behaviour which makes sense not only in a particular context, but with respect to the other contexts. (Which is what C++ lacks greatly.) Really? What I got out of it was that D doesn't need people like him because his job is to explain the inconsistencies of the language. By designing a consistent language in the first place, people can readily understand it in all context thereby eliminating the need for people like him. At roughly 04:55 he says: I am a professional explainer. That's my job. Who knew that you can have a job doing that? Turns out you can actually make a career of it. He gives a slew of examples of kind of things he's got to explain on a daily basis and closes out the whole thing with: The message that I bring to the D Community, based on my experience with with C++, is that the last thing D needs is somebody like me.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tue, 27 May 2014 14:57:46 -0400, w0rp devw...@gmail.com wrote: That was brilliant. I think Scott made two very good points. D needs people like himself to educate others I think you misunderstood that point ;) He was saying to make D so that we DON'T need specialists like himself that can make a career out of explaining the strange quirks of D, mostly by not having those quirks in the first place. -Steve
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 19:44:01 UTC, Andrew Edwards wrote: Really? What I got out of it was that D doesn't need people like him because his job is to explain the inconsistencies of the language. By designing a consistent language in the first place, people can readily understand it in all context thereby eliminating the need for people like him. Another point is that D is still small enough that we have time to fix things before they get out of control. (One of my favorite parts of this talk is when he points out that you need parenthesis in a specific kind of lambda just because the committee forgot to update the grammar specification.)
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tue, 27 May 2014 16:11:12 -0400, w0rp devw...@gmail.com wrote: On Tuesday, 27 May 2014 at 19:43:57 UTC, Steven Schveighoffer wrote: On Tue, 27 May 2014 14:57:46 -0400, w0rp devw...@gmail.com wrote: That was brilliant. I think Scott made two very good points. D needs people like himself to educate others I think you misunderstood that point ;) He was saying to make D so that we DON'T need specialists like himself that can make a career out of explaining the strange quirks of D, mostly by not having those quirks in the first place. -Steve Oh, I see what he's saying now. The *last* thing. That's... confusing use of English. Yes, it's a common phrase. http://dictionary.cambridge.org/us/dictionary/british/the-last-thing-you-want-need-etc Basically it means something you definitely DON'T need. -Steve
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 20:11:13 UTC, w0rp wrote: On Tuesday, 27 May 2014 at 19:43:57 UTC, Steven Schveighoffer wrote: On Tue, 27 May 2014 14:57:46 -0400, w0rp devw...@gmail.com wrote: That was brilliant. I think Scott made two very good points. D needs people like himself to educate others I think you misunderstood that point ;) He was saying to make D so that we DON'T need specialists like himself that can make a career out of explaining the strange quirks of D, mostly by not having those quirks in the first place. -Steve Oh, I see what he's saying now. The *last* thing. That's... confusing use of English. It makes more sense with respect to his other comment, though. Sometimes I think English could use a guy like him.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 21:16:34 UTC, Chris Nicholson-Sauls wrote: On Tuesday, 27 May 2014 at 20:11:13 UTC, w0rp wrote: On Tuesday, 27 May 2014 at 19:43:57 UTC, Steven Schveighoffer wrote: On Tue, 27 May 2014 14:57:46 -0400, w0rp devw...@gmail.com wrote: That was brilliant. I think Scott made two very good points. D needs people like himself to educate others I think you misunderstood that point ;) He was saying to make D so that we DON'T need specialists like himself that can make a career out of explaining the strange quirks of D, mostly by not having those quirks in the first place. -Steve Oh, I see what he's saying now. The *last* thing. That's... confusing use of English. It makes more sense with respect to his other comment, though. Sometimes I think English could use a guy like him. I'm actually a native speaker of 25 years and I didn't get it at first. Natural language communicates ideas approximately.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On 5/27/2014 2:22 PM, w0rp wrote: I'm actually a native speaker of 25 years and I didn't get it at first. Natural language communicates ideas approximately. What bugs me is when people say: I could care less. when they mean: I couldn't care less. and: If you think that, you have another thing coming. when they mean: If you think that, you have another think coming.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On 5/27/2014 6:10 PM, Johannes Totz wrote: On 27/05/2014 18:43, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Tuesday, 27 May 2014 at 16:42:35 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/ Thanks, is it possible to put it on Youtube as well? Ustream stutters every second from where I am which makes me feel sorry for the speaker… http://rg3.github.io/youtube-dl/ helps with the stutter. Or this FF extension (which is what I normally use): http://www.downloadhelper.net/
Re: Dconf 2014 talks - when to be available
Ali Çehreli, el 27 de May a las 10:40 me escribiste: On 05/27/2014 09:18 AM, Suliman wrote: apparently to stay on top of reddit for awhile. Explain plz A benefit of releasing the presentations slowly is to enable constant exposure to DConf in the coming weeks, as opposed to making all of them available and potentially watch interest die in a few days. I think they should be uploaded all ASAP and then you can do official announcements in reddit or wherever you thinks it's best to promote the language. But really, introducing artificial waiting time for people ALREADY interested and using the language in the name of marketing is really annoying! -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ -- Fantasy is as important as wisdom
Re: Dconf 2014 talks - when to be available
On Tuesday, 27 May 2014 at 23:08:01 UTC, Leandro Lucarella wrote: I think they should be uploaded all ASAP and then you can do official announcements in reddit or wherever you thinks it's best to promote the language. Aye, we could also, if we want some new thing to post to reddit each time, also write accompanying articles or something so even people who watch them all early will still have a reason to click and get involved instead of just leaking the links themselves.
Re: Dconf 2014 talks - when to be available
On Tuesday, 27 May 2014 at 23:08:01 UTC, Leandro Lucarella wrote: Ali Çehreli, el 27 de May a las 10:40 me escribiste: On 05/27/2014 09:18 AM, Suliman wrote: apparently to stay on top of reddit for awhile. Explain plz A benefit of releasing the presentations slowly is to enable constant exposure to DConf in the coming weeks, as opposed to making all of them available and potentially watch interest die in a few days. I think they should be uploaded all ASAP and then you can do official announcements in reddit or wherever you thinks it's best to promote the language. But really, introducing artificial waiting time for people ALREADY interested and using the language in the name of marketing is really annoying! I agree 100%. Educating people currently interested is as important as marketing.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
Brian Schott, el 27 de May a las 20:03 me escribiste: On Tuesday, 27 May 2014 at 19:44:01 UTC, Andrew Edwards wrote: Really? What I got out of it was that D doesn't need people like him because his job is to explain the inconsistencies of the language. By designing a consistent language in the first place, people can readily understand it in all context thereby eliminating the need for people like him. Another point is that D is still small enough that we have time to fix things before they get out of control. (One of my favorite parts of this talk is when he points out that you need parenthesis in a specific kind of lambda just because the committee forgot to update the grammar specification.) This is very related to Don's message of last year's talk about ROI of breaking changes. https://www.youtube.com/watch?v=pmwKRYrfEyY#t=30m55s -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ -- Y serán tiempos de vanos encuentros entre humano y humano; en que las fieras se comerán entre ellas y después del final; en que se abríran las tierras y los cielos... y en el medio de la nada Racing saldrá campeón. -- Ricardo Vaporeso
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 22:10:02 UTC, Johannes Totz wrote: Thanks, is it possible to put it on Youtube as well? Ustream stutters every second from where I am which makes me feel sorry for the speaker… http://rg3.github.io/youtube-dl/ helps with the stutter. +1
Re: Dconf 2014 talks - when to be available
On Tuesday, 27 May 2014 at 23:48:44 UTC, currysoup wrote: On Tuesday, 27 May 2014 at 23:08:01 UTC, Leandro Lucarella wrote: Ali Çehreli, el 27 de May a las 10:40 me escribiste: On 05/27/2014 09:18 AM, Suliman wrote: apparently to stay on top of reddit for awhile. Explain plz A benefit of releasing the presentations slowly is to enable constant exposure to DConf in the coming weeks, as opposed to making all of them available and potentially watch interest die in a few days. I think they should be uploaded all ASAP and then you can do official announcements in reddit or wherever you thinks it's best to promote the language. But really, introducing artificial waiting time for people ALREADY interested and using the language in the name of marketing is really annoying! I agree 100%. Educating people currently interested is as important as marketing. I actually prefer the slow release of the videos - it gives me enough time to digest each talk and discuss it before the next one grabs mine and everyone else's attention. I think releasing one video every few days leads to much more in-depth discussion on the forum as well.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Tuesday, 27 May 2014 at 16:42:35 UTC, Andrei Alexandrescu wrote: http://www.reddit.com/r/programming/comments/26m8hy/scott_meyers_dconf_2014_keynote_the_last_thing_d/ https://news.ycombinator.com/newest (search that page, if not found click More and search again) https://www.facebook.com/dlang.org/posts/855022447844771 https://twitter.com/D_Programming/status/471330026168651777 Andrei I did a translation of most of the code in the slides. http://dpaste.dzfl.pl/72b5cfcb72e4 I'm planning to transform it into blog post (or series). Right now it just has some scratch notes. Feel free to let me know everything I got wrong.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
I did a translation of most of the code in the slides. http://dpaste.dzfl.pl/72b5cfcb72e4 I'm planning to transform it into blog post (or series). Right now it just has some scratch notes. Feel free to let me know everything I got wrong. That's a good idea. I think most of us did that while listening to the talk. I kept telling myself: 'oh wait, that'd simpler in D' or 'that does not exist in D'. As for the class inheritance problem, I'd also be interested in an answer.
Re: Scott Meyers' DConf 2014 keynote The Last Thing D Needs
On Wednesday, 28 May 2014 at 05:30:18 UTC, Philippe Sigaud via Digitalmars-d-announce wrote: I did a translation of most of the code in the slides. http://dpaste.dzfl.pl/72b5cfcb72e4 I'm planning to transform it into blog post (or series). Right now it just has some scratch notes. Feel free to let me know everything I got wrong. That's a good idea. I think most of us did that while listening to the talk. I kept telling myself: 'oh wait, that'd simpler in D' or 'that does not exist in D'. As for the class inheritance problem, I'd also be interested in an answer. When he explained why C++ inferred a const int type as int, he tripped me up because D does drop const for value types. But D does the simple to explain thing, may not be the expected thing (seen questions about it in D.learn), but it is simple to explain.
Re: Dev. Collaboration
On 05/27/2014 02:12 AM, chuck wrote: Would anyone be interested in a collaboration forum? I am thinking of starting one on Proboards to aid in development/collaboration between developers on D and libraries/bindings. Reading through the posts, I have seen that several people have created small projects that do the same thing (I have seen multiple for MySql alone, none of which has really gained true traction). So here is what I propose: 1) The forum will be host different aspects of development (Database/bindings, Phobos development, networking tools, etc.). 2) Form dev. committees to fill the most useful tasks in the group of choice. For example, focusing on doing one thing quickly and sustainably rather than burning out creating a project alone that will be difficult to maintain afterwords. 3) This should help increase the number of code examples, increasing the visibility of D to anyone interested. Hopefully, this will also increase the community. I think it's a great idea - DETF (D Engineering Task Force). For this to succeed, I think connecting to existing communication channels is very important. This means NNTP/mailing list, github, auto-tester, dub, wiki (with DIPS) etc etc. Setting up some new PHP forums will only split the community.
Re: Dev. Collaboration
On 27/05/2014 6:48 p.m., simendsjo wrote: On 05/27/2014 02:12 AM, chuck wrote: Would anyone be interested in a collaboration forum? I am thinking of starting one on Proboards to aid in development/collaboration between developers on D and libraries/bindings. Reading through the posts, I have seen that several people have created small projects that do the same thing (I have seen multiple for MySql alone, none of which has really gained true traction). So here is what I propose: 1) The forum will be host different aspects of development (Database/bindings, Phobos development, networking tools, etc.). 2) Form dev. committees to fill the most useful tasks in the group of choice. For example, focusing on doing one thing quickly and sustainably rather than burning out creating a project alone that will be difficult to maintain afterwords. 3) This should help increase the number of code examples, increasing the visibility of D to anyone interested. Hopefully, this will also increase the community. I think it's a great idea - DETF (D Engineering Task Force). For this to succeed, I think connecting to existing communication channels is very important. This means NNTP/mailing list, github, auto-tester, dub, wiki (with DIPS) etc etc. Setting up some new PHP forums will only split the community. I will only support something like DETF if it only deals with specifications, not actual implementations. The reasoning being, together they will provide feature requirements and library definitions that are required in D to be able to work in most problem domains. Essentially a massive todo list. The goal of course will be to meet all of them spec wise for any project you start that involves them. Which of course we can reference in the spec outline. The priority would not be to start new projects, but to make existing projects meet the specs where required. This could even be integrated into dub/dub repo. To make it easily browsable. But at the end of the day, its just to generate ideas. Gives a direction for where we want to go.
Re: New pointer type for GC
On Tuesday, 27 May 2014 at 02:52:48 UTC, Etienne Cimon wrote: I've been looking at the GC and found that the main problem is that there's no clear information about the pointers. At least smart pointers have some info inside them but GC pointers are completely plain 4-8 bytes and nothing else. On 64 bit platform 8 bytes is sufficient if you control the allocator: 1. Avoid allocating non-GC memory from specific address range. 2. Set a max-size for GC allocated objects. Then the test becomes this: if ((ptr NONGCMASK)==0){ heapinfo_ptr = ptrMASK; // process ptr }
Does D support plugins with dll written in D ?
Hello, note that D is still very new to me. The documentation for http://dlang.org/phobos/core_runtime.html#.Runtime.loadLibrary is a bit too terse to answer my question. I would like to know if it would allow to use Object.factory() with the classes defined in the loaded library and if the GC would manage data allocated with new in the code of the library. Does the loaded dll need to be defined as a module or something like that ?
Re: Member function pointers
On Mon, Jun 10, 2013 at 10:13 PM, Jacob Carlborg d...@me.com wrote: On 2013-06-10 18:34, Manu wrote: On 11 June 2013 02:26, Jacob Carlborg d...@me.com mailto:d...@me.com wrote: On 2013-06-10 17:40, David Nadlinger wrote: Let me try to summarize it in code: --- class A { void foo(); } auto memberFun = (A.foo).funcptr; auto a = new A; memberFun(a); --- Why is this better than a delegate? It's not 'better', it's different. class A { void foo(); } auto memberFun = (A.foo).funcptr; auto a = new A; void delegate () dg; dg.funcptr = memberFun; dg.ptr = cast(void*) a; dg(); The details can be hidden in a function call. Sure, a delegate could be type safe but still don't see the point. -- /Jacob Carlborg Greetings Apologies for bringing up this year old thread. With https://github.com/D-Programming-Language/dmd/pull/3181 getting merged, it is no longer feasible to directly assign dg.funcptr (which is not an lvalue now). The problem is that the code suggested by David also does not work. Is there an alternative? Regards - Puneet
Questions about the scope/Exception machinery
Hello dear D fellows :D, The problem boils down to this. I try to write a Software which should be as compact as possible. This means that i don't like to use any exception handling (which appears to be hardly integrated into the language, not that good for demoscene/OS dev stuff). So i ran into the first issue, scope expressions. When i write scope(exit) foo(); it seems that it generates exception ahndling code. Is this the case even if the called function and the callee are both nothrow decorated? Can i force the compiler to generate goto code instead of the exception handling stuff?
Re: Questions about the scope/Exception machinery
ok I found a old thread about it, just delete this thread please
Re: Questions about the scope/Exception machinery
Dne Tue, 27 May 2014 14:02:04 +0200 Qox via Digitalmars-d digitalmars-d@puremagic.com napsal(a): ok I found a old thread about it, just delete this thread please This is mail list so it is not possible to delete thread. Btw, can you post link to the thread which you find.
Re: Questions about the scope/Exception machinery
The thread is http://forum.dlang.org/thread/dtcxszysceiopzwew...@forum.dlang.org?page=1 Title scope(exit) without exception handling?
Re: Member function pointers
https://github.com/D-Programming-Language/dmd/pull/3181 Daniel asked me to use this. And it works. Use something like: union U { void delegate(int) dg; struct { void* ptr; void function(int) funcptr; } } U u; u.dg = dg; u.funcptr = ...; u.ptr = ...; Regards - Puneet
Re: Questions about the scope/Exception machinery
nothrow doesn't seem to work with the recent dmd compiler :( I know it because _d_local_unwind2() is still called. Seems as if I need another more ugly (but still nicer than C++) solution. Mixins which jump on an error to a label...hell I love low level languages (Java is in this sense crap because they disallow [usefull] constructs like goto, templates, ...) the code will look like this (usage) mixin(onError(condition, handling0, handlingCallback, parameter0, parameter1)); the CTFE function onError checks the condition, if it is false it copies the parameters into variables and jumps to the label named after handling0. on the end of the function there will be mixin(errorHandling(cast(int)0, [handling0, handlingCallback, ...])); which writes the goto labels, handling code etc which looks like this label_handleFoo: handleFoo(); label_handling0: handlingCallback(handling0_parameter0, handling0_parameter1); return cast(int)0; a bit ugly but not so ugly as C++ ... any better ideas?
Re: Questions about the scope/Exception machinery
Ofcourse this doesn't look that maintainable to me...well, then the C++ struct destructor way???
Re: Questions about the scope/Exception machinery
On 5/27/2014 9:07 PM, Daniel Kozak via Digitalmars-d wrote: Dne Tue, 27 May 2014 14:02:04 +0200 Qox via Digitalmars-d digitalmars-d@puremagic.com napsal(a): ok I found a old thread about it, just delete this thread please This is mail list so it is not possible to delete thread. Btw, can you post link to the thread which you find. Actually, it's a newsgroup server :)
Re: Questions about the scope/Exception machinery
On 5/27/2014 9:43 PM, Qox wrote: nothrow doesn't seem to work with the recent dmd compiler :( I know it because _d_local_unwind2() is still called. notrhow doesn't turn off exception handling. It just doesn't allow you to throw from a particular function. From inside a nothrow function, you can still call functions that throw, but you have to wrap them in try..catch blocks and swallow any exceptions that *are* thrown.
System level language, GC, allocation and typeinfo
The terms system level programming and garbage collection are mutually exclusive, but I see the value in GC. However, I cannot really come up with a single situation where I don't know what kind of allocator I have used when accessing a pointer. I think it makes a lot of sense to think in the direction of the post of Etienne and have allocator based pointer types. With a template heavy coding style it becomes less problematic than in a language like C. If you go templates all the way. That could reduce the amount of scanned memory significantly. Basically I think a system level language should have at least owned/borrowed, ref counted and gc-pointer types. I also wonder how often you actually have a need to discriminate between more than 255 classes. It seems to me that with whole program compilation you could often just use a single byte for type info and a switch table for virtual functions. That would leave a lot more room for optimization. When it comes to allocators I am more likely to use a factory for creating objects from my own allocator than pooling different types in a generic allocator. Except maybe for regions that are to be released at once, but I don't use that much. So I wonder if it is better to rather spend the effort on partial pre-initialization as an optimization for class specific factories than trying to be overly generic. By partial pre-initialization I mean that you reset used fields when an object is freed, thus you don't need to reinitialize vtable pointers and avoid calling constructors upon allocation (the objects are pre-constructed). Ideally you push object construction to time periods where the CPU is idle. With a performance mindset…
Re: Questions about the scope/Exception machinery
sounds a bit like C++ handling to me, for me *personally* it misses also the point about nothrow, because it gurantues nothing...which is like in C++ and imho bad...
Re: New pointer type for GC
On Tuesday, 27 May 2014 at 03:26:33 UTC, Etienne Cimon wrote: On 2014-05-26 23:19, Daniel Murphy wrote: Etienne Cimon wrote in message news:lm0um0$tgh$1...@digitalmars.com... I think everything everywhere would have to change for this to be possible. Sounds like never gonna happen. In terms of logic it's not that complicated, I could change DMD, druntime, phobos myself for it. The main problem is that the apostrophe is really, a major cultural change Please, no apostrophe. It'll mess syntax highlighters, and possible indenters.
Re: New pointer type for GC
On 2014-05-27 3:56 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On 64 bit platform 8 bytes is sufficient if you control the allocator: 1. Avoid allocating non-GC memory from specific address range. 2. Set a max-size for GC allocated objects. Then the test becomes this: if ((ptr NONGCMASK)==0){ heapinfo_ptr = ptrMASK; // process ptr } That's true, though you still need the thread ID for references to pointers and you need to be able to pass those pointers to C. If that's done manually, you end up sanitizing the pointers too often, it becomes boilerplate.
Re: New pointer type for GC
On 2014-05-27 9:52 AM, Idan Arye wrote: Please, no apostrophe. It'll mess syntax highlighters, and possible indenters. How about #? void# ptr; void## ptr2 = ptr; assert(sizeof(ptr) == size_t + 3); assert(szptr_t == sizeof(ptr)); szptr_t ptr2Val = cast(szptr_t) ptr; char magicNum = ptr2.magic; dchar threadId = ptr2.thread; char[3] poolId = ptr.pool;
Re: New pointer type for GC
On Tuesday, 27 May 2014 at 13:58:26 UTC, Etienne wrote: That's true, though you still need the thread ID for references to pointers and you need to be able to pass those pointers to C. I am not really sure how useful references to gc-pointers is. I certainly would trade them in for multiple return values. I also think it is reasonable to ban transfer of GC mem to C code if all GC mem is accounted for with gc-typed pointers...
Re: Associative Arrays max length? 32bit/64bit
On Mon, 26 May 2014 19:03:22 -0400, H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sat, May 24, 2014 at 11:54:47PM -0700, Steven Schveighoffer via Digitalmars-d wrote: On Sat, 24 May 2014 21:39:14 -0700, H. S. Teoh via Digitalmars-d digitalmars-d@puremagic.com wrote: On Sat, May 24, 2014 at 06:05:49PM -0700, Steven Schveighoffer via Digitalmars-d wrote: On Sat, 24 May 2014 02:54:01 -0700, FG h...@fgda.pl wrote: [...] Really? Then what does TypeInfo.compare(void*, void*) use? For example here: auto key_hash = keyti.getHash(pkey); Entry *e; /* ... */ if (key_hash == e.hash) { auto c = keyti.compare(pkey, e + 1); if (c == 0) goto Lret; } You know what, you are right. I assumed it used keyti.equals. This is a bug imo, since opCmp will be used, and opEquals will be ignored. Just checking for opCmp == 0 is identical to opEquals, except some types can define opEquals but not opCmp. But I don't know if it will get fixed. The whole AA runtime has to be redone at some point. [...] This has been argued over in a druntime pull before. I'm 100% for changing the above line (and all other instances of it) to use keyti.equals() instead. But that was shot down due to potential breakage of existing code. :-( :-( Nevermind the fact that it probably breaks a lot more *new* code than it ever will break old code... :-( Any object/struct that defines opCmp but not opEquals is broken, and deserves to not work with AAs. It's a trivial change to add opEquals when opCmp is defined. This change should happen should happen. What pull request is it? Sorry for the late response, I've been very busy with other things. I can't seem to find the PR anymore (it got closed over disagreement about how things should be fixed), but I did find the branch my code was in. The bugzilla issue is 10380. Looking at the bug, I see that apparently Denis has pushed through a hack fix for it: https://github.com/D-Programming-Language/druntime/pull/736 Hah, looking at that PR, it references the original PR (https://github.com/D-Programming-Language/druntime/pull/522). In which I commented, I remember this one. And look, there are the rules I outlined :) But I think there was some indication that a runtime-based version was imminent. I don't know what happened to that. Going to comment again on that PR. We should do something to make our way back to sane logic. It's been far too long that AA's have been broken in druntime. Somebody should just take the aaA.d out in the back and shoot it, and replace it with a better implementation. I think users will be far happier with that. I don't know that the current implementation is broken, just horrible. I'd rather focus on getting a full library type able to be up-to-par with the builtin type, and then switch the implementation over in the compiler. IIRC, the compiler does some magic (i.e. ignoring certain attribute requirements) that can't be done for a library type. [...] It's not that hard to get a library AA to be on par with the builtin type. The last time I tried it, though, I got stuck on trying that solve const issues that even the builtin type doesn't solve correctly. The main showstopper, however, is the amount of effort it takes to extricate the current AA implementation from the compiler. There are just too many places where it relies on compiler magic. Yes, it would be worth a lot to see if we can create an equivalent AA type in the library first, BEFORE trying to replace the builtin AA. The way it was done originally, was more of a mess than the fully compiler-defined AA. But this doesn't mean we can't fix the runtime. -Steve
Re: New pointer type for GC
On 2014-05-27 10:18 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Tuesday, 27 May 2014 at 13:58:26 UTC, Etienne wrote: That's true, though you still need the thread ID for references to pointers and you need to be able to pass those pointers to C. I am not really sure how useful references to gc-pointers is. I certainly would trade them in for multiple return values. I also think it is reasonable to ban transfer of GC mem to C code if all GC mem is accounted for with gc-typed pointers... I think the GC is the future of D considering it's embedded to the very core of the language, and compatibility with C code is ... elementary. Also, thread IDs in ptr references are to the GC as ref counts are to the smart pointers. If you remove the refCount from smart pointers, you end up scanning the whole memory to count them don't you? So then, why remove the thread ID from GC references, if only to look for them in each thread? You slow the GC down by as much total memory there is in all threads vs the avg in a thread, AND you remove parallel collection - by not having the Thread ID in gc ptr references So you understand that's exactly why the GC has to stop the world, and no gaming platform will ever turn to the default behavior of a language if it stops its world. As a matter of fact, I can't see any other way of fixing the GC than adding the Thread ID in there :/
Re: Questions about the scope/Exception machinery
On Tuesday, 27 May 2014 at 13:24:08 UTC, Qox wrote: sounds a bit like C++ handling to me, for me *personally* it misses also the point about nothrow, because it gurantues nothing...which is like in C++ and imho bad... It guarantees at compile time that your function will not throw an Exception.
Re: New pointer type for GC
On Tuesday, 27 May 2014 at 14:42:34 UTC, Etienne wrote: I think the GC is the future of D considering it's embedded to the very core of the language, and compatibility with C code is ... elementary. Well, but then I think you should be required to do manual tracking while it is being retained by C code. Basically a ref counter that keeps it marked reachable by the gc until released. You slow the GC down by as much total memory there is in all threads vs the avg in a thread, AND you remove parallel collection - by not having the Thread ID in gc ptr references Not if you restrict the gc heap to a set of blocks. You can also keep thread info in the heap memoryblock. behavior of a language if it stops its world. As a matter of fact, I can't see any other way of fixing the GC than adding the Thread ID in there :/ By having multiple local GCs?
Voldemort declarations inside structs with ctor initialization
Considering something like this: auto stuff = [1, 2, 3]; struct Foo { typeof(stuff.filter!(a != 2)) foo; this(int = 0) { // assume we must initialize foo in ctor, // for instance because it needs ctor args; // in this contrived case because 'stuff' // is not known at compile-time foo = stuff.filter!(a != 2); } auto front() { return foo.front(); } void popFront() { return foo.popFront(); } bool empty() { return foo.empty; } } If the language allowed foo to be declared using auto (which would be deduced from the assignment in the ctor), that would be nice, right? Is that too hard to implement? As it stands, in some situations the declaration can get rather awkward and unwieldy (yes, an alias helps). It also violates the DRY principle, requiring changes in two places, when they do occur. BTW, why doesn't this example work with lambdas (a = a != 2) instead of a string mixin (a != 2)? BTW 2, is `this(int = 0)' the best workaround (still?) for the fact that I want the ctor to be called, even if it doesn't really require any parameter?
Re: Voldemort declarations inside structs with ctor initialization
Luís Marques: If the language allowed foo to be declared using auto (which would be deduced from the assignment in the ctor), that would be nice, right? This is a kind of flow typing, it's rather useful but it introduces several complexities, so I think it's now too much late to add it to D. BTW, why doesn't this example work with lambdas (a = a != 2) instead of a string mixin (a != 2)? I think lambda instantiations defines a different type. So it's incompatible. BTW 2, is `this(int = 0)' the best workaround (still?) I think it's not a good workaround. Bye, bearophile
Re: Thanks for a great DConf
On Saturday, 24 May 2014 at 23:37:44 UTC, aliyome wrote: On Saturday, 24 May 2014 at 20:34:03 UTC, monarch_dodra wrote: On Saturday, 24 May 2014 at 17:40:29 UTC, Nick Sabalausky wrote: I'm looking forward to the YouTube reruns for the talks I still missed. (I still can't believe I missed Andrei's keynote!) +1 please. me too. +1 +1, thanks.
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 15:06:53 UTC, bearophile wrote: BTW, why doesn't this example work with lambdas (a = a != 2) instead of a string mixin (a != 2)? I think lambda instantiations defines a different type. So it's incompatible. Incompatible with what? I meant changing it in both the declaration and the initialization. BTW 2, is `this(int = 0)' the best workaround (still?) I think it's not a good workaround. What should I use then?
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 15:40:04 UTC, Luís Marques wrote: On Tuesday, 27 May 2014 at 15:06:53 UTC, bearophile wrote: BTW, why doesn't this example work with lambdas (a = a != 2) instead of a string mixin (a != 2)? I think lambda instantiations defines a different type. So it's incompatible. Incompatible with what? I meant changing it in both the declaration and the initialization. Lambdas are not cached, so each lambda is unique even if it's code is the same: void main(){ pragma(msg,(int a)=a); //prints __lambda1 pragma(msg,(int a)=a); //prints __lambda2 } At any rate, you can't use lambdas(neither `delegate` nor `function`) when declaring a member of class or struct, since D will treat it as a method(rather than a static function) and complain about the `this` reference.
Re: New pointer type for GC
On 2014-05-27 10:54 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: On Tuesday, 27 May 2014 at 14:42:34 UTC, Etienne wrote: I think the GC is the future of D considering it's embedded to the very core of the language, and compatibility with C code is ... elementary. Well, but then I think you should be required to do manual tracking while it is being retained by C code. Basically a ref counter that keeps it marked reachable by the gc until released. You slow the GC down by as much total memory there is in all threads vs the avg in a thread, AND you remove parallel collection - by not having the Thread ID in gc ptr references Not if you restrict the gc heap to a set of blocks. You can also keep thread info in the heap memoryblock. behavior of a language if it stops its world. As a matter of fact, I can't see any other way of fixing the GC than adding the Thread ID in there :/ By having multiple local GCs? You're right, it's obviously easier to keep it as the same pointer syntax but hijack the stdlib malloc functions to forcibly go through the GC. If the GC controls everything, you can keep the info in 8 byte pointers. - The GC always returns an libc-incompatible pointer value - Dereferencing should call the resolver from the GC to process it with the libc-compatible value (possibly just removing the last couple bytes) - Sending a pointer through extern(C) should call the sanitizer which resolves the real pointer through the GC and sends that - The last bytes of a pointer would contain thread ID for void** and poolID for void* - This would only work on x64 platforms
Re: New pointer type for GC
On Tuesday, 27 May 2014 at 16:47:38 UTC, Etienne wrote: You're right, it's obviously easier to keep it as the same pointer syntax but hijack the stdlib malloc functions to forcibly go through the GC. That is an option, and having a hijacked malloc would probably also make it possible to optimize out uneccessary allocations as well as inline allocations. If you have a GC-pointer type and ban transitions to regular pointers unless they are borrowed pointers then that would also be ok (you don't need to hijack malloc then).
Re: System level language, GC, allocation and typeinfo
On 2014-05-27 9:06 AM, Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com wrote: I think it makes a lot of sense to think in the direction of the post of Etienne and have allocator based pointer types. With a template heavy coding style it becomes less problematic than in a language like C. If you go templates all the way. That could reduce the amount of scanned memory significantly. Basically I think a system level language should have at least owned/borrowed, ref counted and gc-pointer types. I agree about this. The GC could be optimized under x86_64, with 18,446,744,073,709,551,615 possible values you don't exactly have any computers with 18 exabytes (18,000 petabytes) of memory. This is a lot of wasted space that could be used to make the GC lookups at O(1) speed with parallel collection.
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 15:06:53 UTC, bearophile wrote: Luís Marques: If the language allowed foo to be declared using auto (which would be deduced from the assignment in the ctor), that would be nice, right? This is a kind of flow typing, it's rather useful but it introduces several complexities, so I think it's now too much late to add it to D. Not necessarily. The first assignment of a member in a constructor is already treated as special, so I guess we're halfway there.
Re: Voldemort declarations inside structs with ctor initialization
On 5/27/14, 6:26 AM, Idan Arye wrote: On Tuesday, 27 May 2014 at 15:40:04 UTC, Luís Marques wrote: On Tuesday, 27 May 2014 at 15:06:53 UTC, bearophile wrote: BTW, why doesn't this example work with lambdas (a = a != 2) instead of a string mixin (a != 2)? I think lambda instantiations defines a different type. So it's incompatible. Incompatible with what? I meant changing it in both the declaration and the initialization. Lambdas are not cached, so each lambda is unique even if it's code is the same: void main(){ pragma(msg,(int a)=a); //prints __lambda1 pragma(msg,(int a)=a); //prints __lambda2 } At any rate, you can't use lambdas(neither `delegate` nor `function`) when declaring a member of class or struct, since D will treat it as a method(rather than a static function) and complain about the `this` reference. I think there was either or both a discussion and a bug report on this, but can't find either. Basically we need to clarify what it means to compare two function literals for equality. -- Andrei
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 17:23:24 UTC, Marc Schütz wrote: Not necessarily. The first assignment of a member in a constructor is already treated as special, so I guess we're halfway there. That's what I was thinking. *crosses fingers*
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 17:22:43 UTC, Andrei Alexandrescu wrote: I think there was either or both a discussion and a bug report on this, but can't find either. Basically we need to clarify what it means to compare two function literals for equality. -- Andrei I remember the thread where the consensus seemed to be that hashing was the way to go. I think it's just that nobody ever implemented it.
Re: System level language, GC, allocation and typeinfo
On Tuesday, 27 May 2014 at 13:06:10 UTC, Ola Fosheim Grøstad wrote: ...However, I cannot really come up with a single situation where I don't know what kind of allocator I have used when accessing a pointer Heap allocation in D is up to the user. Can you imagine something like http://sourceforge.net/projects/fastmm/ in D ? It's a (sorry for being an arsh) fuckin good memory manager...It's for user or RT allocations, it detects leaks, etc...It should be a source of inspiration for the top-notch D guys...
Re: Voldemort declarations inside structs with ctor initialization
On 5/27/14, 7:51 AM, Meta wrote: On Tuesday, 27 May 2014 at 17:22:43 UTC, Andrei Alexandrescu wrote: I think there was either or both a discussion and a bug report on this, but can't find either. Basically we need to clarify what it means to compare two function literals for equality. -- Andrei I remember the thread where the consensus seemed to be that hashing was the way to go. I think it's just that nobody ever implemented it. Hmmm, are you sure? What about alpha renaming? -- Andrei
Re: System level language, GC, allocation and typeinfo
On 5/27/14, 7:59 AM, MachMit wrote: On Tuesday, 27 May 2014 at 13:06:10 UTC, Ola Fosheim Grøstad wrote: ...However, I cannot really come up with a single situation where I don't know what kind of allocator I have used when accessing a pointer Heap allocation in D is up to the user. Can you imagine something like http://sourceforge.net/projects/fastmm/ in D ? It's a (sorry for being an arsh) fuckin good memory manager...It's for user or RT allocations, it detects leaks, etc...It should be a source of inspiration for the top-notch D guys... Is there a white paper available for FastMM? Couldn't find any. -- Andrei
Re: Voldemort declarations inside structs with ctor initialization
On Tue, May 27, 2014 at 08:17:26AM -1000, Andrei Alexandrescu via Digitalmars-d wrote: On 5/27/14, 7:51 AM, Meta wrote: On Tuesday, 27 May 2014 at 17:22:43 UTC, Andrei Alexandrescu wrote: I think there was either or both a discussion and a bug report on this, but can't find either. Basically we need to clarify what it means to compare two function literals for equality. -- Andrei I remember the thread where the consensus seemed to be that hashing was the way to go. I think it's just that nobody ever implemented it. Hmmm, are you sure? What about alpha renaming? -- Andrei If we want to be technically correct, we would have to define function literal comparison as being true iff the two functions produce an identical computation. So: (x) = true would have to be equal to: (x) = solveFermatsLastTheorem() But unfortunately, this kind of equivalence is unsolvable in the general case (it requires solving the halting problem), and infeasible except for the most trivial cases (the compiler has to spend way too much time to compute equivalence). Hashing gives a crude first approximation that's both easy to implement, fast, works in the cases where this issue came up in the first place, and doesn't require solving unsolvable problems. Alpha-renaming is not hard to support if the compiler just assigns each declared identifier in the function literal to a numerical id. So a literal like: (xcoor,ycoor) = sqrt(xcoor*xcoor, ycoor*ycoor) and (x,y) = sqrt(x*x, y*y) would both get translated to: (id1, id2) = sqrt(id1*id1, id2*id2) and so they would compare as equal. This does require a little more effort on the part of the compiler, though -- you'd have to walk the AST of the function body. I wouldn't go any farther than this, because this quickly approaches the no-man's land of whether (x) = x+x+x should compare equal to (y) = y*3 (if floating-point is involved the two functions may *not* in fact be equivalent, for example), whether to compare equal if two different functions get optimized to the same assembly code (which may differ depending on compiler / compile flags), etc.. Honestly, I don't see the need even for alpha-renaming -- I can't imagine a use case where you'd want to do something like that. I think straight up hashing of the function body is Good Enough(tm). T -- Once bitten, twice cry...
Re: System level language, GC, allocation and typeinfo
On Tuesday, 27 May 2014 at 18:19:14 UTC, Andrei Alexandrescu wrote: On 5/27/14, 7:59 AM, MachMit wrote: On Tuesday, 27 May 2014 at 13:06:10 UTC, Ola Fosheim Grøstad wrote: ...However, I cannot really come up with a single situation where I don't know what kind of allocator I have used when accessing a pointer Heap allocation in D is up to the user. Can you imagine something like http://sourceforge.net/projects/fastmm/ in D ? It's a (sorry for being an arsh) fuckin good memory manager...It's for user or RT allocations, it detects leaks, etc...It should be a source of inspiration for the top-notch D guys... Is there a white paper available for FastMM? Couldn't find any. -- Andrei I Googled a little and found this, but nothing with larger scale: http://edn.embarcadero.com/article/33416#27ImplementationDetails -Wyatt
Re: System level language, GC, allocation and typeinfo
On Tuesday, 27 May 2014 at 18:19:14 UTC, Andrei Alexandrescu wrote: Is there a white paper available for FastMM? Couldn't find any. http://sourceforge.net/p/fastmm/code/HEAD/tree/FastMM4_Readme.txt
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 18:54:05 UTC, H. S. Teoh via Digitalmars-d wrote: Honestly, I don't see the need even for alpha-renaming -- I can't imagine a use case where you'd want to do something like that. I think straight up hashing of the function body is Good Enough(tm). T Hashing the function body is not enough - you must also consider the closure! template Template(alias func){ bool Template=func(); } void foo(){ int a; writeln(Template!(()=is(typeof(a) : char))); //prints false } void bar(){ char a; writeln(Template!(()=is(typeof(a) : char))); //prints true } If two delegates must have exactly the same scope, the usefulness of the hashing will be quite limited, but in many cases the same lambda can be declared in different scopes and still be the same. It all depends on how the lambda uses the closure - and checking this will be quite hard to implement...
Re: System level language, GC, allocation and typeinfo
On Tuesday, 27 May 2014 at 18:19:14 UTC, Andrei Alexandrescu wrote: On 5/27/14, 7:59 AM, MachMit wrote: On Tuesday, 27 May 2014 at 13:06:10 UTC, Ola Fosheim Grøstad wrote: ...However, I cannot really come up with a single situation where I don't know what kind of allocator I have used when accessing a pointer Heap allocation in D is up to the user. Can you imagine something like http://sourceforge.net/projects/fastmm/ in D ? It's a (sorry for being an arsh) fuckin good memory manager...It's for user or RT allocations, it detects leaks, etc...It should be a source of inspiration for the top-notch D guys... Is there a white paper available for FastMM? Couldn't find any. -- Andrei The source file is documented IIRC. It could be a source of inspiration for the allocators (There is something about that in D you've introduced a few monthes ago, I think...), or maybe a branch/sub-set, GC-free, version of D arrays and classes. But it was mainly written for the previous-decade delphi.(D7 to D2009), the point is it contains some optimized version of memcpy and memmove (inline asm partially comming from the fastcode project(http://fastcode.sourceforge.net/ for the x86 arch. at least...) But At this time the memory model was the same as D except that you (the programmer) were the GC...Otherwise the compilo was inserting some automatic cleanup code for locally allocated data(even when standing in the heap...)... However something like this would be better than some user call to malloc/realloc...(because it internally handles the hardware spec...i.e when copying: the page size, vector operations).
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 19:39:23 UTC, Idan Arye wrote: Hashing the function body is not enough - you must also consider the closure! template Template(alias func){ bool Template=func(); } void foo(){ int a; writeln(Template!(()=is(typeof(a) : char))); //prints false } void bar(){ char a; writeln(Template!(()=is(typeof(a) : char))); //prints true } If two delegates must have exactly the same scope, the usefulness of the hashing will be quite limited, but in many cases the same lambda can be declared in different scopes and still be the same. It all depends on how the lambda uses the closure - and checking this will be quite hard to implement... If I remember correctly, the main use-case of comparing lambda functions was for cases like this: auto rb1 = make!(RedBlackTree!(int, (a, b) = a b))([4, 2, 3, 1]); auto rb2 = make!(RedBlackTree!(int, (a, b) = a b))([4, 2, 3, 1]); assert(is(typeof(rb1) == typeof(rb2))); //FAIL assert(rb1 == rb2); //FAIL Note that this code passes if you define a top-level function less and pass it to make. Functions don't have function pointers, only delegates, so as a first step we could implement hashing for functions, which don't have to deal with all this context pointer business. Also, couldn't you achieve the same for delegates if you specify that only @pure @nogc delegates can be compared?
Re: auto-tester hardware donations
Brad Roberts via Digitalmars-d digitalmars-d@puremagic.com writes: On 5/25/14, 7:54 AM, monarch_dodra via Digitalmars-d wrote: On Saturday, 24 May 2014 at 17:58:08 UTC, Brad Roberts via Digitalmars-d wrote: As discussed a little at the conference, the auto-tester is almost always hardware bound. In other words, it's building flat out 24/7. More hardware == faster updates to build status. If anyone wants to provide hardware to help there's a number of ways to do so. Here's my order of preference: 1) you have a machine you host somewhere and can provide me remote access to. - this could be a bare metal host or a vm At this point, I'd MUCH rather have hardware that doesn't live in my house. I've got too many already. But I also don't want to turn down good equipment. So, please reach out to me privately if you'd like to help out: bra...@puremagic.com Thanks, Brad Would there be any way to be able to set-up and configure the machines on our end, and to register them into the auto-testers once they are ready to go? I'd be willing to run some autotesting in my house. Granting remote access, not so much :-) How hard would it be to turn the autotester client into such a pull system? Jerry
Re: auto-tester hardware donations
On 5/27/14, 1:41 PM, Jerry via Digitalmars-d wrote: Brad Roberts via Digitalmars-d digitalmars-d@puremagic.com writes: On 5/25/14, 7:54 AM, monarch_dodra via Digitalmars-d wrote: On Saturday, 24 May 2014 at 17:58:08 UTC, Brad Roberts via Digitalmars-d wrote: As discussed a little at the conference, the auto-tester is almost always hardware bound. In other words, it's building flat out 24/7. More hardware == faster updates to build status. If anyone wants to provide hardware to help there's a number of ways to do so. Here's my order of preference: 1) you have a machine you host somewhere and can provide me remote access to. - this could be a bare metal host or a vm At this point, I'd MUCH rather have hardware that doesn't live in my house. I've got too many already. But I also don't want to turn down good equipment. So, please reach out to me privately if you'd like to help out: bra...@puremagic.com Thanks, Brad Would there be any way to be able to set-up and configure the machines on our end, and to register them into the auto-testers once they are ready to go? I'd be willing to run some autotesting in my house. Granting remote access, not so much :-) How hard would it be to turn the autotester client into such a pull system? Jerry All of it's 'steady state' operations are pull, or rather driven from the client (pull tasks to perform, push results). It's maintenance and debugging that's interactive. That's the part I'm reluctant to loose.
Re: isUniformRNG
On 5/24/2014 5:19 PM, Joseph Rushton Wakeling via Digitalmars-d wrote: On 24/05/14 19:46, Nick Sabalausky via Digitalmars-d wrote: An initial PR for Hash_DRBG being struct-based and directly part of std.random I think that's up to you. I don't want to hold you back here, but equally, I feel that crypto functionality probably should be prototyped in an experimental module before being finalized in the standard library. Perhaps. In any case, I've tossed up a PR for it (it contains a few changes since the latest DAuth version of it). Further HashDRBG discussion should probably go there: https://github.com/D-Programming-Language/phobos/pull/2208 Destroy It's something that's too important to get right (and properly reviewed).
Re: Fixing More Warnings in DMD?
On Monday, 26 May 2014 at 20:58:22 UTC, Nordlöw wrote: I've recent fixed a few warnings in D here: https://github.com/D-Programming-Language/dmd/pull/3543 At the end of the thread I asked: Should I continue fixing GLUE, BACK and ROOT or focus on remaining warnings in DMD? but Walter has not responded so I'm asking it here once again. Comments anyone? Well, I gathered some of warnings I have come across while doing some code browsning. https://github.com/D-Programming-Language/dmd/pull/3598
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 20:02:34 UTC, Meta wrote: On Tuesday, 27 May 2014 at 19:39:23 UTC, Idan Arye wrote: Hashing the function body is not enough - you must also consider the closure! template Template(alias func){ bool Template=func(); } void foo(){ int a; writeln(Template!(()=is(typeof(a) : char))); //prints false } void bar(){ char a; writeln(Template!(()=is(typeof(a) : char))); //prints true } If two delegates must have exactly the same scope, the usefulness of the hashing will be quite limited, but in many cases the same lambda can be declared in different scopes and still be the same. It all depends on how the lambda uses the closure - and checking this will be quite hard to implement... If I remember correctly, the main use-case of comparing lambda functions was for cases like this: auto rb1 = make!(RedBlackTree!(int, (a, b) = a b))([4, 2, 3, 1]); auto rb2 = make!(RedBlackTree!(int, (a, b) = a b))([4, 2, 3, 1]); assert(is(typeof(rb1) == typeof(rb2))); //FAIL assert(rb1 == rb2); //FAIL Note that this code passes if you define a top-level function less and pass it to make. Functions don't have function pointers, only delegates, so as a first step we could implement hashing for functions, which don't have to deal with all this context pointer business. Also, couldn't you achieve the same for delegates if you specify that only @pure @nogc delegates can be compared? Well, it won't work for the example that opened this thread(converted to use lambdas). As for limiting the delegate version to ones that use @pure and @nogc, take another look at my example. The lambdas don't allocate anything so they're obviously @nogc. As for @pure, they doesn't have any side effects, and depend only on their arguments(they don't have arguments, and they are constant functions) and their scope(which happens to be mutable, but you could easily make it immutable and nothing will change).
Re: auto-tester hardware donations
On 5/24/2014 10:57 AM, Brad Roberts via Digitalmars-d wrote: At this point, I'd MUCH rather have hardware that doesn't live in my house. I've got too many already. That's why god made garages :-)
Re: Dev. Collaboration
I like the specs. idea. The forum is at http://d-language-and-libs.proboards.com
Re: Voldemort declarations inside structs with ctor initialization
On Tuesday, 27 May 2014 at 23:18:12 UTC, Idan Arye wrote: Well, it won't work for the example that opened this thread(converted to use lambdas). As for limiting the delegate version to ones that use @pure and @nogc, take another look at my example. The lambdas don't allocate anything so they're obviously @nogc. As for @pure, they doesn't have any side effects, and depend only on their arguments(they don't have arguments, and they are constant functions) and their scope(which happens to be mutable, but you could easily make it immutable and nothing will change). Delegates by default allocate a closure. If they're marked @nogc, they'd be unable to allocate that closure... I think. The pure annotation is to stop them from accessing global mutable state.
D Language Version 3
Hi, D2 has been out for a while. Looking to see what the roadmap is like towards D3? Suminda
Re: D Language Version 3
Suminda Dharmasena wrote in message news:dgufafcodplrxrqcg...@forum.dlang.org... Hi, D2 has been out for a while. Looking to see what the roadmap is like towards D3? Suminda No.
Re: radical ideas about GC and ARC : need to be time driven?
On Thursday, 15 May 2014 at 12:28:47 UTC, Marc Schütz wrote: But as long as there can be false pointers, no matter how improbable, there can be no guaranteed destruction, which was my point. Maybe it becomes acceptable at very low probabilities, but it's still a gamble... A couple of not freed resources should not cause the program run out of resources. With precise GC you can get memory leaks too, it's always a gamble, so GC may or may not save you, but it still can.
Re: Does D support plugins with dll written in D ?
http://wiki.dlang.org/Win32_DLLs_in_D - maybe, it's of some help
Re: Does D support plugins with dll written in D ?
Hello :) AFAIK, Higher-level library support is planned for next release (v2.066) [1]. Meanwhile, you'll have to rely on your own exported factory functions to create objects instead of Object.factory(). 1 : http://wiki.dlang.org/Agenda#high-level_shared_library_support
Re: Programming a Game in D? :D
On Saturday, 24 May 2014 at 08:54:53 UTC, ponce wrote: Hi David, Learning programming, learning D and learning 3D are 3 significant endeavours. You might want to begin with http://www.basic4gl.net/ which will get you going with 3D, quite a topic in itself. Then learn D regardless :) So, I'v used Blender for a half year or sth. and I think I can make a little area :) As far as I know, I do now need a graphic and physics engines, 1 of the graphic APIs and for sure my programming stuff and here I'm stuck :D And I still can't install Mono-D :( if I try I just get a whole bunch of errors that any packages couldn't be found, don't know if I'm doing sth. wrong (I probably do :P)