On Friday, 27 May 2016 at 20:59:56 UTC, John wrote:
Additionally, remove QueryInterface, AddRef and Release from
the definition of IDirectSound. Also, interfaces are already
references, so the definition of LPDIRECTSOUND should be:
alias LPDIRECTSOUND = IDirectSound;
Note there should be
On Friday, 27 May 2016 at 21:41:02 UTC, Kagamin wrote:
On Friday, 27 May 2016 at 20:20:36 UTC, chmike wrote:
Is this code valid D or is the behavior undefined due to the
cast ?
A mutable object can be synchronized on:
synchronized(Category.instance){}
This will create and store a mutex in the
Well decided I should dig my hand in assembly just to see if it
would work. Using wideint.d as a starting point I thought I would
do the simplest operation I could do, an increment.
https://github.com/d-gamedev-team/gfm/blob/master/integers/gfm/integers/wideint.d
On Thursday, 26 May 2016 at 10:51:30 UTC, John Nixon wrote:
On Wednesday, 25 May 2016 at 15:44:34 UTC, Marc Schütz wrote:
On Tuesday, 24 May 2016 at 20:58:11 UTC, John Nixon wrote:
On Tuesday, 24 May 2016 at 15:17:37 UTC, Adam D. Ruppe wrote:
On Tuesday, 24 May 2016 at 14:29:53 UTC, John
http://ftp.dlang.org/ctg/implib.html
The above URL suggests that, on Windoze, I can create a D
compatible lib from a dll file by issuing the command:
implib /s dsound.lib dsound.dll
The following file:
sound.d
===
pragma(lib, "dsound")
struct IDirectSound{};
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS all use the path to be
/ the D seems to use /companies (though I don't know vibe).
Is that right?
The following code compiles with DMD 2.070, but not with 2.071:
```
module mod;
import std.range;
struct S
{
struct Inner
{
int unique_identifier_name;
int tail;
}
Inner inner;
alias inner this;
auto works()
{
return unique_identifier_name;
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How is
this even possible ?
I am doing something wrong ?
Here are
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
On Friday, 27 May 2016 at 14:43:47 UTC, ArturG wrote:
if(value is typeof(value).init) ...
that still requiers a special case for floating points, arrays
and optionally empty string literals.
Have you tried? That should work in all cases.
On Friday, 27 May 2016 at 14:18:31 UTC, llaine wrote:
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS all use the path to be
/ the D seems to use
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS all use the path to be
/ the D seems to use /companies (though I don't know vibe).
Is that right?
All
On Friday, 27 May 2016 at 12:26:19 UTC, Andrew Edwards wrote:
http://ftp.dlang.org/ctg/implib.html
The above URL suggests that, on Windoze, I can create a D
compatible lib from a dll file by issuing the command:
[...]
If you haven't done so, you need to copy your resulting LIB file
to
On Friday, 27 May 2016 at 13:54:20 UTC, Vadim Lopatin wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
oooh, I wanna try my libs.
Where's your database dump?
On Friday, 27 May 2016 at 09:25:55 UTC, Marc Schütz wrote:
On Thursday, 26 May 2016 at 16:45:22 UTC, ArturG wrote:
im just playing with this template[1] is there anything else i
missed? (if you dont mind)
it basically treats any T.init as false and skips the
function/delegate and just returns
On Friday, 27 May 2016 at 13:54:20 UTC, Vadim Lopatin wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS all use the path to be
/ the D seems to use /companies (though I don't know vibe).
Is that right?
Yes
On Friday, 27 May 2016 at 09:22:49 UTC, Guillaume Piolat wrote:
On Friday, 27 May 2016 at 09:11:01 UTC, Era Scarecrow wrote:
Hmmm it just occurs to me I made a big assumption. I assumed
that if the CPU supports 64bit operations, that it would be
compiled to use 64bit registers when possible.
On Friday, 27 May 2016 at 09:39:36 UTC, Era Scarecrow wrote:
I suppose there's the requirement to have a register pointing
to this, which then would be mov EAX, this, and then add
lo[EAX], 1...
Nope, still hangs...
On Thursday, 26 May 2016 at 21:13:14 UTC, Era Scarecrow wrote:
To do what I want currently it's something like...
enum Size = 1024, Other = 128;
Data[Size][Other] staticarray; //stack allocation
Data[][] sliced = staticarray[];
scan(sliced, condition);
void scan(ref Data[][] data,
On Thursday, 26 May 2016 at 06:23:17 UTC, Jonathan M Davis wrote:
The difference is that it's impossible to do
10.opBinary!"+"(15), so if you're forced to do
foo.opBinary!"+"(bar) to get around a symbol conflict, it won't
work with built-in types.
Well, that begs the question: Why don't
On Friday, 27 May 2016 at 10:00:40 UTC, Era Scarecrow wrote:
On Friday, 27 May 2016 at 09:51:56 UTC, rikki cattermole wrote:
This is good progress. Using the assembler doesn't have many
documentation examples of how to do things, guess the x[ESP]
example was totally useless on the iasm page.
On Thursday, 26 May 2016 at 16:45:22 UTC, ArturG wrote:
im just playing with this template[1] is there anything else i
missed? (if you dont mind)
it basically treats any T.init as false and skips the
function/delegate and just returns type.
[1] https://dpaste.dzfl.pl/d159d83e3167
If you
On Friday, 27 May 2016 at 10:00:40 UTC, Era Scarecrow wrote:
On Friday, 27 May 2016 at 09:51:56 UTC, rikki cattermole wrote:
struct Foo {
int x;
void foobar() {
asm {
mov EAX, this;
inc [EAX+Foo.x.offsetof];
}
}
}
You have to reference the field via a register.
On Friday, 27 May 2016 at 08:20:02 UTC, Era Scarecrow wrote:
Anyone with inline assembly experience who can help me out a
little? 2 add instructions shouldn't cause it to hang...
Hmmm it just occurs to me I made a big assumption. I assumed
that if the CPU supports 64bit operations, that it
On 27/05/2016 8:20 PM, Era Scarecrow wrote:
Well decided I should dig my hand in assembly just to see if it would
work. Using wideint.d as a starting point I thought I would do the
simplest operation I could do, an increment.
On Friday, 27 May 2016 at 10:14:31 UTC, Era Scarecrow wrote:
inc dword ptr [EAX+Foo.x.offsetof];
So just tested it, and it didn't hang, meaning all unittests
also passed.
Final solution is:
asm pure @nogc nothrow {
mov EAX, this;
add dword ptr [EAX+wideIntImpl.lo.offsetof],
On Friday, 27 May 2016 at 09:11:01 UTC, Era Scarecrow wrote:
Hmmm it just occurs to me I made a big assumption. I assumed
that if the CPU supports 64bit operations, that it would be
compiled to use 64bit registers when possible. I'm assuming
this is not the case. As such the tests I was doing
On Friday, 27 May 2016 at 09:44:47 UTC, Era Scarecrow wrote:
On Friday, 27 May 2016 at 09:39:36 UTC, Era Scarecrow wrote:
I suppose there's the requirement to have a register pointing
to this, which then would be mov EAX, this, and then add
lo[EAX], 1...
Nope, still hangs...
We can't know
On Friday, 27 May 2016 at 09:51:36 UTC, Guillaume Piolat wrote:
On Friday, 27 May 2016 at 09:44:47 UTC, Era Scarecrow wrote:
Nope, still hangs...
We can't know why your code hangs if you don't post any code.
Considering I'd have to include the whole of wideint.d, that is
highly
On Friday, 27 May 2016 at 09:51:56 UTC, rikki cattermole wrote:
Me and p0nce solved this on IRC.
struct Foo {
int x;
void foobar() {
asm {
mov EAX, this;
inc [EAX+Foo.x.offsetof];
}
}
}
void main() {
import std.stdio;
Foo foo = Foo(8);
foo.foobar;
On Friday, 27 May 2016 at 12:26:19 UTC, Andrew Edwards wrote:
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
sound.obj(sound)
Error 42: Symbol Undefined _DirectSoundCreate@12
On Thursday, 26 May 2016 at 22:47:02 UTC, Era Scarecrow wrote:
On Thursday, 26 May 2016 at 22:15:42 UTC, ag0aep6g wrote:
Sorry, I'm still lost. Why can't you do whatever you're doing
in opOpAssign directly there, or in a free function? Does the
pseudo-array contain any additional data? Would a
Another possibility is to use -m32mscoff switch
https://dlang.org/dmd-windows.html#switch-m32mscoff and use ms
toolchain for linking with PSDK import libraries.
On Friday, 27 May 2016 at 09:18:47 UTC, Marc Schütz wrote:
You can do that with arrays, too, without causing allocations:
assert(slice.length < static_array.length);
slice = slice.ptr[0 .. slice.length+1];
Of course that's unsafe, but your pointer magic certainly is,
too.
Initial
https://forum.dlang.org/post/kcr2vn$21i6$1...@digitalmars.com
implib can work for extern(C), but is likely to fail even for
them.
On Friday, 27 May 2016 at 14:48:59 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 14:43:47 UTC, ArturG wrote:
if(value is typeof(value).init) ...
that still requiers a special case for floating points, arrays
and optionally empty string literals.
Have you tried? That should work
I'm writing my own map function modeled after the one in phobos.
(because I feel like it, that's why. good learning experience.)
I've encountered one remarkable difference: The phobos function
accepts arrays and mine does not. I understand why - I'm calling
methods that arrays don't have - but
Hmm... I wouldn't expect this to work, but still worth to report
in bugzilla.
On Friday, 27 May 2016 at 14:56:28 UTC, ArturG wrote:
float f;
if(f is float.init) "float init".writeln;
f = float.nan;
if(f is float.init) "float nan".writeln;
You changed it to a value that isn't float.init, so of course it
isn't going to match!
float.nan and float.init are
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
On Friday, 27 May 2016 at 15:07:50 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 14:56:28 UTC, ArturG wrote:
float f;
if(f is float.init) "float init".writeln;
f = float.nan;
if(f is float.init) "float nan".writeln;
You changed it to a value that isn't float.init, so of
On Friday, 27 May 2016 at 15:11:32 UTC, Rene Zwanenburg wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to
On Friday, 27 May 2016 at 15:18:38 UTC, llaine wrote:
- And how can I minimize allocations?
My previous post still allocates though, through that call to
array at the end. I'm not sure how to completely remove all
allocations (I'm not that familiar with vibe.d), but I strongly
suspect it's
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that I though D was more faster than that. How
is this even
On 5/27/16 9:33 AM, Johan Engelen wrote:
The following code compiles with DMD 2.070, but not with 2.071:
```
module mod;
import std.range;
struct S
{
struct Inner
{
int unique_identifier_name;
int tail;
}
Inner inner;
alias inner this;
auto
Why not to use distribute oprion?
Dne 27. 5. 2016 17:35 napsal uživatel "yawniek via Digitalmars-d-learn" <
digitalmars-d-learn@puremagic.com>:
> On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
>
>> Hi guys,
>>
>> In my journey of learning about D I tried to benchmark D with Vibe.d vs
>>
On 5/27/16 11:49 AM, ArturG wrote:
On Friday, 27 May 2016 at 15:24:18 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 15:19:50 UTC, ArturG wrote:
yes but i have to check for that when some one does
Why? This is no different than if they set any of the other four
billion possible values.
On 5/27/16 1:42 PM, ArturG wrote:
On Friday, 27 May 2016 at 16:56:21 UTC, Steven Schveighoffer wrote:
Why are you expecting it to be?
Won't work for enums with first elements that are non-zero either:
enum foo : int {
bar = 1;
}
foo f;
if(f) writeln("this will output too");
but by
On Friday, 27 May 2016 at 18:03:23 UTC, Steven Schveighoffer
wrote:
I didn't change the default. The default is to pick the first
member and use that as the init value. I may not have even
considered what foo.init might be when I was creating my enum.
-Steve
by default i ment this
enum
On Friday, 27 May 2016 at 17:37:38 UTC, Andrew Edwards wrote:
extern (C) class IDirectSound : IUnknown
That should just be `interface IDirectSound : IUnknown`
On Friday, 27 May 2016 at 17:49:56 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 17:37:38 UTC, Andrew Edwards wrote:
extern (C) class IDirectSound : IUnknown
That should just be `interface IDirectSound : IUnknown`
Thanks for the clarification. That actually compiles but results
On Friday, 27 May 2016 at 16:56:21 UTC, Steven Schveighoffer
wrote:
Why are you expecting it to be?
Won't work for enums with first elements that are non-zero
either:
enum foo : int {
bar = 1;
}
foo f;
if(f) writeln("this will output too");
-Steve
but by default it works you just
On Thursday, 26 May 2016 at 22:15:17 UTC, Basile B. wrote:
gfm doesn't yield a .lib because of this:
https://github.com/d-gamedev-team/gfm/blob/master/dub.json#L22
it should be "library" or staticLibrary or "sourceLibrary"
thus it can't be registered. Bad luck here you've chosen the
wrong
On Friday, 27 May 2016 at 16:08:27 UTC, Kagamin wrote:
On Friday, 27 May 2016 at 15:28:42 UTC, Andrew Edwards wrote:
Have you tried with extern(C) yet?
extern(C) is for undecorated symbold
extern(Windows) adds the _ and @12 decorations (would be
__stdcall on C/C++ side)
The thought never
I need to create an app wide singleton instance for my class.
The singleton is immutable, but I want to allow mutable
references to that singleton object so that I can do fast 'is'
tests.
I declared this
class Category
{
protected static immutable Category instance_ = new Category;
On 5/27/16 4:20 PM, chmike wrote:
I need to create an app wide singleton instance for my class.
The singleton is immutable, but I want to allow mutable references to
that singleton object so that I can do fast 'is' tests.
I declared this
class Category
{
protected static immutable
Additionally, remove QueryInterface, AddRef and Release from the
definition of IDirectSound. Also, interfaces are already
references, so the definition of LPDIRECTSOUND should be:
alias LPDIRECTSOUND = IDirectSound;
Note there should be no *.
Regarding any linking errors, it's easier to
On Friday, 27 May 2016 at 20:20:36 UTC, chmike wrote:
Is this code valid D or is the behavior undefined due to the
cast ?
A mutable object can be synchronized on:
synchronized(Category.instance){}
This will create and store a mutex in the object (sad but true,
design taken from java). If the
On Friday, 27 May 2016 at 14:54:30 UTC, pineapple wrote:
I've encountered one remarkable difference: The phobos function
accepts arrays and mine does not.
add `import std.array;` i think to your module and it should make
arrays ranges
On Friday, 27 May 2016 at 14:46:47 UTC, llaine wrote:
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS all use the path to be
/ the D seems to use
On Friday, 27 May 2016 at 14:59:44 UTC, yazd wrote:
On Friday, 27 May 2016 at 14:46:47 UTC, llaine wrote:
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and the JS
On Friday, 27 May 2016 at 14:46:47 UTC, llaine wrote:
What are you using to do web if you don't user Vibe.d?
I wrote my own web libraries starting back in ~2009ish (well
before vibe.d existed) and still use them.
The modules are in here: https://github.com/adamdruppe/arsd
though I don't
On Friday, 27 May 2016 at 14:48:19 UTC, Daniel Kozak wrote:
On Friday, 27 May 2016 at 14:18:31 UTC, llaine wrote:
On Friday, 27 May 2016 at 14:17:16 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
I am doing something wrong ?
So, the benchmark, the Ruby, and
On Friday, 27 May 2016 at 15:24:18 UTC, Adam D. Ruppe wrote:
On Friday, 27 May 2016 at 15:19:50 UTC, ArturG wrote:
yes but i have to check for that when some one does
Why? This is no different than if they set any of the other
four billion possible values.
What do you mean?
operation on
On Friday, 27 May 2016 at 15:04:31 UTC, llaine wrote:
My level of D is really slow, so can you help me to improve
this? :)
Here's an alternative getCompanies. Untested so it may contain
some mistakes.
Company[] getCompanies() {
auto conn = client.lockConnection();
immutable result =
On Friday, 27 May 2016 at 15:19:50 UTC, ArturG wrote:
yes but i have to check for that when some one does
Why? This is no different than if they set any of the other four
billion possible values.
On Friday, 27 May 2016 at 12:30:50 UTC, Guillaume Piolat wrote:
On Friday, 27 May 2016 at 12:26:19 UTC, Andrew Edwards wrote:
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
On Friday, 27 May 2016 at 15:32:13 UTC, yawniek wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
Hi guys,
In my journey of learning about D I tried to benchmark D with
Vibe.d vs node with express and Ruby with Sinatra.
And the results are pretty surprising.
I have to admit that
On Friday, 27 May 2016 at 15:28:42 UTC, Andrew Edwards wrote:
Have you tried with extern(C) yet?
extern(C) is for undecorated symbold
extern(Windows) adds the _ and @12 decorations (would be
__stdcall on C/C++ side)
The thought never crossed my mind. Tried it and it works like a
charm.
On Friday, 27 May 2016 at 15:48:18 UTC, llaine wrote:
On Friday, 27 May 2016 at 15:32:13 UTC, yawniek wrote:
On Friday, 27 May 2016 at 13:45:23 UTC, llaine wrote:
[...]
you should:
- use this https://github.com/etcimon/ddb Postgres client
- fix your logic
- NOT use option distribute
- use
// Specification from ALURE documentation
ALURE_API ALboolean ALURE_APIENTRY
alurePlaySourceStream(
ALuint source,
alureStream *stream,
ALsizei numBufs,
ALsizei loopcount,
void(*eos_callback)(void *userdata, ALuint source),
void*userdata
)
// My D code, below
On Friday, 27 May 2016 at 20:20:36 UTC, chmike wrote:
The public interface of Category is designed so that the
object's state can't be modified and thus remains immutable.
Then... why cast away immutable?
I suppose there's always a core set of variables that are what
the object actually
76 matches
Mail list logo