digitalmars.D - Thoughts on Herb Sutter's Metaclasses?
- Chris Katko (17/17) Apr 09 2018 https://www.youtube.com/watch?v=6nsyX37nsRs
- Chris Katko (11/11) Apr 09 2018 One more note: It seems like this would be heaven for trying out
- Joakim (4/15) Apr 09 2018 See previous forum thread on the topic, with Walter chiming in a
- Chris Katko (4/9) Apr 10 2018 Wow, that thread had very little discussion, and a huge amount of
- 12345swordy (2/13) Apr 10 2018 ...I'm sorry?
- jmh530 (3/6) Apr 10 2018 My take-away was that it can be done in D, but would be simpler
https://www.youtube.com/watch?v=6nsyX37nsRs I'm really happy with the way languages are finally progressing. I've said for years that we should be able to program the "rules" (e.g. code guidelines) that programmers then abide by, so that they are statically checked. DScanner is an example. But the core flaw is... it's "rules of thumb". That's great. But what about "rules for MY projects" or "rules for THIS SPECIFIC CODE TEAM." I love D's templates. I'm doing stuff I never thought possible like accidentally re-inventing Pass-by-Name / "Named Parameters" completely at compile-time / zero run-time overhead. https://en.wikipedia.org/wiki/Named_parameter Anyhow, I wonder what the D community thinks about this kind of meta-programming, and how much D already can do without metaclasses, and whether D could possibly benefit from implementing them. Thanks.
Apr 09 2018
One more note: It seems like this would be heaven for trying out new language features without having to "manually" add them into the compiler first. By hijacking the syntax to AST stage, we can add new constructs with real-functioning code, and have others evaluate themselves and unit test them without having to "imagine" whether the code would actually work. It'd be on a real binary, using a real (unmodified!) compiler. And you can also have your own "in-house" specializations. Which is no different than expecting people to use your API. Some API's have method chaining, and you use it. Some have pass-by-name, and you use it.
Apr 09 2018
On Tuesday, 10 April 2018 at 01:21:07 UTC, Chris Katko wrote:One more note: It seems like this would be heaven for trying out new language features without having to "manually" add them into the compiler first. By hijacking the syntax to AST stage, we can add new constructs with real-functioning code, and have others evaluate themselves and unit test them without having to "imagine" whether the code would actually work. It'd be on a real binary, using a real (unmodified!) compiler. And you can also have your own "in-house" specializations. Which is no different than expecting people to use your API. Some API's have method chaining, and you use it. Some have pass-by-name, and you use it.See previous forum thread on the topic, with Walter chiming in a bit too: https://forum.dlang.org/thread/kglnxqbcugerhynngewp forum.dlang.org
Apr 09 2018
On Tuesday, 10 April 2018 at 05:55:06 UTC, Joakim wrote:On Tuesday, 10 April 2018 at 01:21:07 UTC, Chris Katko wrote:Wow, that thread had very little discussion, and a huge amount of bickering over whether someone actually understood what someone else might have said.[...]See previous forum thread on the topic, with Walter chiming in a bit too: https://forum.dlang.org/thread/kglnxqbcugerhynngewp forum.dlang.org
Apr 10 2018
On Tuesday, 10 April 2018 at 09:32:49 UTC, Chris Katko wrote:On Tuesday, 10 April 2018 at 05:55:06 UTC, Joakim wrote:...I'm sorry?On Tuesday, 10 April 2018 at 01:21:07 UTC, Chris Katko wrote:Wow, that thread had very little discussion, and a huge amount of bickering over whether someone actually understood what someone else might have said.[...]See previous forum thread on the topic, with Walter chiming in a bit too: https://forum.dlang.org/thread/kglnxqbcugerhynngewp forum.dlang.org
Apr 10 2018
On Tuesday, 10 April 2018 at 09:32:49 UTC, Chris Katko wrote:Wow, that thread had very little discussion, and a huge amount of bickering over whether someone actually understood what someone else might have said.My take-away was that it can be done in D, but would be simpler with AST macros and Walter is against AST macros.
Apr 10 2018