Bug 21524 – [internal] Remove extern(C++) from all dmd functions and data structures

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Other
Creation time
2021-01-04T09:18:08Z
Last change time
2024-12-13T19:13:47Z
Assigned to
No Owner
Creator
Iain Buclaw
Moved to GitHub: dmd#18013 →

Comments

Comment #0 by ibuclaw — 2021-01-04T09:18:08Z
DMD's internal API is unstable and very few people remember there are downstream C++ users of the compiler who rely on the headers being in sync. There have been arguments over the best way forward to ensure that all contributors relieve the burden on gdc and ldc maintainers when making changes to dmd. As a compromise, one proposal would be to remove all use of extern(C++) from the Compiler API. In its place would be a single module defining a stable interface for C++. No attempt is made here to give any idealised view of what such a stable interface should look like, but to give one style as an example: extern(C++) struct DMDType(T) { T impl; // pointer const(char)* toChars() { return impl.toChars(); } StorageClass storage_class() { return impl.storage_class; } BEtype* ctype() { return impl.ctype; } //... } Which will also come with helpers to deal with the initial wrapping of AST nodes from the D types to C++ types.
Comment #1 by robert.schadek — 2024-12-13T19:13:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18013 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB