digitalmars.D.announce - D's Newfangled Name Mangling
- Mike Parker (10/10) Dec 20 2017 Many thanks to Rainer for his insightful new article for the D
- David Gileadi (3/15) Dec 20 2017 I really enjoyed this!
- =?UTF-8?Q?Ali_=c3=87ehreli?= (5/23) Dec 20 2017 Yeah, an excellent post. Strangely, I could find just one typo myself. :...
- Mike Parker (2/9) Dec 20 2017 Thanks, guys!
- Joakim (4/17) Dec 22 2017 Still making my way through this long post, but
- Johan Engelen (12/14) Dec 20 2017 Nice!
- Rainer Schuetze (7/22) Dec 21 2017 AFAICT that's for the Itanium C++ ABI only, the VC mangling always
- Andrej Mitrovic (23/29) Dec 21 2017 Wouldn't it be possible to append the hash of the struct's type
- ketmar (5/5) Dec 21 2017 Andrej Mitrovic wrote:
- Andrei Alexandrescu (6/18) Dec 22 2017 Hi folks, the discussion in the announce forum is most welcome but
- Joakim (8/26) Dec 22 2017 We mostly just post corrections and technical suggestions in
Many thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm. He talks about the old implementation and its limitations before going into the details of the new one. It's a topic I had never considered digging into before, even when the big Voldemort issue first popped up, but now I find it interesting. The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ Reddit https://www.reddit.com/r/programming/comments/7l1h36/ds_newfangled_name_mangling/
Dec 20 2017
On 12/20/17 6:57 AM, Mike Parker wrote:Many thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm. He talks about the old implementation and its limitations before going into the details of the new one. It's a topic I had never considered digging into before, even when the big Voldemort issue first popped up, but now I find it interesting. The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ Reddit https://www.reddit.com/r/programming/comments/7l1h36/ds_newfa gled_name_mangling/I really enjoyed this! Typo: "This is were I stepped in..." -> "..where.."
Dec 20 2017
On 12/20/2017 07:41 AM, David Gileadi wrote:On 12/20/17 6:57 AM, Mike Parker wrote:Yeah, an excellent post. Strangely, I could find just one typo myself. :) Its rather simple -> It's rather simple AliMany thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm. He talks about the old implementation and its limitations before going into the details of the new one. It's a topic I had never considered digging into before, even when the big Voldemort issue first popped up, but now I find it interesting. The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ Reddit https://www.reddit.com/r/programming/comments/7l1h36/ds_newfa gled_name_mangling/I really enjoyed this! Typo: "This is were I stepped in..." -> "..where.."
Dec 20 2017
On Wednesday, 20 December 2017 at 19:16:03 UTC, Ali Çehreli wrote:On 12/20/2017 07:41 AM, David Gileadi wrote:Thanks, guys!Typo: "This is were I stepped in..." -> "..where.."Yeah, an excellent post. Strangely, I could find just one typo myself. :) Its rather simple -> It's rather simple
Dec 20 2017
On Thursday, 21 December 2017 at 06:53:35 UTC, Mike Parker wrote:On Wednesday, 20 December 2017 at 19:16:03 UTC, Ali Çehreli wrote:Still making my way through this long post, but that make this information accessible faster -> that make accessing this information fasterOn 12/20/2017 07:41 AM, David Gileadi wrote:Thanks, guys!Typo: "This is were I stepped in..." -> "..where.."Yeah, an excellent post. Strangely, I could find just one typo myself. :) Its rather simple -> It's rather simple
Dec 22 2017
On Wednesday, 20 December 2017 at 13:57:20 UTC, Mike Parker wrote:Many thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm.Nice! "D and C++ avoid this problem by adding more information to the symbol name, i.e. they encode into a symbol name the scope in which the symbol is defined, the function argument types, and the return type. " I would change it to "... and the return type (D only)". C++ does not include the return type in the mangle for normal functions (it does for templates). An important difference, concerning the earlier remark about programs crashing when "fail to update and recompile all source files that use the new declarartion" -Johan
Dec 20 2017
On 20.12.2017 19:42, Johan Engelen wrote:On Wednesday, 20 December 2017 at 13:57:20 UTC, Mike Parker wrote:Thanks.Many thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm.Nice!"D and C++ avoid this problem by adding more information to the symbol name, i.e. they encode into a symbol name the scope in which the symbol is defined, the function argument types, and the return type. " I would change it to "... and the return type (D only)". C++ does not include the return type in the mangle for normal functions (it does for templates). An important difference, concerning the earlier remark about programs crashing when "fail to update and recompile all source files that use the new declarartion"AFAICT that's for the Itanium C++ ABI only, the VC mangling always encodes the return type, too. I also noticed that gcc doesn't encode the inferred type of an "auto" return type for templates (available with C++17; or was it in C++14 already?).
Dec 21 2017
On Wednesday, 20 December 2017 at 13:57:20 UTC, Mike Parker wrote:The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/it won’t catch every error; for example, structs, classes and other user defined types are mangled > by name only, so that a change to their definition will still pass unnoticed by the linker.Wouldn't it be possible to append the hash of the struct's type definition to make the changes to the struct's definition noticeable during linking? e.g.: ----- module test; struct S { int x; float y; } void foo ( S s ) { } ----- You might create a hash this way: hash = Fnv1a(mangle(Tint32), mangle(Tfloat32)); And then foo's name mangle changes from: _D4test3fooFS4test1SZv to: _D4test3fooFS4test1S<hash>Zv It may not be 100% fool-proof yet though, because we'd also have to hash a bunch of other things like align() attributes. Or is this is overkill?
Dec 21 2017
Andrej Mitrovic wrote: ah, 'cmon, we can hash the whole source file! let's move build system's work to linker! ;-) sorry, but this is really overkill. tracking changed files and rebuilding 'em on demand is something your build system should do.
Dec 21 2017
On 12/20/17 8:57 AM, Mike Parker wrote:Many thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm. He talks about the old implementation and its limitations before going into the details of the new one. It's a topic I had never considered digging into before, even when the big Voldemort issue first popped up, but now I find it interesting. The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ Reddit https://www.reddit.com/r/programming/comments/7l1h36/ds_newfa gled_name_mangling/Hi folks, the discussion in the announce forum is most welcome but statistically very few people read the forum. Please direct discussions to the reddit group, which enjoys a broader audience. Sadly right now the sparse reddit discussion makes the reception look worse than it actually was. -- Andrei
Dec 22 2017
On Friday, 22 December 2017 at 14:34:56 UTC, Andrei Alexandrescu wrote:On 12/20/17 8:57 AM, Mike Parker wrote:We mostly just post corrections and technical suggestions in here, which are more likely to be seen. Anyway, the post has already done well on proggit, made top 25 most-liked of the last week and top 10 dlang.org posts of the last year: https://www.reddit.com/r/programming/top/?sort=top&t=week https://www.reddit.com/domain/dlang.org/top/?sort=top&t=yearMany thanks to Rainer for his insightful new article for the D Blog outlining the new name mangling algorithm. He talks about the old implementation and its limitations before going into the details of the new one. It's a topic I had never considered digging into before, even when the big Voldemort issue first popped up, but now I find it interesting. The blog https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/ Reddit https://www.reddit.com/r/programming/comments/7l1h36/ds_newfangled_name_mangling/Hi folks, the discussion in the announce forum is most welcome but statistically very few people read the forum. Please direct discussions to the reddit group, which enjoys a broader audience. Sadly right now the sparse reddit discussion makes the reception look worse than it actually was. -- Andrei
Dec 22 2017