digitalmars.D - [SAoC 2021] Solve Dependency Hell: Milestone 1, Week 1
- Ahmet Sait (31/31) Sep 24 2021 [Milestone
- =?UTF-8?Q?Ali_=c3=87ehreli?= (4/7) Sep 24 2021 suffix or prefix? "bar" seems to prefix at least some part of the
- Elronnd (3/10) Sep 25 2021 Since it's not strictly a prefix either, perhaps 'affix' or even
[Milestone Overview](https://gist.github.com/ahmetsait/10925a246b0d412a698e927658f3f363#milestone-overview) Hi, This week I've been mostly reading & learning about name mangling from the [language spec](https://dlang.org/spec/abi.html#name_mangling), [official blog](https://dlang.org/blog/2017/12/20/ds-newfangled-name-mangling/) and the [DMD's source](https://github.com/dlang/dmd/blob/master/src/dmd/dmangle.d). I've implemented parsing an additional command line switch `-mangle-suffix` to get my hands dirty with hacking on DMD codebase (see [my mangle-switch branch](https://github.com/ahmetsait/dmd/tree/mangle-suffix)). Admittedly, it wasn't exactly productive since I had summer school finals but I have a lot more time available in these upcoming weeks to compansate. Next week I plan to experiment with mangling code to see where can I get in implementing the `-mangle-suffix` semantics. ```d //app.d module app; int foo(int x) { return x * x; } ``` Above code currently produces a `_D3app3fooFiZi` symbol when compiled. The idea is to make it `_D3bar3app3fooFiZi` if `-mangle-suffix=app.d:bar` is passed. I'm checking out https://wiki.dlang.org/DMD_Source_Guide for now but it seems somewhat outdated, hopefully the community here can endure me bombarding them with questions about DMD codebase. Thanks.
Sep 24 2021
On 9/24/21 2:35 PM, Ahmet Sait wrote:Above code currently produces a `_D3app3fooFiZi` symbol when compiled. The idea is to make it `_D3bar3app3fooFiZi` if `-mangle-suffix=app.d:bar` is passed.suffix or prefix? "bar" seems to prefix at least some part of the existing name but it doesn't look like a suffix to me. :) Ali
Sep 24 2021
On Friday, 24 September 2021 at 22:21:38 UTC, Ali Çehreli wrote:On 9/24/21 2:35 PM, Ahmet Sait wrote:Since it's not strictly a prefix either, perhaps 'affix' or even 'tag' would be better.Above code currently produces a `_D3app3fooFiZi` symbol whencompiled.The idea is to make it `_D3bar3app3fooFiZi` if `-mangle-suffix=app.d:bar` is passed.suffix or prefix? "bar" seems to prefix at least some part of the existing name but it doesn't look like a suffix to me. :)
Sep 25 2021