Thread overview
[SAoC 2021] Solve Dependency Hell: Milestone 1, Week 1
Sep 24, 2021
Ahmet Sait
Sep 24, 2021
Ali Çehreli
Sep 25, 2021
Elronnd
September 24, 2021

Milestone Overview

Hi,
This week I've been mostly reading & learning about name mangling from the language spec, official blog and the DMD's source.

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). 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.

//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.

September 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

September 25, 2021
On Friday, 24 September 2021 at 22:21:38 UTC, Ali Çehreli wrote:
> 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. :)

Since it's not strictly a prefix either, perhaps 'affix' or even 'tag' would be better.