digitalmars.D.announce - std.variant Is Everything Cool About D
- Mike Parker (8/8) Mar 29 2018 Jared Hanson (a.k.a Meta and MetaLang around these parts) was
- Sam Potter (6/6) Mar 29 2018 Awesome.
- 12345swordy (3/11) Mar 29 2018 There are some quite criticisms being made in the comments
- Walter Bright (3/4) Mar 29 2018 The main criticism is a misunderstanding about std.variant's allocation
- Walter Bright (4/9) Mar 30 2018 Part of the problem is the documentation for std.variant is not clear ab...
- Nick Sabalausky (Abscissa) (4/6) Mar 29 2018 Some of them I actually agree with. Much as I love D, its
- bachmeier (6/8) Mar 29 2018 Hopefully there will be a time in the future where D stops
- Meta (5/13) Mar 29 2018 Unfortunately, this turned out to be the worst possible day for
- jmh530 (3/7) Mar 29 2018 It seems that any comment in a D article that refers to C++ will
- Mike Parker (15/23) Mar 29 2018 That's fine by me. Right now, this post is the fourth most-viewed
- Patrick Schluter (7/31) Mar 30 2018 You're right and the unreasonable position of the
- dangbinghoo (6/14) Mar 29 2018 I think we need a book about D's std Phobos, like `mastering STL`
- rjframe (5/10) Mar 30 2018 I'm not sure Phobos is complex enough to need a book just for the librar...
- Meta (7/15) Mar 30 2018 I've submitted it to Hacker News as well (looks like someone
- Meta (5/11) Mar 30 2018 And it seems they're still not biting. Looking at the front page,
- Pjotr Prins (1/1) Mar 31 2018 Great blog. Thanks.
- Meta (2/3) Apr 01 2018 Thank you, glad you liked it.
- helxi (4/12) Apr 03 2018 What is the difference between
- Meta (8/22) Apr 03 2018 Nullable is specifically specialized to this particular use-case
- Steven Schveighoffer (3/6) Apr 04 2018 Not with Algebraic.
- Meta (4/10) Apr 05 2018 Ah yes, you're right. Thanks Steven. This exact thing came up in
Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/
Mar 29 2018
Awesome. I just scanned the "learn" section of the dlang.org, and didn't immediately see a section titled "pattern matching" which includes the nice D code from this blog post (sorry if it's in there---but it isn't jumping out at me). Maybe worth including or emphasizing.
Mar 29 2018
On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/There are some quite criticisms being made in the comments section.
Mar 29 2018
On 3/29/2018 10:30 AM, 12345swordy wrote:There are some quite criticisms being made in the comments section.The main criticism is a misunderstanding about std.variant's allocation strategy. I have been trying to correct that.
Mar 29 2018
On 3/29/2018 12:32 PM, Walter Bright wrote:On 3/29/2018 10:30 AM, 12345swordy wrote:Part of the problem is the documentation for std.variant is not clear about when memory allocation happens. It also is not clear that "boxing" means "allocates space for the data on the GC heap and stores a pointer to it in the variant".There are some quite criticisms being made in the comments section.The main criticism is a misunderstanding about std.variant's allocation strategy. I have been trying to correct that.
Mar 30 2018
On 03/29/2018 01:30 PM, 12345swordy wrote:There are some quite criticisms being made in the comments section.Some of them I actually agree with. Much as I love D, its Variant/Arithmetic *is* a terribly inferior hack compared to various languages that have built-in sum types. (Like Nemerle).
Mar 29 2018
On Thursday, 29 March 2018 at 17:30:04 UTC, 12345swordy wrote:There are some quite criticisms being made in the comments section.Hopefully there will be a time in the future where D stops selling itself as a dialect of C++. Whether the criticisms are right or wrong, they show the difficulty of selling D to C++ developers, and worse, these discussions tell the world that D and C++ are two sides of the same coin.
Mar 29 2018
On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/Unfortunately, this turned out to be the worst possible day for me to try to actively monitor the thread and respond to questions. I'm surprised that people latched onto my little quip about C++ using the name variant for a tagged union.
Mar 29 2018
On Friday, 30 March 2018 at 00:37:27 UTC, Meta wrote:Unfortunately, this turned out to be the worst possible day for me to try to actively monitor the thread and respond to questions. I'm surprised that people latched onto my little quip about C++ using the name variant for a tagged union.It seems that any comment in a D article that refers to C++ will be construed in the worst possible way on reddit...
Mar 29 2018
On Friday, 30 March 2018 at 02:46:13 UTC, jmh530 wrote:On Friday, 30 March 2018 at 00:37:27 UTC, Meta wrote:That's fine by me. Right now, this post is the fourth most-viewed this year and it's not far off from number three. While I would love to please the reddit crowd to the extent that we see no negativity, I'm quite happy with the fact that our comment threads there are nowhere near as negative as they used to be. Posts that do generate this level of discussion have higher views. I can't dismiss reddit comments completely, but I don't put as much weight on them as I used to. A subreddit is somewhat comparable to a forum for a popular video game -- lots of vocal people who are actually a small minority of the player base. We can't measure the number of people who click the reddit link to the blog and come away from it with a positive impression. They aren't going to bother commenting on reddit.Unfortunately, this turned out to be the worst possible day for me to try to actively monitor the thread and respond to questions. I'm surprised that people latched onto my little quip about C++ using the name variant for a tagged union.It seems that any comment in a D article that refers to C++ will be construed in the worst possible way on reddit...
Mar 29 2018
On Friday, 30 March 2018 at 03:54:21 UTC, Mike Parker wrote:On Friday, 30 March 2018 at 02:46:13 UTC, jmh530 wrote:You're right and the unreasonable position of the SolidStateGraphics user is clear for everyone to see. There are some points he makes that could be discussed but by holding essentially the position "D is shit because it is not C++" his whole argumentation falls apart as Stockholm-syndrome induced rationalisation.On Friday, 30 March 2018 at 00:37:27 UTC, Meta wrote:That's fine by me. Right now, this post is the fourth most-viewed this year and it's not far off from number three. While I would love to please the reddit crowd to the extent that we see no negativity, I'm quite happy with the fact that our comment threads there are nowhere near as negative as they used to be. Posts that do generate this level of discussion have higher views. I can't dismiss reddit comments completely, but I don't put as much weight on them as I used to. A subreddit is somewhat comparable to a forum for a popular video game -- lots of vocal people who are actually a small minority of the player base. We can't measure the number of people who click the reddit link to the blog and come away from it with a positive impression. They aren't going to bother commenting on reddit.Unfortunately, this turned out to be the worst possible day for me to try to actively monitor the thread and respond to questions. I'm surprised that people latched onto my little quip about C++ using the name variant for a tagged union.It seems that any comment in a D article that refers to C++ will be construed in the worst possible way on reddit...
Mar 30 2018
On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/I think we need a book about D's std Phobos, like `mastering STL` or something like C++ world do, but of course, I didn't mean selling to C++ world, I mean newbie may need knowledge about the Phobos and the design and using the power of the library for real practice, not to compare with the C++ world.
Mar 29 2018
On Fri, 30 Mar 2018 00:55:20 +0000, dangbinghoo wrote:I think we need a book about D's std Phobos, like `mastering STL` or something like C++ world do, but of course, I didn't mean selling to C++ world, I mean newbie may need knowledge about the Phobos and the design and using the power of the library for real practice, not to compare with the C++ world.I'm not sure Phobos is complex enough to need a book just for the library. Anything that would go into it would either be a programming in D-in-general thing or would be a useful improvement to the documentation itself.
Mar 30 2018
On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/I've submitted it to Hacker News as well (looks like someone posted it yesterday, but it only got 1 vote and there was no discussion, so I figured that was grounds enough for resubmission). If you've got an account, please give me your meaningless internet points. https://hn.algolia.com/?query=std.variant%20is%20everything%20cool%20about%20d&sort=byDate&prefix&page=0&dateRange=custom&type=story&dateStart=1522368000&dateEnd=1522454400
Mar 30 2018
On Friday, 30 March 2018 at 13:44:50 UTC, Meta wrote:I've submitted it to Hacker News as well (looks like someone posted it yesterday, but it only got 1 vote and there was no discussion, so I figured that was grounds enough for resubmission). If you've got an account, please give me your meaningless internet points. https://hn.algolia.com/?query=std.variant%20is%20everything%20cool%20about%20d&sort=byDate&prefix&page=0&dateRange=custom&type=story&dateStart=1522368000&dateEnd=1522454400And it seems they're still not biting. Looking at the front page, I can't believe how few actual programming or startup-related submissions there are. https://imgur.com/a/hFlbs
Mar 30 2018
On Saturday, 31 March 2018 at 17:36:30 UTC, Pjotr Prins wrote:Great blog. Thanks.Thank you, glad you liked it.
Apr 01 2018
On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/What is the difference between https://dlang.org/phobos/std_typecons.html#Nullable and Algebraic!(T, typeof(null))?
Apr 03 2018
On Wednesday, 4 April 2018 at 03:09:22 UTC, helxi wrote:On Thursday, 29 March 2018 at 14:10:39 UTC, Mike Parker wrote:Nullable is specifically specialized to this particular use-case and only has to store a boolean in addition the wrapped data (and there is a template "overload" that allows you to specify a specific value for the `null` state, which removes even that boolean). Also, with Nullable your data is guaranteed to not be boxed, whereas it's a possibility with Variant/Algebraic if the types you're working with are large enough.Jared Hanson (a.k.a Meta and MetaLang around these parts) was inspired by an article titled "std::visit is everything wrong with modern C++" to contrast it with D's std.variant.visit. The result is this well-written post for the D Blog. The blog: https://dlang.org/blog/2018/03/29/std-variant-is-everything-cool-about-d/ Reddit: https://www.reddit.com/r/programming/comments/881hmi/stdvariant_is_everything_cool_about_d/What is the difference between https://dlang.org/phobos/std_typecons.html#Nullable and Algebraic!(T, typeof(null))?
Apr 03 2018
On 4/3/18 11:29 PM, Meta wrote:Also, with Nullable your data is guaranteed to not be boxed, whereas it's a possibility with Variant/Algebraic if the types you're working with are large enough.Not with Algebraic. -Steve
Apr 04 2018
On Wednesday, 4 April 2018 at 11:40:58 UTC, Steven Schveighoffer wrote:On 4/3/18 11:29 PM, Meta wrote:Ah yes, you're right. Thanks Steven. This exact thing came up in the Reddit thread from a few days ago.Also, with Nullable your data is guaranteed to not be boxed, whereas it's a possibility with Variant/Algebraic if the types you're working with are large enough.Not with Algebraic. -Steve
Apr 05 2018