I'm on ubuntu x64 using dmd 2.060 and the following gives an
exception:
rdmd --main -unittest -version=useInterface mml/sets.d
while the following runs just fine:
rdmd --main -unittest -version=useAbstractClass mml/sets.d
The exception is:
object.Exception@src/object_.d(108): need opCmp for
I just ran into (I think) this bug
http://d.puremagic.com/issues/show_bug.cgi?id=8377 using dmd
2.060. Seeing that there was a fix in git, I cloned the latest
git dmd, built, and dropped the .exe into my existing dmd 2.060
installation directory.
I still get this unexpected optlink terminatio
On Sunday, August 19, 2012 23:38:01 Caligo wrote:
> template T(){
> enum a = pow(3.0, 2);
> enum b = pow(3, 2.0);
> }
>
> unittest
> {
> alias T!() t;
> }
>
> compiling that I get:
>
> /home/b/phobos/std/math.d(2369): Error: Cannot convert &real to ushort* at
> compile time
> /home/b/phobo
template T(){
enum a = pow(3.0, 2);
enum b = pow(3, 2.0);
}
unittest
{
alias T!() t;
}
compiling that I get:
/home/b/phobos/std/math.d(2369): Error: Cannot convert &real to ushort* at
compile time
/home/b/phobos/std/math.d(3292):called from here: isNaN(y)
/home/b/phobos/std/math.d(
On Monday, 20 August 2012 at 01:29:06 UTC, maarten van damme
wrote:
Depends. Do you plan on doing more than brute force? Having it
bulk copy them may not be that bad if it's all in one place,
and if you do it like that you have all the combinations that
carry forward to the next level and if yo
On Monday, 20 August 2012 at 02:28:25 UTC, Nvirjskly wrote:
Really? that was quick.
I didn't get very far with my attempt. =P
Ok, committing a broken version. Broken in the sense that it
does not work correctly as of yet. *Something* is not working
properly. I work on finding out what ex
Really? that was quick.
I didn't get very far with my attempt. =P
Ok, committing a broken version. Broken in the sense that it does
not work correctly as of yet. *Something* is not working
properly. I work on finding out what exactly some more today and
tommorrow, but it is in a "usable"
> Depends. Do you plan on doing more than brute force? Having it
> bulk copy them may not be that bad if it's all in one place, and
> if you do it like that you have all the combinations that carry
> forward to the next level and if you back out it undoes them all
> automatically.
>
No, I think
On 08/15/2012 09:46 AM, David Nadlinger wrote:
Related:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L510
David
That should work nicely.
Why does it not show up on dlang.org?
On Monday, 20 August 2012 at 00:13:41 UTC, maarten van damme
wrote:
I'm using a static array.
Good good..
I'm hesitating though if I should store possibilities in a
precalculated array or calculate them in-place. If I
precalculate the possibilities I'd have to copy them over and
over so I
On Sun, 19 Aug 2012 19:26:34 -0500, Nvirjskly wrote:
On Sunday, 19 August 2012 at 23:48:36 UTC, 1100110 wrote:
Here are my results! iirc -release implies -noboundscheck..
Also I am on x64, and these files only compile to 32bit. So there could
be
performance missing there.
Wow, thanks. It
I can't understand what command line arguments you are using for
LDC and GDC, but both of them have many useful optimization
arguments (some of them are not easy to use like link time
optimization in LDC).
Bye,
bearophile
On Sunday, 19 August 2012 at 23:48:36 UTC, 1100110 wrote:
Here are my results! iirc -release implies -noboundscheck..
Also I am on x64, and these files only compile to 32bit. So
there could be
performance missing there.
Wow, thanks. It looks like ldc2 does not play nice with
std.bigint, whi
I'm using a static array.
I'm hesitating though if I should store possibilities in a precalculated
array or calculate them in-place. If i precalculate the possibilities i'd
have to copy them over and over so i don't know if it's smart.
Going even further I could even store a filled-in value as an
On Sunday, 19 August 2012 at 21:24:26 UTC, maarten van damme
wrote:
The infinite loop was my mistake. I was looking at your outer
while loop but because you use exceptions instead of return
values it indeed throws an exception, my bad :)
I have a revised version that only does 2 calls for the
On Sunday, 19 August 2012 at 23:48:01 UTC, Minas Mina wrote:
That's what I do:
import std.c.stdlib;
void main(string[] args)
{
if( args.length == 1 )
{
writeln("Some arguments, please!");
exit(-1);
}
}
Sorry, forgot to import std.stdio.
That's what I do:
import std.c.stdlib;
void main(string[] args)
{
if( args.length == 1 )
{
writeln("Some arguments, please!");
exit(-1);
}
}
Here are my results! iirc -release implies -noboundscheck..Also I am on x64, and these files only compile to 32bit. So there could be performance missing there.rdmd --force -I../ -m32 -O -inline -release benchmark.d 26.00s user 0.23s system 99% cpu 26.386 total---2048 md2 in 1003 milliseconds: 15
Yeah, I figured it out. I did have to rename src though...
I ran a few tests, inconclusive for any serious difference.
gdc is now compiling with -O3 -march=native -frelease -fno-bounds-check
-finline -ffast-math.
But no, dmd has the shortest compile times, gdmd the longest.
I'm timing everyt
Greetings.
I am trying to pass a (I think) dchar value to a Windows COM
function and it does not work. Imagine this situation...
dchar test()
{
dchar val = 0x;
return val
}
void main()
{
...lots of code excluded
SomeWindowsComCall(test); // this call does not work
SomeWindows
On Sunday, 19 August 2012 at 21:11:13 UTC, 1100110 wrote:
I have gdc, dmd, and ldc installed on my computer.
I also forked your repo two minutes before reading this.
Tell me what you want, and Ill run whatever tests you want.
But in return, I'm stealing your whirlpool.(with attribution of
cou
The infinite loop was my mistake. I was looking at your outer while loop
but because you use exceptions instead of return values it indeed throws an
exception, my bad :)
By replacing ref by const ref my program slowed down (looked over a period
of 10_000 runs). Not considerably but noticeable. Com
I have gdc, dmd, and ldc installed on my computer.
I also forked your repo two minutes before reading this.
Tell me what you want, and Ill run whatever tests you want.
But in return, I'm stealing your whirlpool.(with attribution of course.)
On Sunday, August 19, 2012 20:28:35 teo wrote:
> I read at http://dlang.org/phobos/std_complex.html that "Complex will
> eventually replace the built-in types cfloat, cdouble, creal, ifloat,
> idouble, and ireal".
>
> Can someone elaborate why? What is wrong with the above types?
I think that it
On Sunday, August 19, 2012 22:13:15 Nvirjskly wrote:
> Ah, that makes a lot of sense. If my goal is a fast running time
> would it then make sense to use another compiler? I heard that
> gdc development is lagging behind and that ldc might not even
> support D2 all that well?
Both gdc and ldc supp
I read at http://dlang.org/phobos/std_complex.html that "Complex will
eventually replace the built-in types cfloat, cdouble, creal, ifloat,
idouble, and ireal".
Can someone elaborate why? What is wrong with the above types?
On Sunday, 19 August 2012 at 20:07:32 UTC, Jonathan M Davis wrote:
On Sunday, August 19, 2012 21:29:38 Nvirjskly wrote:
Compiling my code with the -noboundscheck flag sped it up by
almost 5 times (whilst passing all tests and working exactly
the
same way,) is bounds checking really that expens
On Sunday, 19 August 2012 at 07:57:15 UTC, Jeremy DeHaan wrote:
This probably isn't specifically a D only question as I've seen
this in C++ too, but does it make any kind of difference where
an attribute is placed when writing a function?
I've gotten in a habit of putting it to the right.
s
On Sunday, August 19, 2012 21:29:38 Nvirjskly wrote:
> Compiling my code with the -noboundscheck flag sped it up by
> almost 5 times (whilst passing all tests and working exactly the
> same way,) is bounds checking really that expensive, and what
> other simple optimisations can I preform other tha
On Sunday, 19 August 2012 at 09:39:53 UTC, maarten van damme
wrote:
Great, I tried to get rid of the dynamic array "possibilities"
by representing it using a static array of bools. This approach
made it 4 times faster :)
When I have a solid wifi connection I'm going to install dmd
2.60 to com
Nvirjskly:
is bounds checking really that expensive,
The D front-end is very dumb in this, as far as I know it makes
no attempts to remove those tests where they can't fail. Walter
believes such optimizations don't gain much.
what other simple optimisations can I preform other than
-inli
On Sun, 19 Aug 2012 10:15:42 +0200, Jonathan M Davis
wrote:
it's generally considered good practice to put const and immutable on
the right-hand side.
I would also say that putting function attributes on a separate line
above the function is fairly common:
const @property pure
int foo()
Compiling my code with the -noboundscheck flag sped it up by
almost 5 times (whilst passing all tests and working exactly the
same way,) is bounds checking really that expensive, and what
other simple optimisations can I preform other than -inline -O
-noboundscheck?
I have to "exit" the running program, in C I would call
#include
exit(0);
in Python:
sys.exit(0);
What's the correct way to do that in D?
My current implementation:
import core.runtime : Runtime;
import core.stdc.stdlib : exit;
Runtime.terminate();
exit(0);
But that doesn't seem correct.
my code is located at http://dpaste.dzfl.pl/93cd5f45
2012/8/19, maarten van damme :
> Great, i tried to get rid of the dynamic array "possibilities" by
> representing it using a static array of bools. This approach made it 4
> times faster :)
>
> When i have a solid wifi connection I'm going to in
On 08/19/2012 07:07 AM, bearophile wrote:
Ali Çehreli:
Took me a while! Phew... :)
http://dpaste.dzfl.pl/6b362382
I have back-ported your changes to my version, and it works (with few
improvements, a larger Busy Beaver, etc):
http://dpaste.dzfl.pl/0791bea9
---
I have a
On 08/19/2012 04:44 AM, bearophile wrote:
> Most of your code is very similar to mine, but I can also see many
> little differences, so it seems you have written your translation from
> scratch.
Yes, I've decided to start from scratch. I did look at yours after
struggling for some time and I wa
On Sunday, 19 August 2012 at 14:18:45 UTC, bearophile wrote:
You get an optlink crash. I don't know if this is fit for
Bugzilla.
Any crashes should be submitted to Bugzilla, regardless of what
input produced them. And besides that, the code presented here is
actually quite short for a linker
(some programs related to this have given me optilink errors,
In the latest version I've shown if you replace this in the
larger Busy Beaver:
struct TransitionTable(int sym, state) {
With a template:
template TransitionTable(int sym, state) {
You get an optlink crash. I don't know if this
Ali Çehreli:
Took me a while! Phew... :)
http://dpaste.dzfl.pl/6b362382
I have back-ported your changes to my version, and it works (with
few improvements, a larger Busy Beaver, etc):
http://dpaste.dzfl.pl/0791bea9
---
I have also tried to replace your code like thi
Ali Çehreli:
Took me a while! Phew... :)
http://dpaste.dzfl.pl/6b362382
I had lots of trouble matching the template specialization that
I needed. And a million silly mistakes of mine. Anyway...
Produces the same output.
It's tricky code :-) But it's a nice exercise for C++11 template
pr
Great, i tried to get rid of the dynamic array "possibilities" by
representing it using a static array of bools. This approach made it 4
times faster :)
When i have a solid wifi connection I'm going to install dmd 2.60 to
compile timon's code. In the meantime I've started beautifying the source
so
On Sunday, August 19, 2012 09:57:14 Jeremy DeHaan wrote:
> This probably isn't specifically a D only question as I've seen
> this in C++ too, but does it make any kind of difference where an
> attribute is placed when writing a function?
No. Any function attribute can go on either side, and which
This probably isn't specifically a D only question as I've seen
this in C++ too, but does it make any kind of difference where an
attribute is placed when writing a function?
example
class C
{
immutable void foo()
{
//code
}
}
vs
class D
{
void foo() immutable
{
44 matches
Mail list logo