April 29, 2022
On 4/29/2022 9:03 AM, Paul Backus wrote:
> I would hardly call ImportC's implementation "correct" and "complete" at this point, given the large number of outstanding bugs and the fact that it does not even support the preprocessor yet.

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

which has been there for 3 weeks, and I can't get anyone to approve it.


> This is exactly what people mean when they call features of D "incomplete" or "unfinished" or "half-assed": the happy path works, but important features are missing and the edge cases are riddled with bugs.

ImportC is only a few months old. Is it realistic to expect an entire language implementation to work perfectly that quickly?

As for bugs, here is the current list:

https://issues.dlang.org/buglist.cgi?quicksearch=importc&list_id=240477

The ones older than a week fall into these categories:

1. asking for extensions to match extensions in other compilers
2. the { } initializer syntax, which needs to be completely redone


> I'm sure ImportC will improve, given enough time--maybe 3-5 years?

Oh, it'll be a lot quicker than that.


> But outside of a tiny number of core developers such as yourself who work on D full-time, it is unrealistic to expect an open-source contributor to see a project of that scale through to completion. That's what I really mean by "basically impossible". Not that it literally cannot be done, but that the amount of time and effort required is prohibitive for the vast majority of contributors.

I'm not asking for help coding ImportC. I am asking for:

1. submit bug reports for problems (dave287091@gmail.com and duser@neet.fi have been prolific in submitting very well done bug reports)

2. approve the PRs I submit for it
April 29, 2022
On Friday, 29 April 2022 at 15:28:16 UTC, Walter Bright wrote:
> On 4/27/2022 8:59 AM, Satoshi wrote:
>> Also I don't know why they didn't take the inspiration from other modern languages.
>
> Other languages have taken inspiration from D, such as ranges and compile time expression evaluation.
>
>....

Sorry, Lisp, ML, CLU and Smalltalk did it first, D was surely not the first in this regard.

Plenty of SIGPLAN papers on the subject.

April 29, 2022
On Friday, 29 April 2022 at 16:55:25 UTC, Walter Bright wrote:
> ImportC is only a few months old.

Oh how the time flies. It is actually about a full year old.

https://forum.dlang.org/thread/s79ib1$1122$1@digitalmars.com

Announced on May 09, 2021. I assume you were working on it for a little while before that, so probably over a year, but still, definitely more than "a few months".



And what did I say at the time? That the preprocessor question needs attention (still no solution today) and, I quote: "There'd still the all the little details that need to be done and the inevitable flurry of bugs. I'd be surprised if this is legitimately usable by the end of the year."


April 29, 2022
On 4/29/2022 9:10 AM, Araq wrote:
> Thank you!

You're welcome!

BTW, the reasons for the execrable performance were pretty simple.

1. ZTC did everything in memory, cfront+MSC wrote intermediate files to/from disk multiple times.

2. cfront's output was C source code. Meaning that MSC had to preprocess, retokenize, and reparse it.

cfront also had an intractable problem where it did not support near/far pointer types, which rendered it nearly unusable for non-trivial 16 bit DOS programming.

Zortech brought a usable C++ compiler to DOS, and DOS was where all the action and the money was.
April 29, 2022
On 4/29/2022 9:15 AM, Araq wrote:
> For this comparison which underlying C compiler did cfront use? Zortech's?

Microsoft's.
April 29, 2022
On 4/29/2022 10:00 AM, Paulo Pinto wrote:
> On Friday, 29 April 2022 at 15:28:16 UTC, Walter Bright wrote:
>> On 4/27/2022 8:59 AM, Satoshi wrote:
>>> Also I don't know why they didn't take the inspiration from other modern languages.
>>
>> Other languages have taken inspiration from D, such as ranges and compile time expression evaluation.
>>
>> ....
> 
> Sorry, Lisp, ML, CLU and Smalltalk did it first, D was surely not the first in this regard.
> 
> Plenty of SIGPLAN papers on the subject.

Those were interpreters first and added native code generation later. D did is the other way around, and the native code generating compilers started doing it soon afterwards.

April 29, 2022
On 4/29/2022 10:20 AM, Adam D Ruppe wrote:
> On Friday, 29 April 2022 at 16:55:25 UTC, Walter Bright wrote:
>> ImportC is only a few months old.
> 
> Oh how the time flies. It is actually about a full year old.
> 
> https://forum.dlang.org/thread/s79ib1$1122$1@digitalmars.com
> 
> Announced on May 09, 2021. I assume you were working on it for a little while before that, so probably over a year, but still, definitely more than "a few months".

I thought I'd done that last August, not May.


> And what did I say at the time? That the preprocessor question needs attention (still no solution today)

There is a solution,

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


> and, I quote: "There'd still the all the little details that need to be done and the inevitable flurry of bugs. I'd be surprised if this is legitimately usable by the end of the year."

It's still got bugs, but it is usable, particularly if your code avoids C extensions.

April 29, 2022
On Friday, 29 April 2022 at 18:05:42 UTC, Walter Bright wrote:
> On 4/29/2022 10:00 AM, Paulo Pinto wrote:
>> On Friday, 29 April 2022 at 15:28:16 UTC, Walter Bright wrote:
>>> On 4/27/2022 8:59 AM, Satoshi wrote:
>>>> Also I don't know why they didn't take the inspiration from other modern languages.
>>>
>>> Other languages have taken inspiration from D, such as ranges and compile time expression evaluation.
>>>
>>> ....
>> 
>> Sorry, Lisp, ML, CLU and Smalltalk did it first, D was surely not the first in this regard.
>> 
>> Plenty of SIGPLAN papers on the subject.
>
> Those were interpreters first and added native code generation later. D did is the other way around, and the native code generating compilers started doing it soon afterwards.

Decades before D was even an idea.

Again, SIGPLAN.
April 29, 2022
On Friday, 29 April 2022 at 17:26:44 UTC, Walter Bright wrote:
> On 4/29/2022 9:15 AM, Araq wrote:
>> For this comparison which underlying C compiler did cfront use? Zortech's?
>
> Microsoft's.

IIRC ComeauC++ also transpilled to C and that one did support many C compilers including DMC.
April 29, 2022
On 4/29/2022 11:38 AM, Arjan wrote:
> IIRC ComeauC++ also transpilled to C and that one did support many C compilers including DMC.

True, but Comeau's compiler never really caught on.