September 11, 2014
On Thu, 11 Sep 2014 17:52:03 +0000
David Nadlinger via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> So what exactly is your argument then?
C++ code.
D features.

D code.
D features.

is there *some* difference?


September 11, 2014
On Thursday, 11 September 2014 at 14:08:01 UTC, Iain Buclaw via Digitalmars-d wrote:
> 1) A distribution doesn't ship gdc already (ie: opensuse, fedora)

The openSUSE build service supports injection of binary packages for bootstrapping purposes, AFAIK. I would be more worried about the license (in case the pre-built compiler is DMD, not GDC).
September 11, 2014
On 11 Sep 2014 18:35, "Joakim via Digitalmars-d" < digitalmars-d@puremagic.com> wrote:
>
> On Thursday, 11 September 2014 at 15:24:41 UTC, ketmar via Digitalmars-d
wrote:
>>
>> there is no "D committee" (thanks to all existing and inexisting gods
>> for that!), so the only source of trust is compiler developer(s). if
>>
>> compiler developers avoid using new features, those features aren't "blessed", they are dangerous and all that.
>
>
> This is already the case with the pure C++ version of dmd, as David said,
since D is currently not used to write any of the D compilers.
>

*cough* SDC *cough*

In any case, I'll reiterated again. It's not as if the C++ implementation of D uses any features of C++ that were invented in the last decade...

Iain.


September 12, 2014
2014-09-11 0:12 GMT+04:00, ketmar via Digitalmars-d <digitalmars-d@puremagic.com>:
> write D -> C++ translator and add translated versions to repo too. no, really! this C++ code need not to be maintenable, so we can use C++ subset as "assembler language". i.e. use D frontend to make all analysis, instantiate templates and so on, then just emit ugly, unreadable, but working subset of C++. why C++? to support exceptions, which can be hard to do properly with C.

LDC and LLVM allow to comvert a D source code to C source (and may be to C++). What wrong with this solution?
September 12, 2014
On Fri, 12 Sep 2014 13:50:20 +0400
Sergey Korshunoff via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> LDC and LLVM allow to comvert a D source code to C source (and may be to C++). What wrong with this solution?
requiring LDC and LLVM and being LDC-specific solution. i don't see why i should install LLVM and LDC to regenerate C++ files. C++ codegen can (and should) be frontend's part.


September 12, 2014
On Friday, 12 September 2014 at 10:06:10 UTC, Sergey Korshunoff via Digitalmars-d wrote:
> 2014-09-11 0:12 GMT+04:00, ketmar via Digitalmars-d
> <digitalmars-d@puremagic.com>:
>> write D -> C++ translator and add translated versions to repo too. no,
>> really! this C++ code need not to be maintenable, so we can use C++
>> subset as "assembler language". i.e. use D frontend to make all
>> analysis, instantiate templates and so on, then just emit ugly,
>> unreadable, but working subset of C++. why C++? to support exceptions,
>> which can be hard to do properly with C.
>
> LDC and LLVM allow to comvert a D source code to C source (and may be
> to C++). What wrong with this solution?

There's nothing wrong with this solution. I think about this as a way to bootstrap LDC without requiring another D compiler.

Regards,
Kai
September 13, 2014
"Kai Nacke" <kai@redstar.de> writes:

> On Friday, 12 September 2014 at 10:06:10 UTC, Sergey Korshunoff via Digitalmars-d wrote:
>>
>> LDC and LLVM allow to comvert a D source code to C source (and may
>> be
>> to C++). What wrong with this solution?
>
> There's nothing wrong with this solution. I think about this as a way to bootstrap LDC without requiring another D compiler.
>
> Regards,
> Kai

This seemed like a fun solution but I found out the LLVM C backend was removed with LLVM 3.1.  There is also a cpp backend, but is different. Cpp target generates C++ code using LLVM API that will rebuild LLVM IR. I tried it on a simple D program to be sure and result is just IR.

$ ldc2 -output-ll hello.d
$ llc -march=cpp hello.ll -o output.cpp

and output.cpp has to be linked with some llvm libraries.  Also, output.cpp needed some hand edits to get it to work despite the "// Generated by llvm2cpp - DO NOT MODIFY!"  warning at the top.

when run output.cpp just prints IR (essentially same as hello.ll).

http://stackoverflow.com/questions/11597664/llvm-cpp-backend-does-it-replace-c-backend
September 14, 2014
But we want to get a C source from a D source. It is unpossible now to build a current LDC using LLVM 3.0? Anyway, there is some attemps to ressurect this backend http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/071968.html http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-April/071928.html



2014-09-14 3:29 GMT+04:00, Dan Olson via Digitalmars-d <digitalmars-d@puremagic.com>:
> "Kai Nacke" <kai@redstar.de> writes:
>
>> On Friday, 12 September 2014 at 10:06:10 UTC, Sergey Korshunoff via Digitalmars-d wrote:
>>>
>>> LDC and LLVM allow to comvert a D source code to C source (and may
>>> be
>>> to C++). What wrong with this solution?
>>
>> There's nothing wrong with this solution. I think about this as a way to bootstrap LDC without requiring another D compiler.
>>
>> Regards,
>> Kai
>
> This seemed like a fun solution but I found out the LLVM C backend was removed with LLVM 3.1.  There is also a cpp backend, but is different. Cpp target generates C++ code using LLVM API that will rebuild LLVM IR. I tried it on a simple D program to be sure and result is just IR.
>
> $ ldc2 -output-ll hello.d
> $ llc -march=cpp hello.ll -o output.cpp
>
> and output.cpp has to be linked with some llvm libraries.  Also, output.cpp needed some hand edits to get it to work despite the "// Generated by llvm2cpp - DO NOT MODIFY!"  warning at the top.
>
> when run output.cpp just prints IR (essentially same as hello.ll).
>
> http://stackoverflow.com/questions/11597664/llvm-cpp-backend-does-it-replace-c-backend
>
1 2 3 4 5
Next ›   Last »