Re: LDC 0.12.0 has been released

2013-10-26 Thread Kai Nacke

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


Re: LDC 0.12.0 has been released

2013-10-26 Thread John Joyus

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 wonder where would C# stand if it's added to that list.
I wouldn't like it if it performs any better than LDC though! ;-)


Re: LDC 0.12.0 has been released

2013-10-26 Thread John Joyus

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 compassion.

I wonder where would C# stand if it's added to the list.
I wouldn't like it if it performs any better than LDC though! ;-)


Re: LDC 0.12.0 has been released

2013-10-26 Thread John Joyus

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 wonder where would C# stand if it's added to the list.
I wouldn't like it if it performs any better than LDC though! ;-)


Re: LDC 0.12.0 has been released

2013-10-25 Thread ilya-stromberg

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.


Re: LDC 0.12.0 has been released

2013-10-25 Thread Jacob Carlborg

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


Re: LDC 0.12.0 has been released

2013-10-25 Thread deadalnix

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.


Re: LDC 0.12.0 has been released

2013-10-25 Thread John Joyus

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!!



Re: LDC 0.12.0 has been released

2013-10-23 Thread Moritz Warning
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-
l...@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! :-)


Re: LDC 0.12.0 has been released

2013-10-23 Thread Dicebot

Arch Linux package updated.


Re: LDC 0.12.0 has been released

2013-10-23 Thread David Nadlinger

On Wednesday, 23 October 2013 at 12:17:56 UTC, Dicebot wrote:

Arch Linux package updated.


Awesome, that was quick!

Thanks,
David


Re: LDC 0.12.0 has been released

2013-10-23 Thread John Joyus

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.




Re: LDC 0.12.0 has been released

2013-10-23 Thread Kai Nacke

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 help (e.g. look at the now solved issue #119 
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


Re: LDC 0.12.0 has been released

2013-10-23 Thread Joseph Rushton Wakeling
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 :-)


Re: LDC 0.12.0 has been released

2013-10-23 Thread John Joyus

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
help (e.g. look at the now solved issue #119
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.


Re: LDC 0.12.0 has been released

2013-10-22 Thread deadalnix
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-...@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 !