Re: Voldemort Types on Reddit
On Saturday, 10 September 2016 at 20:39:39 UTC, Walter Bright wrote: https://www.reddit.com/r/programming/comments/523hm3/til_the_d_language_has_a_voldemort_type/ then what is a "Harry Potter" type ? or (abhor!!!) a "Piton" type ? (not Python, I do not want to risk my neck mentioning Python here, eh eh )
Re: Reducing the cost of autodecoding
On Thursday, 13 October 2016 at 01:26:17 UTC, Andrei Alexandrescu wrote: On 10/12/2016 08:11 PM, Stefan Koch wrote: We should probably introduce a new module for stuff like this. object.d is already filled with too much unrelated things. Yah, shouldn't go in object.d as it's fairly niche. On the other hand defining a new module for two functions seems excessive unless we have a good theme. On the third hand we may find an existing module that's topically close. Thoughts? -- Andrei There could be some kind of "expect" theme, or a microoptimization theme. Functions that have no observable effects and that provide hints for optimization (possibly compiler-dependent implementations of those functions). Besides providing the expected value of an expression, other "expect"/microopt functionality is checking explicitly for function pointer values (to inline a likely function), that I wrote about in [1]: ``` /// Calls `fptr(args)`, optimize for the case when fptr points to Likely(). pragma(inline, true) auto is_likely(alias Likely, Fptr, Args...)(Fptr fptr, Args args) { return (fptr == &Likely) ? Likely(args) : fptr(args); } // ... void function() fptr = get_function_ptr(); fptr.is_likely!likely_function(); ``` A similar function can be made for "expecting" a class type for virtual calls [1]. Other microopt thingies that come to mind are: - cache prefetching - function attributes for hot/cold functions cheers, Johan [1] https://johanengelen.github.io/ldc/2016/04/13/PGO-in-LDC-virtual-calls.html
Re: Reducing the cost of autodecoding
On 2016-10-13 03:26, Andrei Alexandrescu wrote: Yah, shouldn't go in object.d as it's fairly niche. On the other hand defining a new module for two functions seems excessive unless we have a good theme. On the third hand we may find an existing module that's topically close. Thoughts? -- Andrei I think it should be a new module. I think core.intrinsics, as Stefan suggested, sounds like a good idea. I don't think having a module with only two functions is a problem, assuming we expect more of these functions. We already have that case with core.attribute [1], which only have _one_ attribute defined. [1] https://github.com/dlang/druntime/blob/master/src/core/attribute.d#L54 -- /Jacob Carlborg
GitHub protected branches are now enabled
Hi all, As an experiment, we've enabled some new GitHub branch protection features for the Phobos, Tools and dlang.org repos: 1. The auto-tester and the documentation tester must be green before a PR can be merged. As PRs should be merged via the auto-tester's Auto Merge feature, and the doc tester finishes much quicker than the autotester, I don't expect this to affect procedure much. 2. Before a PR can be merged, it must now have one "approved" review. So, it's a good time to start using GitHub's new review features instead of "LGTM" comments :) 3. Enabling CI protection has the added bonus that pushing directly to the branch is disabled. This means you don't need to worry about accidentally pushing to the wrong git remote. 4. Admins can bypass these restrictions. If these are preventing you from getting things done, ping an admin. If things go well, we'll enable the checks for the Druntime and DMD repositories as well. Feedback is welcome!
Apparently there's some dlang action in spacemacs
https://github.com/syl20bnr/spacemacs/issues/7374 Anyone familiar with the editor? -- Andrei
Re: Apparently there's some dlang action in spacemacs
On Thursday, 13 October 2016 at 13:32:42 UTC, Andrei Alexandrescu wrote: https://github.com/syl20bnr/spacemacs/issues/7374 Anyone familiar with the editor? -- Andrei The author posted here before, e.g. http://forum.dlang.org/post/kmlorniwvjyivjyjn...@forum.dlang.org BTW, Russel has given me commit access to the d-mode package a few days ago, and I've been doing some hacking on it. Among other things I'm pleased to say that test coverage is up to 90% (from 30%) :) https://coveralls.io/github/Emacs-D-Mode-Maintainers/Emacs-D-Mode?branch=master
Re: Apparently there's some dlang action in spacemacs
On Thursday, 13 October 2016 at 13:32:42 UTC, Andrei Alexandrescu wrote: https://github.com/syl20bnr/spacemacs/issues/7374 Anyone familiar with the editor? It's basically a sophisticated "config file" for GNU Emacs that aims to provide a "modern text editor" experience out-of-the-box within Emacs (the vanilla Emacs looks pretty alien to a newcomer/come-by-er). As far as I can tell, the thing is pretty popular within Emacs community (my guess is ~10,000 users - based on the "number of downloads" jump after one of my packages was included into spacemacs). The project is also well-documented and well-maintained, communication with maintainers is always a pleasure.
Re: Reducing the cost of autodecoding
On Wednesday, 12 October 2016 at 20:24:54 UTC, safety0ff wrote: Code: http://pastebin.com/CFCpUftW Line 25 doesn't look trusted: reads past the end of an empty string.
[Semi OT] - "Garbage In, Garbage Out: Arguing about Undefined Behavior..."
Pretty cool talk by Chandler Carruth on undefined behavior. It reminds me of a bunch of conversations than happened on this mailing list. I bet Walter will like it :) https://www.youtube.com/watch?v=yG1OZ69H_-o
Re: Reducing the cost of autodecoding
On Thursday, 13 October 2016 at 14:51:50 UTC, Kagamin wrote: On Wednesday, 12 October 2016 at 20:24:54 UTC, safety0ff wrote: Code: http://pastebin.com/CFCpUftW Line 25 doesn't look trusted: reads past the end of an empty string. Length is checked in the loop that calls this function. In phobos length is only checked with an assertion,
Re: Any relation?
On Tuesday, 11 October 2016 at 18:13:53 UTC, Andrei Alexandrescu wrote: http://indianautosblog.com/2016/10/most-powerful-suzuki-swift-produces-350-hp-25 -- Andrei Alas, it seems that they're using Swift. :(
Why are homepage examples too complicated?
I assume the purpose for those demonstrations are to win the interest of the user as to how easy and clean D code can be. Then why; // Round floating point numbers import std.algorithm, std.conv, std.functional, std.math, std.regex, std.stdio; alias round = pipe!(to!real, std.math.round, to!string); static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`; void main() { // Replace anything that looks like a real // number with the rounded equivalent. stdin .byLine .map!(l => l.replaceAll!(c => c.hit.round) (reFloatingPoint)) .each!writeln; } How is a new visitor supposed to know "!" is for templates and not some complicated syntax?
Re: Why are homepage examples too complicated?
On Thursday, 13 October 2016 at 19:06:26 UTC, Karabuta wrote: I assume the purpose for those demonstrations are to win the interest of the user as to how easy and clean D code can be. Then why; // Round floating point numbers import std.algorithm, std.conv, std.functional, std.math, std.regex, std.stdio; alias round = pipe!(to!real, std.math.round, to!string); static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`; void main() { // Replace anything that looks like a real // number with the rounded equivalent. stdin .byLine .map!(l => l.replaceAll!(c => c.hit.round) (reFloatingPoint)) .each!writeln; } How is a new visitor supposed to know "!" is for templates and not some complicated syntax? How's a new user supposed to know <> is for templates when looking at a C++ example? They don't; it's just something that has to be learned, or they know it because other languages use a similar syntax. Rust uses ! for macro invocation, and I imagine that creeps into some of their examples (OTOH, anything that prints output). Templates are such an integral part of D that any non-trivial example can't get around not using them.
core.intrinsics
Hi, while working on a faster auto-decoding it became oblivous that branch-prediction primitives such as the llvm_expect or builtin_expect are quite useful and should be avilable in a cross-platform compatible way. I propose to add a new module to to druntime called core.intrinsics that would have functions like bool likely (bool expr); bool unlikely (bool expr); and maybe void prefetch(void* mem) Please share your thoughts and tell me what other intrincic functions could/should be added.
Re: core.intrinsics
On Thursday, 13 October 2016 at 19:35:08 UTC, Stefan Koch wrote: Please share your thoughts and tell me what other intrinsic functions could/should be added. I think the name should be different from "intrinsics", so that it can also contain functions like "likely-functionptr" / "likely-class" optimization functions (e.g. the is_likely template from the other thread). -Johan
Re: core.intrinsics
On Thursday, 13 October 2016 at 19:49:42 UTC, Johan Engelen wrote: On Thursday, 13 October 2016 at 19:35:08 UTC, Stefan Koch wrote: Please share your thoughts and tell me what other intrinsic functions could/should be added. I think the name should be different from "intrinsics", so that it can also contain functions like "likely-functionptr" / "likely-class" optimization functions (e.g. the is_likely template from the other thread). -Johan What name would you suggest then ? also do you happen to know where llvm_expect is implemented in ldc ? I cannot seem to find it.
Re: Why are homepage examples too complicated?
On Thursday, 13 October 2016 at 19:30:30 UTC, Meta wrote: On Thursday, 13 October 2016 at 19:06:26 UTC, Karabuta wrote: How's a new user supposed to know <> is for templates when looking at a C++ example? They don't; it's just something that has to be learned, ... Does that make it a standard for everyone to follow?
Please help me add the "bootcamp" keyword
Hello, I've added the "bootcamp" keyword to http://issues.dlang.org to indicate issues that are eligible by "n00bs", i.e. new members of the Foundation who are fixing some bugs while gaining fluency with the language and toolchain. A "bootcamp" bug should be simple but not too simple. The sweet spot is a bug that has a relatively small surface but of which fixing offers a good learning experience. Please join me with the tagging! Thanks, Andrei
Re: Please help me add the "bootcamp" keyword
On Thursday, 13 October 2016 at 20:06:27 UTC, Andrei Alexandrescu wrote: Hello, I've added the "bootcamp" keyword to http://issues.dlang.org to indicate issues that are eligible by "n00bs", i.e. new members of the Foundation who are fixing some bugs while gaining fluency with the language and toolchain. A "bootcamp" bug should be simple but not too simple. The sweet spot is a bug that has a relatively small surface but of which fixing offers a good learning experience. Please join me with the tagging! Thanks, Andrei Why not introduce a Difficulty indicator to accompany Importance? Bootcamp could be like the equivalent of a 2 out of 5.
Re: Please help me add the "bootcamp" keyword
jmh530 wrote: > On Thursday, 13 October 2016 at 20:06:27 UTC, Andrei Alexandrescu > wrote: >> Hello, I've added the "bootcamp" keyword to >> http://issues.dlang.org to indicate issues that are eligible by >> "n00bs", i.e. new members of the Foundation who are fixing some >> bugs while gaining fluency with the language and toolchain. >> >> A "bootcamp" bug should be simple but not too simple. The sweet >> spot is a bug that has a relatively small surface but of which >> fixing offers a good learning experience. >> >> Please join me with the tagging! >> >> >> Thanks, >> >> Andrei > > Why not introduce a Difficulty indicator to accompany Importance? > Bootcamp could be like the equivalent of a 2 out of 5. > Simple has its advantages.
Re: Why are homepage examples too complicated?
On Thursday, 13 October 2016 at 19:06:26 UTC, Karabuta wrote: I assume the purpose for those demonstrations are to win the interest of the user as to how easy and clean D code can be. Then why; // Round floating point numbers import std.algorithm, std.conv, std.functional, std.math, std.regex, std.stdio; alias round = pipe!(to!real, std.math.round, to!string); static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`; void main() { // Replace anything that looks like a real // number with the rounded equivalent. stdin .byLine .map!(l => l.replaceAll!(c => c.hit.round) (reFloatingPoint)) .each!writeln; } How is a new visitor supposed to know "!" is for templates and not some complicated syntax? You are definitely taking the problem in reverse here IMHO. The goal of such example isn't to get the user to get every little bit about it like “What does ! mean?”. It is impossible to explain each detail of the syntax in such a short format and that would only confuse the user to force everything in it anyway. The goal of such example is for users to feel the general syntax when applied to an example expressive enough that they can follow it and infer for themselves the general meaning of the syntax. The goal is to have them think “Oh, that looks like a sequence of instructions on stdin.. byLine obviously mean that we read it by line, the map part isn't that easy to follow ok, but the last part each!writeln looks like we're writing each of a thing to a line... ok, so the actual replacement must happen in the map, yeah I see it, and there is the round part too so map must be some iterator thingy... Ok, I mostly get it.” because if they do then it's where they get the confidence that they can red the language, that it feels "obvious" enough for them to use. That's what builds the idea of an intuitive language. Explaining how the code does what it does is definitely not the point here, knowing that ! is used for templates brings nothing. It could be used for any kind of other data structure the fact that “each!writeln” is understood as “write each line” is what really counts. Maybe the example is poorly choosen and doesn't get new users to that point, but my experience showing it to friends is that it's definitely not that bad.
Re: Please help me add the "bootcamp" keyword
On Thursday, October 13, 2016 20:43:42 Andrei Alexandrescu via Digitalmars-d wrote: > jmh530 wrote: > > Why not introduce a Difficulty indicator to accompany Importance? > > Bootcamp could be like the equivalent of a 2 out of 5. > > Simple has its advantages. Also, rating bugs for difficulty can be pretty hard. It's not always obvious how difficult it's going to be and even determining whether it's on the easy end of the scale is hard without gradating it further. And I don't think that we really want to be taking the time to rate every bug anyway. There are plenty of other things to do that would be more useful. It's just that rating at least some bugs as good for beginners would be useful for helping folks get started. So, spending some time on this is valuable, but going to town on it would be counter-productive. - Jonathan M Davis
Re: Reducing the cost of autodecoding
On Thursday, 13 October 2016 at 01:36:44 UTC, Andrei Alexandrescu wrote: Oh ok, so it's that checksum in particular that got optimized. Bad benchmark! Bad! -- Andrei Also, I suspect a benchmark with a larger loop body might not benefit as significantly from branch hints as this one.
Re: core.intrinsics
On Thursday, 13 October 2016 at 19:52:57 UTC, Stefan Koch wrote: also do you happen to know where llvm_expect is implemented in ldc ? I cannot seem to find it. It's at the bottom of druntime/src/ldc/intrinsics.di (note the extension).
Re: core.intrinsics
On Thursday, 13 October 2016 at 19:52:57 UTC, Stefan Koch wrote: What name would you suggest then ? Yeah, that's the problem isn't it... :( Something with "optimize"? (I'm thinking the module would combine functions with no observable effects, and for which the default implementation does nothing.)
Re: Why are homepage examples too complicated?
On Thursday, 13 October 2016 at 19:06:26 UTC, Karabuta wrote: I assume the purpose for those demonstrations are to win the interest of the user as to how easy and clean D code can be. Then why; // Round floating point numbers import std.algorithm, std.conv, std.functional, std.math, std.regex, std.stdio; alias round = pipe!(to!real, std.math.round, to!string); static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`; void main() { // Replace anything that looks like a real // number with the rounded equivalent. stdin .byLine .map!(l => l.replaceAll!(c => c.hit.round) (reFloatingPoint)) .each!writeln; } How is a new visitor supposed to know "!" is for templates and not some complicated syntax? I agree, something friendly and familiar would be called for. Instead we have weird float-rounding programs. The goal of such program should be to push the reader to continue reading by apealing to familiarty. I think this strongly conveys the message that D is complicated and "not for me". See also: https://golang.org/ https://www.rust-lang.org/fr-FR/ https://crystal-lang.org/ https://www.ruby-lang.org/fr/ https://www.python.org/ Do you notice something? The language branded as "simple" have the simplest landing page programs.
Re: core.intrinsics
On Thursday, 13 October 2016 at 21:52:22 UTC, Johan Engelen wrote: On Thursday, 13 October 2016 at 19:52:57 UTC, Stefan Koch wrote: also do you happen to know where llvm_expect is implemented in ldc ? I cannot seem to find it. It's at the bottom of druntime/src/ldc/intrinsics.di (note the extension). I saw that one, but I cannot find the place where ldc checks for this template being instantiated. And then applies the intrinsic. Which is what I need to see in order to define a sensible way in dmd to use those intrinsics.
Re: core.intrinsics
On Thursday, 13 October 2016 at 19:52:57 UTC, Stefan Koch wrote: On Thursday, 13 October 2016 at 19:49:42 UTC, Johan Engelen wrote: On Thursday, 13 October 2016 at 19:35:08 UTC, Stefan Koch wrote: Please share your thoughts and tell me what other intrinsic functions could/should be added. I think the name should be different from "intrinsics", so that it can also contain functions like "likely-functionptr" / "likely-class" optimization functions (e.g. the is_likely template from the other thread). -Johan What name would you suggest then ? how about "fuzzylogic"?
Re: core.intrinsics
On Thursday, 13 October 2016 at 22:44:13 UTC, Dominikus Dittes Scherkl wrote: On Thursday, 13 October 2016 at 19:52:57 UTC, Stefan Koch wrote: On Thursday, 13 October 2016 at 19:49:42 UTC, Johan Engelen wrote: On Thursday, 13 October 2016 at 19:35:08 UTC, Stefan Koch wrote: Please share your thoughts and tell me what other intrinsic functions could/should be added. I think the name should be different from "intrinsics", so that it can also contain functions like "likely-functionptr" / "likely-class" optimization functions (e.g. the is_likely template from the other thread). -Johan What name would you suggest then ? how about "fuzzylogic"? It has nothing todo with fuzzy logic. AFAIK fuzzy-logic deals with optimizing boolean logic in order to by represented by smaller transistor networks. core.optimize suggests that there is some functionality that optimises things for you which is not the case. The only thing this should provide are compiler-specific low-level tools to affect code-gen. in as protable a manner as possible. I am especially intrested in being able to provide hints for code-layout. That does not only affect basic block-placement but also the which functions will be placed next to each other if possble. If anyone has good suggestions as to how such facilites may be named I am all ears.
Re: core.intrinsics
On 10/13/16 12:52 PM, Stefan Koch wrote: On Thursday, 13 October 2016 at 19:49:42 UTC, Johan Engelen wrote: On Thursday, 13 October 2016 at 19:35:08 UTC, Stefan Koch wrote: Please share your thoughts and tell me what other intrinsic functions could/should be added. I think the name should be different from "intrinsics", so that it can also contain functions like "likely-functionptr" / "likely-class" optimization functions (e.g. the is_likely template from the other thread). -Johan What name would you suggest then ? As an ignorant bystander I like core.intrinsics, but if not then perhaps core.compilerhints or something to that effect?
Buy Registered IELTS,TOEFL,ESOL CERTIFICATES Passport,Drivers license,ID Cards,Visas and others
Buy the certificate passport registered IELTS, TOEFL, ESOL, drivers licenses, ID cards, visas and other Skype id ... koffihassan We offer our exclusive customers the ability to get the IELTS, TOEFL, ESOL AUTODESK certificates without examinations. The regions we cover are Asia, United Arab Emirates, Qatar, Oman, Saudi Arabia, Jordan, etc. (((Koffi89stamps (at) gmail dot com))) we offer our exclusive clients the opportunity to obtain the TOEFL, GMAT, GRE, TOEIC, IELTS, ESOL AUTODESK certificates without examinations. The regions we coverare Asia, United Arab Emirates, Qatar, Oman, Saudi Arabia, Jordan, Kuwait, Australia, Canada and Europe. We work with "inside men" formal review working in various database units that are in charge and can ensure that you are entering your information in the same database (British council the IELTS) without any problems. The certificates we issue are legit and issued by the institution or the respective State concerned. We only faster and smarter !!! Our IELTS certificates are original and certified by the British Council. We do not make false certificates! Skype id ... koffihassan
Re: core.intrinsics
On 10/13/2016 06:55 PM, Stefan Koch wrote: If anyone has good suggestions as to how such facilites may be named I am all ears. The best way is to find 2-3 planned artifacts that have a common theme. Then a name comes up naturally. -- Andrei
Old bugs
I'm going through bugzilla in increasing ID order looking for tasks to bootcamp, and am finding a bunch of old bugs that haven't been looked at in a long time. It would be really great to get rid of some of these old issues and generally put some order in our bugzilla. If some are just enhancements that given the current direction of D will never happen (as is the case with the proposed syntax "static else if" as an alternative/replacement for "else static if") please let me know and I'll look into closing them. We've been liberal about putting things in bugzilla. Well, at some time we also need to look at them - it's not a write-only database like in that joke :o). For example, https://issues.dlang.org/show_bug.cgi?id=1448 should be addressable. Either we should provide a translation function for outputting things and recommend it, or document that codepages that D runs on Windows etc - there's got to be a solution. It's not an NP-complete problem. Can somebody fluent in Windows codepages take a look? Thanks, Andrei
So what's the deal with DFLAGS?
Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? -- Andrei
Re: Old bugs
For example, https://issues.dlang.org/show_bug.cgi?id=1448 should be addressable. Either we should provide a translation function for outputting things and recommend it, or document that codepages that D runs on Windows etc - there's got to be a What is IMHO needed to fix this bug, is to add to stdio an automatic translation to console codepage (when reading/writing from/to console window). Actual translation functions are in Phobos already (std.windows.charset).
Re: So what's the deal with DFLAGS?
On Friday, 14 October 2016 at 00:47:34 UTC, Andrei Alexandrescu wrote: Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? -- Andrei Srsly, the bug is over 8 years old, any only one person complained. It's not even a bug but a feature request. Close it as won't fix and move on.
Re: So what's the deal with DFLAGS?
On 14/10/2016 3:20 PM, Lurker wrote: On Friday, 14 October 2016 at 00:47:34 UTC, Andrei Alexandrescu wrote: Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? -- Andrei Srsly, the bug is over 8 years old, any only one person complained. It's not even a bug but a feature request. Close it as won't fix and move on. dub respects it so it would break that now.
Re: So what's the deal with DFLAGS?
On 10/13/16 10:29 PM, rikki cattermole wrote: On 14/10/2016 3:20 PM, Lurker wrote: On Friday, 14 October 2016 at 00:47:34 UTC, Andrei Alexandrescu wrote: Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? -- Andrei Srsly, the bug is over 8 years old, any only one person complained. It's not even a bug but a feature request. Close it as won't fix and move on. dub respects it so it would break that now. How? Does it translate DFLAGS into command line parameters for the compiler? -- Andrei
Re: So what's the deal with DFLAGS?
On 14/10/2016 3:41 PM, Andrei Alexandrescu wrote: On 10/13/16 10:29 PM, rikki cattermole wrote: On 14/10/2016 3:20 PM, Lurker wrote: On Friday, 14 October 2016 at 00:47:34 UTC, Andrei Alexandrescu wrote: Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? -- Andrei Srsly, the bug is over 8 years old, any only one person complained. It's not even a bug but a feature request. Close it as won't fix and move on. dub respects it so it would break that now. How? Does it translate DFLAGS into command line parameters for the compiler? -- Andrei Indeed[0]. [0] https://github.com/dlang/dub/blob/7662bce843531c32d7dae853afc5214b993aa6f2/source/dub/package_.d#L390
Re: So what's the deal with DFLAGS?
On 10/13/2016 5:47 PM, Andrei Alexandrescu wrote: Should we do something about https://issues.dlang.org/show_bug.cgi?id=1660? Resolved.
Re: Can you shrink it further?
On Wednesday, 12 October 2016 at 17:59:51 UTC, Andrei Alexandrescu wrote: On 10/12/2016 01:05 PM, safety0ff wrote: On Wednesday, 12 October 2016 at 16:48:36 UTC, safety0ff wrote: [Snip] Didn't see the LUT implementation, nvm! Yah, that's pretty clever. Better yet, I suspect we can reuse the look-up table for front() as well. -- Andrei The first results from stoke are in. It turns out stoke likes to produce garbage :( It's smallest result so far has around 100 instructions. However it might get better if I give it a few more hours to explore.