Jump to page: 1 213  
Page
Thread overview
Add ImportC compiler to dmd
May 09, 2021
Walter Bright
May 09, 2021
Walter Bright
May 09, 2021
bachmeier
May 09, 2021
jmh530
May 09, 2021
Walter Bright
May 09, 2021
Adam D. Ruppe
May 10, 2021
bachmeier
May 10, 2021
12345swordy
May 10, 2021
Adam D. Ruppe
May 10, 2021
Adam D. Ruppe
May 09, 2021
Max Haughton
May 09, 2021
Max Haughton
May 10, 2021
Walter Bright
May 10, 2021
Max Haughton
May 10, 2021
Brian
May 10, 2021
Max Haughton
May 10, 2021
Walter Bright
May 10, 2021
Brian
May 10, 2021
Max Haughton
May 10, 2021
deadalnix
May 11, 2021
Walter Bright
May 09, 2021
Max Haughton
May 10, 2021
Walter Bright
May 10, 2021
Walter Bright
May 10, 2021
Adam D. Ruppe
May 10, 2021
Walter Bright
May 10, 2021
Patrick Schluter
May 10, 2021
Walter Bright
May 10, 2021
Patrick Schluter
May 10, 2021
Walter Bright
May 10, 2021
Patrick Schluter
May 10, 2021
Basile B.
May 10, 2021
Basile B.
May 11, 2021
Walter Bright
May 11, 2021
Imperatorn
May 10, 2021
Guillaume Piolat
May 10, 2021
Brian
May 10, 2021
Walter Bright
May 11, 2021
jmh530
May 11, 2021
Walter Bright
May 10, 2021
Imperatorn
May 10, 2021
James Lu
May 10, 2021
Gregor Mückl
May 10, 2021
Walter Bright
May 15, 2021
Markk
May 15, 2021
Walter Bright
May 15, 2021
Markk
May 15, 2021
Max Haughton
May 15, 2021
rikki cattermole
May 12, 2021
Iain Buclaw
May 13, 2021
Walter Bright
May 13, 2021
Iain Buclaw
May 14, 2021
Walter Bright
May 14, 2021
Max Haughton
May 14, 2021
Walter Bright
May 15, 2021
Dibyendu Majumdar
May 15, 2021
Walter Bright
May 15, 2021
Dibyendu Majumdar
May 16, 2021
Walter Bright
May 16, 2021
Chris Piker
May 16, 2021
Walter Bright
May 16, 2021
Dibyendu Majumdar
May 16, 2021
Walter Bright
May 16, 2021
Dibyendu Majumdar
May 14, 2021
Iain Buclaw
May 15, 2021
matheus
May 16, 2021
Walter Bright
May 10, 2021
Walter Bright
May 10, 2021
Walter Bright
May 10, 2021
Dibyendu Majumdar
May 11, 2021
Walter Bright
May 11, 2021
Dibyendu Majumdar
May 11, 2021
Mike Parker
May 11, 2021
Mike Parker
May 11, 2021
Dibyendu Majumdar
May 11, 2021
jmh530
May 11, 2021
Mike Parker
May 11, 2021
Walter Bright
May 11, 2021
jmh530
May 11, 2021
Walter Bright
May 11, 2021
IGotD-
May 11, 2021
Imperatorn
May 11, 2021
12345swordy
May 11, 2021
IGotD-
May 11, 2021
12345swordy
May 11, 2021
Walter Bright
May 12, 2021
xBuzz
May 12, 2021
Igor Shirkalin
May 12, 2021
IGotD-
May 13, 2021
Walter Bright
May 12, 2021
Dibyendu Majumdar
May 12, 2021
Andre Pany
May 12, 2021
Imperatorn
May 12, 2021
Jordan Wilson
May 14, 2021
Chris Piker
May 14, 2021
Chris Piker
May 15, 2021
Chris Piker
May 15, 2021
Zardoz
May 15, 2021
Walter Bright
May 13, 2021
Walter Bright
May 13, 2021
Imperatorn
May 12, 2021
zjh
May 12, 2021
Adam D. Ruppe
May 12, 2021
deadalnix
May 13, 2021
Walter Bright
May 13, 2021
Araq
May 13, 2021
Walter Bright
May 13, 2021
Walter Bright
May 14, 2021
Chris Piker
May 14, 2021
Adam D. Ruppe
May 14, 2021
Chris Piker
May 14, 2021
Adam D. Ruppe
May 20, 2021
Iain Buclaw
May 09, 2021
https://github.com/dlang/dmd/pull/12507

If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!
May 09, 2021
My original plan was to use DMC for this. But looking at the code to it dissuaded me. It would have been more work than just starting over again, particularly because only the lexer/parser were needed.

Many times people over the years have asked me to port DMC to Linux. Ironically, this actually does that!
May 09, 2021
On Sunday, 9 May 2021 at 20:57:06 UTC, Walter Bright wrote:
> https://github.com/dlang/dmd/pull/12507
>
> If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!

This will be incredible. I have a lot of use cases for it. In particular on Windows where linking to DLLs is not fun.
May 09, 2021
On Sunday, 9 May 2021 at 21:50:56 UTC, bachmeier wrote:
> On Sunday, 9 May 2021 at 20:57:06 UTC, Walter Bright wrote:
>> https://github.com/dlang/dmd/pull/12507
>>
>> If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!
>
> This will be incredible. I have a lot of use cases for it. In particular on Windows where linking to DLLs is not fun.

Can you explain this a bit better? I recall an issue with drepl on Windows was shared library support.

May 09, 2021
On 5/9/2021 2:50 PM, bachmeier wrote:
> This will be incredible. I have a lot of use cases for it. In particular on Windows where linking to DLLs is not fun.

It never occurred to me that this might be a solution to that problem (rather than adding a bunch of wacky extensions to D).

This kind of unexpected benefit is exactly why I'm doing this!
May 09, 2021
On Sunday, 9 May 2021 at 22:36:29 UTC, Walter Bright wrote:
> It never occurred to me that this might be a solution to that problem (rather than adding a bunch of wacky extensions to D).

This doesn't solve anything about dlls.

Meanwhile though gdc and ldc will be getting significantly improved support for these cases in a matter of months.
May 09, 2021
On Sunday, 9 May 2021 at 20:57:06 UTC, Walter Bright wrote:
> https://github.com/dlang/dmd/pull/12507
>
> If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!

Things which can be said in C but not understood in D (like _Atomic) should probably fail to compile or compile to some core.compat.atomic type.
May 09, 2021

On Sunday, 9 May 2021 at 20:57:06 UTC, Walter Bright wrote:

>

https://github.com/dlang/dmd/pull/12507

If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!

inline in the C standard (although given as an example C11 footnote 138) technically only has guaranteed implications other than actually inlining the function, is ignoring it valid?

May 09, 2021

On Sunday, 9 May 2021 at 20:57:06 UTC, Walter Bright wrote:

>

https://github.com/dlang/dmd/pull/12507

If you could add a C compiler to dmd with 3000 lines of code, so C code could be imported directly? I would!

struct forward;


struct forward {
  //impl
}

is very common in C, D doesn't allow such a concept, therefore using the D AST seems like it could be a problem.

May 10, 2021
On Sunday, 9 May 2021 at 22:41:23 UTC, Adam D. Ruppe wrote:
> On Sunday, 9 May 2021 at 22:36:29 UTC, Walter Bright wrote:
>> It never occurred to me that this might be a solution to that problem (rather than adding a bunch of wacky extensions to D).
>
> This doesn't solve anything about dlls.
>
> Meanwhile though gdc and ldc will be getting significantly improved support for these cases in a matter of months.

Time constrained, so short answer: it solves the problem by eliminating the need for them. If I can trivially compile C and D code together then no need to mess around with writing a DLL for an extension. It's a massive difference to give a few files of code to someone else and tell them to compile it with DMD vs telling them to figure out import libraries and language interop and put the DLL in the right directory and use mingw, blah blah blah. If I were giving you the code, none of that would be an obstacle, but the most technical thing some of them have ever done is install Python.
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11