June 19, 2008
"Leandro Lucarella" <llucax@gmail.com> wrote in message news:20080619210932.GE17841@burns.springfield.home...

>
> I don't think I have to tell *you* this, but since D is link compatible with C, I don't think that's a real issue...

It's not the linking that's the trouble, it's the fact that you'd need a D compiler to compile this new D compiler.  And most platforms don't have one by default yet.

That's not to say that GDC couldn't be used to build said compiler.  It'd just complicate the build process.

I wonder what other not-so-prevalent languages have bootstrapped compilers, and what their installation procedures entail?  Would it be automatable enough to be able to, say, put it in a .deb/.rpm?


June 19, 2008
== Quote from Jarrett Billingsley (kb3ctd2@yahoo.com)'s article
> "Leandro Lucarella" <llucax@gmail.com> wrote in message news:20080619210932.GE17841@burns.springfield.home...
> >
> > I don't think I have to tell *you* this, but since D is link compatible with C, I don't think that's a real issue...
> It's not the linking that's the trouble, it's the fact that you'd need a D compiler to compile this new D compiler.  And most platforms don't have one by default yet.

If only we had a C-front D compiler...


Sean
June 19, 2008
"Sean Kelly" <sean@invisibleduck.org> wrote in message news:g3ejkj$67p$1@digitalmars.com...

>
> If only we had a C-front D compiler...
>

You mean TDC?  ;)

Course it's also based on DMDFE.


June 19, 2008
Jarrett Billingsley wrote:

> "Sean Kelly" <sean@invisibleduck.org> wrote in message news:g3ejkj$67p$1@digitalmars.com...
> 
>>
>> If only we had a C-front D compiler...
>>
> 
> You mean TDC?  ;)
> 
> Course it's also based on DMDFE.

LLVMDC can do this.

-- 
Lars Ivar Igesund
blog at http://larsivi.net
DSource, #d.tango & #D: larsivi
Dancing the Tango
June 19, 2008
Leandro Lucarella wrote:
> Walter Bright, el 19 de junio a las 12:08 me escribiste:
>> Many, many times, however, I wished it was in D just because it would make coding it easier.
> 
> I don't think I have to tell *you* this, but since D is link compatible
> with C, I don't think that's a real issue...

It is, for a couple reasons:

o  Some back ends (like mine) is in C++, not C.

o  If you're porting D to a platform that has no existing D compiler on it, you're in for some significant problems.
June 19, 2008
On Thu, 19 Jun 2008 14:52:45 -0700, Walter Bright wrote:

> Leandro Lucarella wrote:
>> Walter Bright, el 19 de junio a las 12:08 me escribiste:
>>> Many, many times, however, I wished it was in D just because it would make coding it easier.
>> 
>> I don't think I have to tell *you* this, but since D is link compatible with C, I don't think that's a real issue...
> 
> It is, for a couple reasons:
> 
> o  Some back ends (like mine) is in C++, not C.
> 
> o  If you're porting D to a platform that has no existing D compiler on it, you're in for some significant problems.

A D compiler option to emit C code?  (Or C++ code?)  It wouldn't need to be as efficient as D-to-executable in order to be portable.

(Yes, it would probably be a huge undertaking.  But it's an option for portability that would allow D to be written in D.  I believe this kind of bootstrapping was first used by Algol.)
June 19, 2008
Charles Hixson:
> A D compiler option to emit C code?  (Or C++ code?)  It wouldn't need to be as efficient as D-to-executable in order to be portable.
> 
> (Yes, it would probably be a huge undertaking.  But it's an option for portability that would allow D to be written in D.  I believe this kind of bootstrapping was first used by Algol.)

Written in Python maybe :-) High level languages may be acceptable to write first gen compilers. (ShedSkin is written in Python and it works well enough, so it's possible).

Bye,
bearophile
June 20, 2008
BCS wrote:
> Reply to Georg,
> 
>> We've had this discussion in the past, and Walter has said it's OK for
>> anybody to make changes to the FE, that's why it's open source.
>>
>> That means that you /already/ can put it on dsource and have people
>> send you patches. You can then automatically (say once a day or week)
>> have the thing compiled, regression test suite run, and have the
>> binary put on download.
>>
>> Once a particular patch has been used by enough people, it becomes
>> easier to suggest Walter incorporate it in Phobos.
> 
> one problem, to really make that work you need the backend Walter uses.

Do the Tango guys have such a backend??

Hmmm. It sounds like it would be in Walter's (and therefore all of us) interest to device a way for us to use the Alt-FE as a drop-in. That way Walter could avoid bureaucracy involved in screening, selecting and trying out all the submissions. He'd now simply be sent the patches that in actual reality have proved themselves worthy, by not crashing and by giving the community a positive experience.

Probably there'd be a few tens of users who regularly use the bleeding-edge-Phobos, and their experiences would then decide what gets suggested for the "real" Phobos. (This is not to say Walter is obliged to accept all of them, merely that he'd avoid most of the bureaucracy, most of the time.)
June 20, 2008
Charles Hixson wrote:
> A D compiler option to emit C code?  (Or C++ code?)  It wouldn't need to be as efficient as D-to-executable in order to be portable.

There's no reason this code would be any less efficient than the ASM the D compiler has to generate anyway. After all, the "C language" is actually not a language, it is more like a CPU independent symbolic assembly language. (At least in the K&R days it was.)

While technologically an interesting option, I'd think that in a political way this would be unwise. Not to mention the credibility of D.

> (Yes, it would probably be a huge undertaking.  But it's an option for portability that would allow D to be written in D.  I believe this kind of bootstrapping was first used by Algol.)

/Technologically/, that is, in programming practice, it would be a huge success. Such a compiler could then immediately be used in an immense variety of domains. And additionally, many companies would then hand-tweak the C code in subtle but important ways, to really achieve astounding performance and suitability for possibly quite exotic needs.

It could also give D access to both smaller and larger CPUs than today.
June 20, 2008
"Georg Wrede" <georg@nospam.org> wrote in message news:485AFE87.3050902@nospam.org...

> Do the Tango guys have such a backend??

No, they just have permission to redistribute the DMD binary.  Walter is the only one who has access to the backend.