March 17, 2005
"Anders F Björklund" <afb@algonet.se> wrote in message news:d1c3n4$1164$1@digitaldaemon.com...
> Lionello Lunesu wrote:
>
>> So that's the reason D's front-end (../dmd/src) is in C++: because it's using the C compiler's back end and that one's in C/C++?
>
> If DMD was written in D, what would you use to bootstrap it with ?
>
> And you would have all the woes of the current compiler, like not being able to create shared libraries, missing debug info, plain old bugs, and other things that make D yet unreleased...
>
> No, I for one think it's a good thing that DMD front-end is in C++.
>
How about writing a small compiler in something like c that only covers a small part of the D and use that compiler to create the full version.

I know of a modula-2 compiler that is built this way.

Zz


March 17, 2005
Ilya Minkov wrote:

>> Especially when it would be more useful to update it to, for instance, work with GCC 4.0; instead of just doing a work-a-like but written in D?
> 
> Why should this be a problem? GCC backend, being written in C, can be
> talked to from any language one can compile, when a compatible C
> compiler exists. In fact, GNU Pascal frontend is written in Pascal, etc.

It's not really a problem, like you say, just thought it be more work?

Had the interface been in C++ instead, matters would be different...
But interfacing with regular C, that D can do without too much hassle.

> I think i recall Walter saying he wants to have D frontend written in D
> someday. However, it's definately not time yet now so i think we can
> pick up on this discussion when we are past the currently awaited
> milestones.

Agreed. I'm not trying to stop it at all, as long as GDC still works :-)

--anders
March 17, 2005
Nick Sabalausky wrote:
> "Anders F Björklund" <afb@algonet.se> wrote in message news:d1c3n4$1164$1@digitaldaemon.com...
> 
>>Lionello Lunesu wrote:
>>
>...
> 
> The first 'DMD written in D' would be compiled with the latest C/C++-written version. Subsequent versions would be compiled with the previous build.
> 
> Unless I misunderstand what you mean by 'bootstrap'...?
> 
> 
>>And you would have all the woes of the current compiler, like
>>not being able to create shared libraries, missing debug info,
>>plain old bugs, and other things that make D yet unreleased...
>>
>>No, I for one think it's a good thing that DMD front-end is in C++.
>>
>>--anders 
> 
> 
> 
That's essentially the approach that Algol took to distribution back in the 1960's.  It worked, too.  (Algol had a minimal subset compiler written in assembler.  The minimal subset was used to write a compiler for the full language.  The full language was used to create the libraries...)

Algol was the first time I heard about the bootstrap process.  It was quite successful yielding such descendants as Pascal and Ada, and, less completely, any language that uses block structured code.
March 18, 2005
"Martin M. Pedersen" <martin@moeller-pedersen.dk> wrote in message news:d1cpb7$1pg9$1@digitaldaemon.com...
> It has been a natural place to start, but a move to D would IMHO be a natural evolotion, and a good proof of concept. Walter may have his
reasons
> to keep the implementation in C++ for now. I can only guess on what they could be, but guesses would include:
>
>     - other issues are deemed to have higher priority.

Yup.

>     - the interface to his backend isn't trivial.

Right. There are a number of .h files, the back end is in C++, and it would be a fair chunk of work to interface it. I've got far too many other things to do right now.


March 20, 2005
In article <d1c9o0$1670$2@digitaldaemon.com>, =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= says...
>
>Stewart Gordon wrote:
>
>> The obvious way to bootstrap D on a new platform would be to keep hold of the C++-written DMD until a better solution is found.  FTM, what does a new platform's first C compiler tend to be written in?
>
>Usually bootstrapped using assembler. Or cross-compiled, if available.

I would say that a C cross compiler would be the first choice for a new CPU with a smattering of assembler.


1 2
Next ›   Last »