On Monday, 16 May 2022 at 10:41:01 UTC, zjh wrote:
> >importRust and importGo are coming in the next release.
importC++
is the most important!
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to max haughton | On Monday, 16 May 2022 at 03:59:30 UTC, max haughton wrote: > > Unless you have a magic wand or a time machine I don't see how this line of argument has any relevance to the practice of writing software that actually does anything other than making the machine get hot. > We're talking about the difference between D communicating with the 'outside' world (which as we *both* argue, is required), and D going 'all out' to bring the outside world in (which is not necessarily something I'm on board with). D had no problem interacting with C before ImportC. ImportC does not assist here. You can actually write C code in D anyway. ImportC does not assist here either. We are no longer talking about a lingua franca to communicate with the outside world. We're talking about ensuring that the tyrannny of C becomes a bigger part of our world. That's the promise of ImportC. > One thing I'd also like to note is that once the C has been turned into the D AST you actually can almost get it to emit D code that represents the C This I'd be on board with. 100%. |
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Saturday, 14 May 2022 at 21:05:09 UTC, Walter Bright wrote:
> As https://github.com/dlang/dmd/pull/14121 has been merged, the following #ImportC program can now be compiled and run:
>
> #include <stdio.h>
>
> void main()
> {
> printf("hello ImportC!\n");
> }
>
> It's been a longer and windy-er road than I'd anticipated, but isn't that the way all software projects work?
>
> Next up:
>
> 1. passing dmd command line arguments to the preprocessor
>
> 2. capturing the #define macro dump from the preprocessor, so it can be mined for macros that can be translated to D symbols (anticipating leveraging Atila's great dpp work on this)
I don't understand where this is going at all. At first, I thought that this was able being able to import c (as the name would suggest), which seems super useful, but now it seems to be evolving into a full blow C compiler and I have no idea why I would want that. I already have several on my machine, and they are extremely high quality.
|
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Monday, 16 May 2022 at 09:52:21 UTC, deadalnix wrote:
> On Saturday, 14 May 2022 at 21:05:09 UTC, Walter Bright wrote:
>> As https://github.com/dlang/dmd/pull/14121 has been merged, the following #ImportC program can now be compiled and run:
>>
>> #include <stdio.h>
>>
>> void main()
>> {
>> printf("hello ImportC!\n");
>> }
>>
>> It's been a longer and windy-er road than I'd anticipated, but isn't that the way all software projects work?
>>
>> Next up:
>>
>> 1. passing dmd command line arguments to the preprocessor
>>
>> 2. capturing the #define macro dump from the preprocessor, so it can be mined for macros that can be translated to D symbols (anticipating leveraging Atila's great dpp work on this)
>
> I don't understand where this is going at all. At first, I thought that this was able being able to import c (as the name would suggest), which seems super useful, but now it seems to be evolving into a full blow C compiler and I have no idea why I would want that. I already have several on my machine, and they are extremely high quality.
importRust and importGo are coming in the next release.
No need for multiple compilers anymore, all languages will exist in a single compiler, DMD.
|
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Monday, 16 May 2022 at 10:27:45 UTC, bauss wrote:
> importRust and importGo are coming in the next release.
>
That's it. Theirs are mines.
|
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to zjh | On Monday, 16 May 2022 at 10:41:01 UTC, zjh wrote: > >importRust and importGo are coming in the next release.
|
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to zjh | On Monday, 16 May 2022 at 10:42:35 UTC, zjh wrote: >On Monday, 16 May 2022 at 10:41:01 UTC, zjh wrote: >
|
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Monday, 16 May 2022 at 09:52:21 UTC, deadalnix wrote: >I don't understand where this is going at all. At first, I thought that this was able being able to import c (as the name would suggest), which seems super useful, but now it seems to be evolving into a full blow C compiler and I have no idea why I would want that. I already have several on my machine, and they are extremely high quality. Yes, but you need to be able to compile C in order to expand C-macros in D code. It isn't all that difficult (but tedious to implement). Possible implementation:
This way you get to mix C and D, but also prevent people from writing macros containing D code. As long as all C code can be expressed in the D AST you're good. |
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to zjh | On Monday, 16 May 2022 at 10:42:35 UTC, zjh wrote: >On Monday, 16 May 2022 at 10:41:01 UTC, zjh wrote: > >importRust and importGo are coming in the next release.
importC++ won't happen because that's just going to be D as D is often seen as a better C++ for whatever reason. There's no need to have importC++ for philosophical D reasons. |
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to bauss | On Monday, 16 May 2022 at 11:48:47 UTC, bauss wrote: >There's no need to have importC++ for philosophical D reasons. If we can make use of the ecology of |
May 16, 2022 Re: ImportC can now automatically run the preprocessor | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Saturday, 14 May 2022 at 21:05:09 UTC, Walter Bright wrote:
> As https://github.com/dlang/dmd/pull/14121 has been merged, the following #ImportC program can now be compiled and run:
>
> #include <stdio.h>
>
> void main()
> {
> printf("hello ImportC!\n");
> }
>
> [snip]
Sorry if this is a dumb question, but when you refer to something as a "ImportC" program, what precisely do you mean? It's a D program that requires importC features to work?
|