www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - LDC 0.12.0 has been released

reply "David Nadlinger" <code klickverbot.at> writes:
LDC 0.12.0, the LLVM-based D compiler, is available for download! 
It is built on the 2.063.2 frontend and standard library and 
supports LLVM 3.1-3.3 (OS X: 3.2 only).

As usual, you can find links to the changelog and the binary 
packages over at digitalmars.D.ldc: 
http://forum.dlang.org/post/mailman.2418.1382481165.1719.digitalmars-d-ldc puremagic.com

Also, while it is not yet clear when the final DMD 2.064 release 
will come out, work on integrating it into LDC has already begun, 
so stay tuned for the next release.

Cheers,
David
Oct 22 2013
next sibling parent "deadalnix" <deadalnix gmail.com> writes:
On Tuesday, 22 October 2013 at 22:42:14 UTC, David Nadlinger 
wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for 
 download! It is built on the 2.063.2 frontend and standard 
 library and supports LLVM 3.1-3.3 (OS X: 3.2 only).

 As usual, you can find links to the changelog and the binary 
 packages over at digitalmars.D.ldc: 
 http://forum.dlang.org/post/mailman.2418.1382481165.1719.digitalmars-d-ldc puremagic.com

 Also, while it is not yet clear when the final DMD 2.064 
 release will come out, work on integrating it into LDC has 
 already begun, so stay tuned for the next release.

 Cheers,
 David
Awesome !
Oct 22 2013
prev sibling next sibling parent Moritz Warning <moritzwarning web.de> writes:
On Wed, 23 Oct 2013 00:42:13 +0200, David Nadlinger wrote:

 LDC 0.12.0, the LLVM-based D compiler, is available for download!
 It is built on the 2.063.2 frontend and standard library and supports
 LLVM 3.1-3.3 (OS X: 3.2 only).
 
 As usual, you can find links to the changelog and the binary packages
 over at digitalmars.D.ldc:
 http://forum.dlang.org/post/mailman.2418.1382481165.1719.digitalmars-d-
ldc puremagic.com
 
 Also, while it is not yet clear when the final DMD 2.064 release will
 come out, work on integrating it into LDC has already begun,
 so stay tuned for the next release.
 
 Cheers,
 David
Congratulations! :-)
Oct 23 2013
prev sibling next sibling parent reply "Dicebot" <public dicebot.lv> writes:
Arch Linux package updated.
Oct 23 2013
parent "David Nadlinger" <code klickverbot.at> writes:
On Wednesday, 23 October 2013 at 12:17:56 UTC, Dicebot wrote:
 Arch Linux package updated.
Awesome, that was quick! Thanks, David
Oct 23 2013
prev sibling next sibling parent reply John Joyus <john.joyus gmail.com> writes:
On 10/22/2013 06:42 PM, David Nadlinger wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for download!
Congratulations! I am a D enthusiast who reads more *about* D than actually learning the language! ;) I have a question about LLVM. When it comes to performance, do all LLVM-based languages eventually match each other in speed for any given task, no matter it is Clang or D? I guess having or not having a GC (or different implementations of it in different languages) will make a difference, but if we exclude GC, will they be generating the same exact code for any given operation? In other words, though two different languages are based on LLVM, can one of its binary exceed the other in speed? Thanks.
Oct 23 2013
next sibling parent reply "Kai Nacke" <kai redstar.de> writes:
On Wednesday, 23 October 2013 at 17:45:50 UTC, John Joyus wrote:
 On 10/22/2013 06:42 PM, David Nadlinger wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for 
 download!
Congratulations! I am a D enthusiast who reads more *about* D than actually learning the language! ;) I have a question about LLVM. When it comes to performance, do all LLVM-based languages eventually match each other in speed for any given task, no matter it is Clang or D? I guess having or not having a GC (or different implementations of it in different languages) will make a difference, but if we exclude GC, will they be generating the same exact code for any given operation?
It depends. If 2 language frontends generate the same IR then LLVM generates the same exact code. But in general you have different languages features therefore the IR differs, too. (C++ classes are not available in C, C++ multiple inheritance in not available in D, D slices are not available in C++, ...) If the generated IR is too "stupid" then even the LLVM optimizer https://github.com/ldc-developers/ldc/issues/119). And a functional language like Haskell is likely to generate totally different IR.
 In other words, though two different languages are based on 
 LLVM, can one of its binary exceed the other in speed?
Yes.
 Thanks.
Regards Kai
Oct 23 2013
parent John Joyus <john.joyus gmail.com> writes:
On 10/23/2013 02:26 PM, Kai Nacke wrote:
 On Wednesday, 23 October 2013 at 17:45:50 UTC, John Joyus wrote:
 On 10/22/2013 06:42 PM, David Nadlinger wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for download!
Congratulations! I am a D enthusiast who reads more *about* D than actually learning the language! ;) I have a question about LLVM. When it comes to performance, do all LLVM-based languages eventually match each other in speed for any given task, no matter it is Clang or D? I guess having or not having a GC (or different implementations of it in different languages) will make a difference, but if we exclude GC, will they be generating the same exact code for any given operation?
It depends. If 2 language frontends generate the same IR then LLVM generates the same exact code. But in general you have different languages features therefore the IR differs, too. (C++ classes are not available in C, C++ multiple inheritance in not available in D, D slices are not available in C++, ...) If the generated IR is too "stupid" then even the LLVM optimizer can't https://github.com/ldc-developers/ldc/issues/119). And a functional language like Haskell is likely to generate totally different IR.
 In other words, though two different languages are based on LLVM, can
 one of its binary exceed the other in speed?
Yes.
Thanks Kai, It's good to know that "smart" developers can develop better compilers with the same IR available to all.
Oct 23 2013
prev sibling parent reply "ilya-stromberg" <ilya-stromberg-2009 yandex.ru> writes:
On Wednesday, 23 October 2013 at 17:45:50 UTC, John Joyus wrote:
 On 10/22/2013 06:42 PM, David Nadlinger wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for 
 download!
Congratulations! I am a D enthusiast who reads more *about* D than actually learning the language! ;) I have a question about LLVM. When it comes to performance, do all LLVM-based languages eventually match each other in speed for any given task, no matter it is Clang or D? I guess having or not having a GC (or different implementations of it in different languages) will make a difference, but if we exclude GC, will they be generating the same exact code for any given operation? In other words, though two different languages are based on LLVM, can one of its binary exceed the other in speed? Thanks.
It depends. Two benchmarks of different languages and compilers: http://togototo.wordpress.com/2013/07/23/benchmarking-level-generation-go-rust-haskell-and-d/ http://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallel-go-rust-d-scala-and-nimrod/ I think it's answer for your question. For example, Clang (LLVM C) is fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM Haskell) ~ 2 times slower.
Oct 25 2013
next sibling parent reply "deadalnix" <deadalnix gmail.com> writes:
On Friday, 25 October 2013 at 07:50:36 UTC, ilya-stromberg wrote:
 I think it's answer for your question. For example, Clang (LLVM 
 C) is fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM 
 Haskell) ~ 2 times slower.
The explanation is quite simple. LLVM understand C and C++ runtime. It doesn't understand D runtime (LDC is doing some work in that regard, but it is still limited). So you see a difference between C and C++ as some optimization will be done in C/C++ (for instance heap to stack promotion) when it won't be done in D. Haskell has really different semantic than C and C++, and quite far away from the hardware, so you have to expect a performance drop. The comparison of either C or C++ with haskell is not really meaningful as it is really comparing apple and bananas.
Oct 25 2013
next sibling parent reply "Kai Nacke" <kai redstar.de> writes:
On Saturday, 26 October 2013 at 02:21:37 UTC, deadalnix wrote:
 The explanation is quite simple. LLVM understand C and C++ 
 runtime. It doesn't understand D runtime (LDC is doing some 
 work in that regard, but it is still limited). So you see a 
 difference between C and C++ as some optimization will be done 
 in C/C++ (for instance heap to stack promotion) when it won't 
 be done in D.
While this is true in general I don't think that it explains the difference in the mentioned benchmark. A PRNG does not use too much of the C runtime. I believe that the IR generated by LDC could be improved and that the difference in speed is caused by this. Regards Kai
Oct 26 2013
parent Marco Leise <Marco.Leise gmx.de> writes:
Am Sat, 26 Oct 2013 18:34:55 +0200
schrieb "Kai Nacke" <kai redstar.de>:

 On Saturday, 26 October 2013 at 02:21:37 UTC, deadalnix wrote:
 The explanation is quite simple. LLVM understand C and C++ 
 runtime. It doesn't understand D runtime (LDC is doing some 
 work in that regard, but it is still limited). So you see a 
 difference between C and C++ as some optimization will be done 
 in C/C++ (for instance heap to stack promotion) when it won't 
 be done in D.
While this is true in general I don't think that it explains the difference in the mentioned benchmark. A PRNG does not use too much of the C runtime.
And at a closer look, the author replaced calls to the C PRNG with a simple XorShift engine included in the source code to level the field between the languages. 60% of the runtime is spent checking for collisions between rectangles.
 I believe that the IR generated by LDC could be improved and that 
 the difference in speed is caused by this.
If the author had applied correct rounding both Clang and LDC would have had 100%. I assume the 1 ms (< 0.5%) difference stems from the startup time of D or maybe for C he timed the code internally and for D he used "time"; but it is really insignificant in relative numbers.
 Regards
 Kai
-- Marco
Nov 05 2013
prev sibling parent Marco Leise <Marco.Leise gmx.de> writes:
Am Sat, 26 Oct 2013 04:21:26 +0200
schrieb "deadalnix" <deadalnix gmail.com>:

 On Friday, 25 October 2013 at 07:50:36 UTC, ilya-stromberg wrote:
 I think it's answer for your question. For example, Clang (LLVM 
 C) is fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM 
 Haskell) ~ 2 times slower.
The explanation is quite simple. LLVM understand C and C++ runtime. It doesn't understand D runtime (LDC is doing some work in that regard, but it is still limited). So you see a difference between C and C++ as some optimization will be done in C/C++ (for instance heap to stack promotion) when it won't be done in D.
Some observations: The posted level creation benchmark contains no dynamic memory allocation and no runtime calls in the critical loop. As such you won't lose performance due to missing compiler intrinsics or the GC here and the runtime difference between the D and the C version is minimal (< 0.5% in fact). Yet I've altered it a bit to gain another 10% for the D version (without changing the algorithm): https://github.com/mleise/levgen-benchmarks/blob/master/D.d Now D is the fastest again and we are all happy :) -- Marco
Nov 05 2013
prev sibling next sibling parent John Joyus <john.joyus gmail.com> writes:
On 10/25/2013 03:50 AM, ilya-stromberg wrote:
 It depends.
 Two benchmarks of different languages and compilers:
 http://togototo.wordpress.com/2013/07/23/benchmarking-level-generation-go-rust-haskell-and-d/

 http://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallel-go-rust-d-scala-and-nimrod/


 I think it's answer for your question. For example, Clang (LLVM C) is
 fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM Haskell) ~ 2
 times slower.
Yes, that answers my question. Thanks for those great links! It's impressive the LDC is as fast as Clang!!
Oct 25 2013
prev sibling next sibling parent John Joyus <john.joyus gmail.com> writes:
On 10/25/2013 03:50 AM, ilya-stromberg wrote:
 It depends.
 Two benchmarks of different languages and compilers:
 http://togototo.wordpress.com/2013/07/23/benchmarking-level-generation-go-rust-haskell-and-d/

 http://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallel-go-rust-d-scala-and-nimrod/


 I think it's answer for your question. For example, Clang (LLVM C) is
 fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM Haskell) ~ 2
 times slower.
They also show non-llvm compilers like D in that chart for compassion. I wouldn't like it if it performs any better than LDC though! ;-)
Oct 26 2013
prev sibling parent John Joyus <john.joyus gmail.com> writes:
On 10/25/2013 03:50 AM, ilya-stromberg wrote:

 It depends.
 Two benchmarks of different languages and compilers:
 http://togototo.wordpress.com/2013/07/23/benchmarking-level-generation-go-rust-haskell-and-d/

 http://togototo.wordpress.com/2013/08/23/benchmarks-round-two-parallel-go-rust-d-scala-and-nimrod/


 I think it's answer for your question. For example, Clang (LLVM C) is
 fastest, LDC (LLVM D) has 2-nd place, but LLVM-GHC (LLVM Haskell) ~ 2
 times slower.
They also show non-llvm compilers like DMD in that chart, for comparison. I wouldn't like it if it performs any better than LDC though! ;-)
Oct 26 2013
prev sibling next sibling parent "Joseph Rushton Wakeling" <joseph.wakeling webdrake.net> writes:
On Tuesday, 22 October 2013 at 22:42:14 UTC, David Nadlinger 
wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for 
 download! It is built on the 2.063.2 frontend and standard 
 library and supports LLVM 3.1-3.3 (OS X: 3.2 only).
Congratulations David and team :-)
Oct 23 2013
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2013-10-23 00:42, David Nadlinger wrote:
 LDC 0.12.0, the LLVM-based D compiler, is available for download! It is
 built on the 2.063.2 frontend and standard library and supports LLVM
 3.1-3.3 (OS X: 3.2 only).
I noticed that Apple's releases of Clang is still at 3.2. -- /Jacob Carlborg
Oct 25 2013