News for hackers. Stuff that matters.
Re:D 2.069.0 released, compiler automatically ported from C+... by WalterBright on Wednesday November 04, 2015 @04:47AM (#10505484)
Daniel Murphy is the man behind getting the sources converted from C++ to D. He wrote a program called "magicport" to do the bulk of it, with some manual tweaking. The back end is still in C++, showing that you can mix D and C++ code :-)
Re:D 2.069.0 released, compiler automatically ported from C+... by lazyjones on Wednesday November 04, 2015 @06:18AM (#10505791)
How is the compiler bootstrapped now (i.e. compiled from source without a working D compiler)? Via the gcc D implementation?
Re:D 2.069.0 released, compiler automatically ported from C+... by pjmlp on Wednesday November 04, 2015 @07:02AM (#10505923)
If my information is still actual, the last C++ based implementations will be used for the time being for such purposes.
Re:D 2.069.0 released, compiler automatically ported from C+... by Zardoz84 on Wednesday November 04, 2015 @08:26AM (#10506261)
Using the previous version write on C++. Like all compilers of other languages did when change to be write on his own language. Or do you think that the first version of C compiler was write on C ?
Re:D 2.069.0 released, compiler automatically ported from C+... by pjmlp on Wednesday November 04, 2015 @09:57AM (#10506967)
Funny anecdote for compiler researchers.

Niklaus Wirth did write many of his compilers in the original language (kind of).

He would write down on paper the code, using the bootstrap version 0 code style, as it was supposed to be.

Then he would manually translate that code into Assembly.

So when the compiler for the basic language was working, he could use the same code again, without additional efforts and relying on third party languages.

Specially important back in the day where each computer system had its own systems programming language or dialect of an existing one.

Re:D 2.069.0 released, compiler automatically ported from C+... by WalterBright on Wednesday November 04, 2015 @11:07AM (#10507494)
Computer languages were a lot simpler in those days.
Re:D 2.069.0 released, compiler automatically ported from C+... by nickpsecurity on Wednesday November 04, 2015 @07:24PM (#10510780)
That's true. Yet, Wirth's model is worth considering today. In Lilith system, they co-designed a high-level assembler (P-code-like), the Modula-2 language, the compiler, and critical OS regions. Built whole system on that. Key choice, learned from P-code, was to make assembler, high-level language, and compiler all consistent and simple where possible. Allowed easy composition and conversion.

Work on LISP/Scheme, Julia, REBOL, and so on show that even complex constructs can be built with macros, etc on simple ones which can be done Wirth-style as in Lilith/Oberon, my style [1], or by hand like pjmlp said. Actually, the Scheme stuff went down to synthesizing hardware from interpreters written in Scheme and another person did that with a Oberon-based HDL. So, it can go much further. :)

[1] https://news.ycombinator.com/item?id=10182752

Re:D 2.069.0 released, compiler automatically ported from C+... by pjmlp on Wednesday November 04, 2015 @12:35PM (#10508142)
Are you sure? I remember reading something about PL/I. :)
Re:D 2.069.0 released, compiler automatically ported from C+... by nickpsecurity on Wednesday November 04, 2015 @07:27PM (#10510791)
Maybe PL/S, IBM's "secret weapon," (haha) would be better if we're talking C++ replacements. I did like how the language let you describe how exactly the compiler should handle the individual function. I can see that have payoff in OS and security-critical software.

https://en.wikipedia.org/wiki/IBM_PL/S

Re:D 2.069.0 released, compiler automatically ported from C+... by pjmlp on Thursday November 05, 2015 @04:02AM (#10512350)
Interesting, I wasn't aware of it.
Re:D 2.069.0 released, compiler automatically ported from C+... by epoch1970 on Wednesday November 04, 2015 @12:39PM (#10508180)
Walter has been around a long time. He knows the game. Walter, have you ever used PL/I?
Re:D 2.069.0 released, compiler automatically ported from C+... by WalterBright on Wednesday November 04, 2015 @03:58PM (#10509697)
Nope. But Pascal was so simple that a listing for a working subset compiler for it (written in BASIC) was published in BYTE magazine back in the 70s.

But I (and many other compiler devs) thought back in the early 80's that Ada was so complex it was unimplementable. Today that thought seems charmingly naive.

Re:D 2.069.0 released, compiler automatically ported from C+... by pjmlp on Wednesday November 04, 2015 @12:55PM (#10508290)
I have spent quite some time in D forums....

EDIT: typo, time was missing

Re:D 2.069.0 released, compiler automatically ported from C+... by hasenj on Wednesday November 04, 2015 @11:48AM (#10507784)
That's kinda how lisp came to life, wasn't it? It was supposed to be a theoretical exercise, but someone took the "lisp in lisp" code and manually compiled it to assembly.
Re:D 2.069.0 released, compiler automatically ported from C+... by lazyjones on Wednesday November 04, 2015 @04:06PM (#10509765)
That's not really the only possible way. You could write an (arbitrarily slow & simple) interpreter in e.g. C to compile the compiler with itself, or translate to C, or use something like a p-code machine as an intermediate step (https://en.wikipedia.org/wiki/P-code_machine) with an assembler-written interpreter. The problem with using older versions is that in principle, you'd have to keep maintaining/porting them for newer systems/architectures.
Re:D 2.069.0 released, compiler automatically ported from C+... by rogeryu on Wednesday November 04, 2015 @08:35AM (#10506305)
Now all we need is some E to celebrate!
Re:D 2.069.0 released, compiler automatically ported from C+... by qznc on Wednesday November 04, 2015 @09:20AM (#10506646)
Re:D 2.069.0 released, compiler automatically ported from C+... by chubot on Wednesday November 04, 2015 @11:50AM (#10507797)
Hm this sounds just like the port of the Go compiler from C to Go. In that case it was C and Go, rather than C++ and D.