Jump to page: 1 2
Thread overview
Now that the dmd backend is in D...?
Aug 01, 2019
Jonathan Marler
Aug 01, 2019
Walter Bright
Aug 01, 2019
Jonathan Marler
Aug 01, 2019
Jonathan Marler
Aug 01, 2019
Dennis
Aug 01, 2019
Walter Bright
Aug 01, 2019
Seb
Aug 01, 2019
Seb
Aug 01, 2019
Walter Bright
Aug 01, 2019
Walter Bright
Aug 01, 2019
Exil
Aug 01, 2019
Walter Bright
Aug 02, 2019
Exil
August 01, 2019
Now that the dmd backend is in D, are there plans to remove the old C++ organization?

Today, the backend is split into backend headers and backend sources, much like a C/C++ project.  The backend sources are compiled separately from DMD into a library, and the backend headers are compiled with DMD in order to link to the precompiled backend library.

You can see which files belong to which by looking at the posix.mak file:

BACK_HDRS=$C/cc.d $C/cdef.d $C/cgcv.d $C/code.d $C/cv4.d $C/dt.d $C/el.d $C/global.d \
	$C/obj.d $C/oper.d $C/outbuf.d $C/rtlsym.d $C/code_x86.d $C/iasm.d $C/codebuilder.d \
	$C/ty.d $C/type.d $C/exh.d $C/mach.d $C/mscoff.d $C/dwarf.d $C/dwarf2.d $C/xmm.d \
	$C/dlist.d $C/melf.d $C/varstats.di $C/dt.d

BACK_DOBJS = bcomplex.o evalu8.o divcoeff.o dvec.o go.o gsroa.o glocal.o gdag.o gother.o gflow.o \
	out.o \
	gloop.o compress.o cgelem.o cgcs.o ee.o cod4.o cod5.o nteh.o blockopt.o mem.o cg.o cgreg.o \
	dtype.o debugprint.o fp.o symbol.o elem.o dcode.o cgsched.o cg87.o cgxmm.o cgcod.o cod1.o cod2.o \
	cod3.o cv8.o dcgcv.o pdata.o util2.o var.o md5.o backconfig.o ph2.o drtlsym.o dwarfeh.o ptrntab.o \
	aarray.o dvarstats.o dwarfdbginf.o elfobj.o cgen.o os.o goh.o barray.o cgcse.o elpicpie.o


However, now that it's all in D, is there a plan to remove the backend headers?  Then once that is done, would we remove all the extern (C++) modifiers?  I realize that the extern (C++) modifiers cannot be removed until the backend headers are removed because making everything extern (D) would cause the module name to be used in the mangled symbol so the headers and sources would no longer match.

So is there any reason to keep the separate headers/sources in the DMD backend?

August 01, 2019
On 7/31/2019 8:03 PM, Jonathan Marler wrote:
> Now that the dmd backend is in D, are there plans to remove the old C++ organization?

No. It's still used to compile the DMC++ compiler. Trying to reshuffle all that around will cause me major problems.
August 01, 2019
On Thursday, 1 August 2019 at 08:59:28 UTC, Walter Bright wrote:
> On 7/31/2019 8:03 PM, Jonathan Marler wrote:
>> Now that the dmd backend is in D, are there plans to remove the old C++ organization?
>
> No. It's still used to compile the DMC++ compiler. Trying to reshuffle all that around will cause me major problems.

I see...that would make it pretty hard to link it with the DMC++ compiler :)
August 01, 2019
On Thursday, 1 August 2019 at 08:59:28 UTC, Walter Bright wrote:
> On 7/31/2019 8:03 PM, Jonathan Marler wrote:
>> Now that the dmd backend is in D, are there plans to remove the old C++ organization?
>
> No. It's still used to compile the DMC++ compiler. Trying to reshuffle all that around will cause me major problems.

Obviously we need a way to ensure that all changes to the backend don't cause any problems for DMC++.

Would you be interested in the community setting up a repo with both dmd and dmc, so each change to the backend (whether it is a bug fix, enhancement or refactoring) is tested against both dmd and dmc - they both need to compile and have their respective test suites pass.

If you're interested, we can brainstorm different possibilities:

* Move dmc repo to dmd/src/dmc, move dmc's tests to dmd/tests/dmc
* Include dmd as a git submodule in the dmc repo - a PR that affects the backend will need to be first merged in dmc and then dmd
* etc...
August 01, 2019
On Thursday, 1 August 2019 at 10:20:33 UTC, Petar Kirov [ZombineDev] wrote:
> On Thursday, 1 August 2019 at 08:59:28 UTC, Walter Bright wrote:
>> [...]
>
> Obviously we need a way to ensure that all changes to the backend don't cause any problems for DMC++.
>
> Would you be interested in the community setting up a repo with both dmd and dmc, so each change to the backend (whether it is a bug fix, enhancement or refactoring) is tested against both dmd and dmc - they both need to compile and have their respective test suites pass.
>
> If you're interested, we can brainstorm different possibilities:
>
> * Move dmc repo to dmd/src/dmc, move dmc's tests to dmd/tests/dmc
> * Include dmd as a git submodule in the dmc repo - a PR that affects the backend will need to be first merged in dmc and then dmd
> * etc...

I think DMC++ is closed source.
August 01, 2019
On Thursday, 1 August 2019 at 10:31:23 UTC, Jonathan Marler wrote:
> I think DMC++ is closed source.

It used to be.
https://github.com/DigitalMars/Compiler


August 01, 2019
On 8/1/2019 3:20 AM, Petar Kirov [ZombineDev] wrote:
> On Thursday, 1 August 2019 at 08:59:28 UTC, Walter Bright wrote:
>> On 7/31/2019 8:03 PM, Jonathan Marler wrote:
>>> Now that the dmd backend is in D, are there plans to remove the old C++ organization?
>>
>> No. It's still used to compile the DMC++ compiler. Trying to reshuffle all that around will cause me major problems.
> 
> Obviously we need a way to ensure that all changes to the backend don't cause any problems for DMC++.
> 
> Would you be interested in the community setting up a repo with both dmd and dmc, so each change to the backend (whether it is a bug fix, enhancement or refactoring) is tested against both dmd and dmc - they both need to compile and have their respective test suites pass.
> 
> If you're interested, we can brainstorm different possibilities:
> 
> * Move dmc repo to dmd/src/dmc, move dmc's tests to dmd/tests/dmc
> * Include dmd as a git submodule in the dmc repo - a PR that affects the backend will need to be first merged in dmc and then dmd
> * etc...

That is possible now that DMC++ is Boost licensed. It's currently at:

https://github.com/DigitalMars/Compiler

and is reasonably in sync with DMD. However, having endured multiple grand reshufflings of the DMD source code, and having recently headed off yet another one, I'm not much in favor of it.

If you look at the history of the back end, you'll see I've been incrementally updating it to be more modern and more tractable. I expect to continue with that.

What I'd like to see, however, is to get the backend covered by the code coverage thing in the D test suite. Currently, only the front end is.
August 01, 2019
On Thursday, 1 August 2019 at 20:24:12 UTC, Walter Bright wrote:
>
> What I'd like to see, however, is to get the backend covered by the code coverage thing in the D test suite. Currently, only the front end is.

This wouldn't be too hard: https://github.com/dlang/dmd/pull/10259
August 01, 2019
On Thursday, 1 August 2019 at 21:27:49 UTC, Seb wrote:
> On Thursday, 1 August 2019 at 20:24:12 UTC, Walter Bright wrote:
>>
>> What I'd like to see, however, is to get the backend covered by the code coverage thing in the D test suite. Currently, only the front end is.
>
> This wouldn't be too hard: https://github.com/dlang/dmd/pull/10259

Now available on CodeCov: https://codecov.io/gh/dlang/dmd/tree/master/src/dmd/backend
August 01, 2019
On 8/1/2019 3:49 PM, Seb wrote:
> On Thursday, 1 August 2019 at 21:27:49 UTC, Seb wrote:
>> On Thursday, 1 August 2019 at 20:24:12 UTC, Walter Bright wrote:
>>>
>>> What I'd like to see, however, is to get the backend covered by the code coverage thing in the D test suite. Currently, only the front end is.
>>
>> This wouldn't be too hard: https://github.com/dlang/dmd/pull/10259
> 
> Now available on CodeCov: https://codecov.io/gh/dlang/dmd/tree/master/src/dmd/backend

Thanks much for the quick action!
« First   ‹ Prev
1 2