Re: gdc-4.5 testing

2010-12-22 Thread Anders F Björklund
Neal Becker wrote: AFAIK both shared libraries and x86_64 code have been working for years with GDC, even though that is not the case with DMD. Phobos is still static, though. But you can't link shared obj to static lib (Phobos), except on i386 - so you really can't use shared obj on x86_64 (i

Re: gdc-4.5 testing

2010-12-22 Thread Iain Buclaw
== Quote from Neal Becker (ndbeck...@gmail.com)'s article > Anders F Björklund wrote: > > Neal Becker wrote: > >> Does this support building shared libs now (on x86_64)? > >> > > ... > >>> I uploaded the packages to SourceForge, if anyone else > >>> wants to try them... It's made for Fedora 14 (x86

Re: gdc-4.5 testing

2010-12-22 Thread Iain Buclaw
== Quote from Iain Buclaw (ibuc...@ubuntu.com)'s article > == Quote from Neal Becker (ndbeck...@gmail.com)'s article > > Anders F Björklund wrote: > > > Neal Becker wrote: > > >> Does this support building shared libs now (on x86_64)? > > >> > > > ... > > >>> I uploaded the packages to SourceForge,

Re: improvement request - enabling by-value-containers

2010-12-22 Thread Simon Buerger
On 21.12.2010 18:45, Bruno Medeiros wrote: On 09/12/2010 21:55, Simon Buerger wrote: From a pragmatic viewpoint you are right, copying containers is rare. But on the other hand, classes imply a kind of identity, so that a set is a different obejct then an other object with the very same elements

Re: gdc-4.5 testing

2010-12-22 Thread Anders F Björklund
Iain Buclaw wrote: AFAIK both shared libraries and x86_64 code have been working for years with GDC, even though that is not the case with DMD. But you can't link shared obj to static lib (Phobos), except on i386 - so you really can't use shared obj on x86_64 (if you need phobos). As far as

Re: try...catch slooowness?

2010-12-22 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 17:16:57 -0500, Rob wrote: Walter Bright wrote: Michel Fortin wrote: Exceptions are slow, that's a fact of life. The idea is that an exception should be exceptional, so the case to optimize for is the case where you don't have any exception: a try...catch that doesn't thro

Re: try...catch slooowness?

2010-12-22 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 17:25:09 -0500, Rob wrote: Steven Schveighoffer wrote: An exception is a recoverable error, Not necessarily. At some point, all the handling options could have been tried but all failed in which case there is nothing left to do except for letting something higher up (lik

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Sean Kelly
Mariusz Gliwiński Wrote: > Hello, > Why don't You make htod opensource? I don't think it has commercial > potential, > or I'm wrong? I'm asking, because it's a shame that people who wants publish > D > bindings have to make their own scripts for that (so bindings can be > generated > on !wi

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Iain Buclaw
== Quote from Sean Kelly (s...@invisibleduck.org)'s article > Mariusz Gliwiński Wrote: > > Hello, > > Why don't You make htod opensource? I don't think it has commercial potential, > > or I'm wrong? I'm asking, because it's a shame that people who wants publish D > > bindings have to make their own

Re: What's the problem in opensourcing htod?

2010-12-22 Thread BLS
On 22/12/2010 16:19, Sean Kelly wrote: I hate to say it, but I've found that creating the D headers by hand is faster than running htod and hand-editing to fix screw-ups. Particularly if there are any #if statements to contend with. Did you consider to use SWIG instead of htod ?

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Sean Kelly
BLS Wrote: > On 22/12/2010 16:19, Sean Kelly wrote: > > I hate to say it, but I've found that creating the D headers by hand is > > faster than running htod and hand-editing to fix screw-ups. Particularly > > if there are any #if statements to contend with. > > Did you consider to use SWIG ins

rdmd and extern(C)

2010-12-22 Thread spir
Hello, Is it possible use rdmd (to automagically link against imported D modules), when also calling C funcs? I tried to add the C file at the end of the building command, like eg (removed all dmd options): rdmd --build-only -ofmyProg myProg.d myCFuncs.o but rdmd does not seem to transmi

Re: Why Ruby?

2010-12-22 Thread Ary Borenszweig
I agree with you. We should ask a woman how she felt about that.

Re: rdmd and extern(C)

2010-12-22 Thread Andrei Alexandrescu
On 12/22/10 12:13 PM, spir wrote: Hello, Is it possible use rdmd (to automagically link against imported D modules), when also calling C funcs? I tried to add the C file at the end of the building command, like eg (removed all dmd options): rdmd --build-only -ofmyProg myProg.d myCFuncs

Re: gdc-4.5 testing

2010-12-22 Thread Iain Buclaw
== Quote from Anders F Björklund (a...@algonet.se)'s article > Iain Buclaw wrote: > >>> AFAIK both shared libraries and x86_64 code have been working > >>> for years with GDC, even though that is not the case with DMD. > >> But you can't link shared obj to static lib (Phobos), except on i386 - so >

Re: try...catch slooowness?

2010-12-22 Thread Rob
Steven Schveighoffer wrote: > On Tue, 21 Dec 2010 17:16:57 -0500, Rob wrote: > >> Walter Bright wrote: >>> Michel Fortin wrote: Exceptions are slow, that's a fact of life. The idea is that an exception should be exceptional, so the case to optimize for is the case where you don't ha

Re: try...catch slooowness?

2010-12-22 Thread Rob
Steven Schveighoffer wrote: > On Tue, 21 Dec 2010 17:25:09 -0500, Rob wrote: > >> Steven Schveighoffer wrote: >> >>> An exception is a recoverable error, >> >> Not necessarily. At some point, all the handling options could have >> been tried but all failed in which case there is nothing left to do

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Jacob Carlborg
On 2010-12-21 22:58, Mariusz Gliwiński wrote: Hello, Why don't You make htod opensource? I don't think it has commercial potential, or I'm wrong? I'm asking, because it's a shame that people who wants publish D bindings have to make their own scripts for that (so bindings can be generated on !win

Re: try...catch slooowness?

2010-12-22 Thread Steven Schveighoffer
On Wed, 22 Dec 2010 15:21:52 -0500, Rob wrote: Steven Schveighoffer wrote: On Tue, 21 Dec 2010 17:16:57 -0500, Rob wrote: Walter Bright wrote: Michel Fortin wrote: Exceptions are slow, that's a fact of life. The idea is that an exception should be exceptional, so the case to optimize for

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Andrej Mitrovic
Well, Clang can build binaries on Windows. AFAIK the only problem is exceptions on Windows. On 12/22/10, Jacob Carlborg wrote: > On 2010-12-21 22:58, Mariusz Gliwiński wrote: >> Hello, >> Why don't You make htod opensource? I don't think it has commercial >> potential, >> or I'm wrong? I'm asking

Re: TDPL source code

2010-12-22 Thread Andrej Mitrovic
While you're waiting I've assembled the code that I've written from TDPL. It's not complete, and there's likely a bunch of typos here and there. But it's better than nothing: http://dl.dropbox.com/u/9218759/TDPL_Source%28unofficial.beta%29.zip On 12/4/10, Andrei Alexandrescu wrote: > On 12/4/1

Re: New syntax for string mixins

2010-12-22 Thread Alex_Dovhal
"Don" wrote: > It's not that complicated. Once you can load the library and call *one* > function in it, the problem is solved. > But at a deeper level, I'm not sure what you'd hope to achieve with this. > I mean (excluding some not-yet implemented features), CTFE allows you to > execute any pur

Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
To see what performance advantage D would give me over using a scripting language, I made a small benchmark. It consists of this code: >auto L = iota(0.0, 1000.0); >auto L2 = map!"a / 2"(L); >auto L3 = map!"a + 2"(L2); >auto V = reduce!"a + b"(L3); It runs in 281 ms on my com

Re: What's the problem in opensourcing htod?

2010-12-22 Thread BLS
On 22/12/2010 19:11, Sean Kelly wrote: BLS Wrote: On 22/12/2010 16:19, Sean Kelly wrote: I hate to say it, but I've found that creating the D headers by hand is faster than running htod and hand-editing to fix screw-ups. Particularly if there are any #if statements to contend with. Did yo

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Trass3r
Or is D, unlike I thought, not suitable for high performance computing? What should I do? LuaJIT seems to have a really good backend. You better compare with ldc or gdc.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Steven Schveighoffer
On Wed, 22 Dec 2010 17:04:21 -0500, Andreas Mayer wrote: To see what performance advantage D would give me over using a scripting language, I made a small benchmark. It consists of this code: auto L = iota(0.0, 1000.0); auto L2 = map!"a / 2"(L); auto L3 = map!"a + 2"(L2); au

Re: Why is D slower than LuaJIT?

2010-12-22 Thread BLS
On 22/12/2010 23:06, Steven Schveighoffer wrote: (also, ensure you use -O -release -inline for the most optimized code). quote... // D version, with std.algorithm // ~ 281 ms, using dmd 2.051 (dmd -O -release -inline) Sometimes having a look at the source helps :)

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
Trass3r Wrote: > LuaJIT seems to have a really good backend. > You better compare with ldc or gdc. Maybe someone could do that for me? I don't have ldc or gdc here. There are some Debian packages, but they are D version 1 only?

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Gary Whatmore
Andreas Mayer Wrote: > To see what performance advantage D would give me over using a scripting > language, I made a small benchmark. It consists of this code: > > >auto L = iota(0.0, 1000.0); > >auto L2 = map!"a / 2"(L); > >auto L3 = map!"a + 2"(L2); > >auto V = reduce!"a +

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Iain Buclaw
== Quote from Andreas Mayer (s...@bacon.eggs)'s article > To see what performance advantage D would give me over using a scripting language, I made a small benchmark. It consists of this code: One corner case doesn't amount to an end-all be-all proof to anything. > >auto L = iota(0.0, 100

Re: Why is D slower than LuaJIT?

2010-12-22 Thread BLS
On 22/12/2010 23:31, Gary Whatmore wrote: Not intending to start a religious war but if your native code runs slower than*JIT* code, you're doing something wrong. D will always beat JIT. You talk like a prayer, don't you ? No need to measure. I believe ... Anyway I don't care about LUA. The

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Ary Borenszweig
Lua is a proven, robust language Lua has been used in many industrial applications (e.g., Adobe's Photoshop Lightroom), with an emphasis on embedded systems (e.g., the Ginga middleware for digital TV in Brazil) and games (e.g., World of Warcraft). Lua is currently the leading scripting language in

Re: Why is D slower than LuaJIT?

2010-12-22 Thread spir
On Wed, 22 Dec 2010 17:04:21 -0500 Andreas Mayer wrote: > To see what performance advantage D would give me over using a scripting > language, I made a small benchmark. It consists of this code: > > >auto L = iota(0.0, 1000.0); > >auto L2 = map!"a / 2"(L); > >auto L3 = map!"a +

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Gary Whatmore
Ary Borenszweig Wrote: > Lua is a proven, robust language > > Lua has been used in many industrial applications (e.g., Adobe's > Photoshop Lightroom), with an emphasis on embedded systems (e.g., the > Ginga middleware for digital TV in Brazil) and games (e.g., World of > Warcraft). Lua is current

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Adam D. Ruppe
Steven Schveighoffer wrote: > I would guess this has something to do with > the lack of inlining for algorithmic functions. Yeah, this is almost certainly the problem. I rewrote the code using a traditional C style loop, no external functions, and I'm getting roughly equal performance.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Ary Borenszweig
You said Lua is a joke language. It doesn't seem to be one...

Re: Why is D slower than LuaJIT?

2010-12-22 Thread loser
Adam D. Ruppe Wrote: > Steven Schveighoffer wrote: > > I would guess this has something to do with > > the lack of inlining for algorithmic functions. > > Yeah, this is almost certainly the problem. I rewrote the > code using a traditional C style loop, no external functions, > and I'm getting r

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Gary Whatmore
Ary Borenszweig Wrote: > You said Lua is a joke language. It doesn't seem to be one... Okay then, maybe it's not completely true. I meant it doesn't work in large scale applications unlike a static systems programming language. Need to study how extensively it's used in that game. I just tihkn

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
Gary Whatmore Wrote: > Andreas Mayer Wrote: > > > To see what performance advantage D would give me over using a scripting > > language, I made a small benchmark. It consists of this code: > > > > >auto L = iota(0.0, 1000.0); > > >auto L2 = map!"a / 2"(L); > > >auto L3 = map!"a

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Walter Bright
Andreas Mayer wrote: Or is D, unlike I thought, not suitable for high performance computing? What should I do? I notice you are using doubles in D. dmd currently uses the x87 to evaluate doubles, and on some processors the x87 is slow relative to using the XMM instructions. Also, dmd's back

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
Walter Bright Wrote: > I notice you are using doubles in D. dmd currently uses the x87 to evaluate > doubles, and on some processors the x87 is slow relative to using the XMM > instructions. Also, dmd's back end doesn't align the doubles on 16 byte > boundaries, which can also slow down the flo

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Walter Bright
Walter Bright wrote: Andreas Mayer wrote: Or is D, unlike I thought, not suitable for high performance computing? What should I do? I forgot to mention. In the D version, use integers as a loop counter, not doubles.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
Iain Buclaw Wrote: > Another may be simply that there is a lot > more going on behind the scenes than what you give credit for in D. What else does it do? I want to add it to the Lua version.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread bearophile
Andreas Mayer: > To see what performance advantage D would give me over using a scripting > language, I made a small benchmark. It consists of this code: I have done (and I am doing) many benchmarks with D, and I too have seen similar results. I have discussed this topic two times in past, this

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Walter Bright
Andreas Mayer wrote: I shouldn't use D now? How long until it is ready? It depends on what you want to do. A lot of people are successfully using D.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread bearophile
loser: > So is it justified enough to throw my W's incompetence card on the table at > this point? How else it is possible that a simple scripting language with > simple JIT optimization heuristics can outperform a performance oriented > systems programming language. It's not wise to premature

Re: Why is D slower than LuaJIT?

2010-12-22 Thread spir
On Wed, 22 Dec 2010 18:26:33 -0500 Gary Whatmore wrote: > Ary Borenszweig Wrote: > > > You said Lua is a joke language. It doesn't seem to be one... > > Okay then, maybe it's not completely true. I meant it doesn't work in large > scale applications unlike a static systems programming language

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andrej Mitrovic
On 12/22/10, Steven Schveighoffer wrote: > Without any imperical testing, I would guess this has something to do with > the lack of inlining for algorithmic functions. This is due primarily to > uses of enforce, which use lazy parameters, which are currently not > inlinable (also, ensure you use

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Eric Poggel
On 12/22/2010 5:31 PM, Gary Whatmore wrote: 5) you were using old d runtime garbage collector. One fellow here made a precise state of the art GC which beats even Java's 20 year old GC and C#. Patch your dmd to use this instead. Could you point me to more information? This sounds interesting

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Walter Bright
bearophile wrote: Surely Lua looks like a far worse language regarding optimization opportunities. But people around here (like you) must start to realize that JIT compilation is not what it used to be. Today the JIT compilation done by the JavaVM is able to perform de-virtualization, dynamic loo

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Walter Bright
Andrej Mitrovic wrote: I have just tried removing enforce usage from Phobos and recompiling the library, and compiling again with -O -release -inline. It doesn't appear to make a difference in the timing speed over multiple runs. Try looking at the obj2asm dump of the inner loop.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread bearophile
> I think you forget that I wrote on a Java compiler way back in the day I remember it :-) > dmd does cross-module inlining. I didn't know this, much... Bye, bearophile

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andrei Alexandrescu
On 12/22/10 4:04 PM, Andreas Mayer wrote: To see what performance advantage D would give me over using a scripting language, I made a small benchmark. It consists of this code: auto L = iota(0.0, 1000.0); auto L2 = map!"a / 2"(L); auto L3 = map!"a + 2"(L2); auto V = reduce!

Re: Why is D slower than LuaJIT?

2010-12-22 Thread bearophile
Andrei: > As this test essentially measures the performance of > iota and reduce, it would be hasty to generalize the assessment. >From other tests I have seen that often FP-heavy code is faster with Lua-JIT >than with D-DMD. But on average the speed difference is much less than 10 >times, ge

Is std.demangle usable?

2010-12-22 Thread Andrej Mitrovic
import std.stdio; import std.demangle; import std.traits; void main() { void test() { } auto mystr = mangledName!(test); // --- demangle4mainFAAyaZv4testMFZv writeln(demangle(mystr));// writes back demangle4mainFAAyaZv4testMFZv } Also, the example cod

Re: Is std.demangle usable?

2010-12-22 Thread Andrej Mitrovic
Okay, this works: import std.stdio; import std.demangle; import std.traits; void main() { void test() { } auto mystr = "_D3std5stdio4File17LockingTextWriter11__T3putTAaZ3putMFAaZv"; writeln(demangle(mystr)); // void std.stdio.File.LockingTextWriter.put!(char[]).put(char[]) }

Re: Is std.demangle usable?

2010-12-22 Thread Andrej Mitrovic
It's really weird though, because I can only demangle a few names from a .log file when using -profile with DMD. Is this normal?

Re: Is std.demangle usable?

2010-12-22 Thread Sean Kelly
std.demangle is moderately broken. Use core.demangle instead. I meant to have std.demangle call core.demangle for this release, but forgot to make the change.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andrei Alexandrescu
On 12/22/10 4:04 PM, Andreas Mayer wrote: To see what performance advantage D would give me over using a scripting language, I made a small benchmark. It consists of this code: auto L = iota(0.0, 1000.0); auto L2 = map!"a / 2"(L); auto L3 = map!"a + 2"(L2); auto V = reduce!

Re: Why Ruby?

2010-12-22 Thread Walter Bright
Nick Sabalausky wrote: Sounds a bit Zen Buddhist or maybe Taoist to me. Gravity - it's the law.

Re: What's the problem in opensourcing htod?

2010-12-22 Thread Mariusz Gliwiński
Wednesday 22 December 2010 @ 23:02:44 BLS: > tried SWIG for C++ to D. But frankly said I am not able to offer > substantial feedback 'cause every binding I have created was more or > less in a toy area.. Thanks for answers everyone, swig looks interesting. Again, it strips const so probably D1

Re: Is std.demangle usable?

2010-12-22 Thread Sean Kelly
Sean Kelly Wrote: > std.demangle is moderately broken. Use core.demangle instead. I meant to > have std.demangle call core.demangle for this release, but forgot to make the > change. Okay, I'm about to check in this change. With it, demangle works on the string you supplied provided it's pr

Re: Is std.demangle usable?

2010-12-22 Thread Andrej Mitrovic
On 12/23/10, Sean Kelly wrote: > Okay, I'm about to check in this change. With it, demangle works on the > string you supplied provided it's prefixed with "_D8" or "D8". Simply > having "demangle4mainFAAyaZv4testMFZv" isn't a complete symbol. > Thanks. It works for _D3 as well. But not all of t

Re: Is std.demangle usable?

2010-12-22 Thread Brad Roberts
Please file a bug against druntime with any symbols that it can't handle. If you know the symbol name it should decode to, that'd help. On Thu, 23 Dec 2010, Andrej Mitrovic wrote: > On 12/23/10, Sean Kelly wrote: > > Okay, I'm about to check in this change. With it, demangle works on the >

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andrej Mitrovic
That's odd, I'm getting opposite results: iota = 78ms baseline = 187ms Andreas' old code gives: 421ms This is over multiple runs so I'm getting the average out of about 20 runs. On 12/23/10, Andrei Alexandrescu wrote: > On 12/22/10 4:04 PM, Andreas Mayer wrote: >> To see what performance advan

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andreas Mayer
Andrei Alexandrescu Wrote: > Andreas, any chance you could run this on your machine and compare it > with Lua? (I don't have Lua installed.) Thanks! Your version: 40 ms (iota and baseline give the same timings) LuaJIT with map calls removed: 21 ms Interesting results.

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Andrei Alexandrescu
On 12/22/10 11:06 PM, Andreas Mayer wrote: Andrei Alexandrescu Wrote: Andreas, any chance you could run this on your machine and compare it with Lua? (I don't have Lua installed.) Thanks! Your version: 40 ms (iota and baseline give the same timings) LuaJIT with map calls removed: 21 ms Inter

Re: Why is D slower than LuaJIT?

2010-12-22 Thread Brad Roberts
On Wed, 22 Dec 2010, Andrei Alexandrescu wrote: > On 12/22/10 11:06 PM, Andreas Mayer wrote: > > Andrei Alexandrescu Wrote: > > > > > Andreas, any chance you could run this on your machine and compare it > > > with Lua? (I don't have Lua installed.) Thanks! > > > > Your version: 40 ms (iota and

Re: rdmd and extern(C)

2010-12-22 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:iethab$2dj...@digitalmars.com... > On 12/22/10 12:13 PM, spir wrote: >> Hello, >> >> Is it possible use rdmd (to automagically link against imported D >> modules), when also calling C funcs? I tried to add the C file at the end >> of the building comm