Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-24 Thread Max Samukha

On Thursday, 23 May 2013 at 20:19:28 UTC, Nick Sabalausky wrote:

On Thu, 23 May 2013 23:09:54 +1000
Manu  wrote:


On 23 May 2013 22:56, Max Samukha  wrote:
>
> You have module constructors in mixins. How did you solve the
> circular imports problem? Banned circular imports?
>

Pretty much.
I anticipate the problem arising, but it hasn't come up.
The codebase is fairly hierarchical it seems...

I'd really rather not do it with module constructors though. 
There
might be other solutions, like module locals executing 
constructors

or something.



I don't know whether there might be a problem with this 
approach in
your particular situation, but I always try to avoid module 
ctors by

using lazy-inited module-level properties:

// From:
Foo foo;
static this {
foo = ...etc...;
}

>

// To:
private Foo _foo;
private bool fooInited;
@property Foo foo() {

if(!fooInited) {
foo = ...etc...;
fooInited = true;
}

return _foo;
}


A little more boiler-platey, but that be cleaned up with 
mixins. And
then if I need to force init to happen right at start-up, then 
I can

just make sure to "touch" each of the properties at startup.


Problems start when the state needs to be thread-shared.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-24 Thread Max Samukha

On Thursday, 23 May 2013 at 16:30:28 UTC, Manu wrote:


Pretty much.
I anticipate the problem arising, but it hasn't come up.
The codebase is fairly hierarchical it seems...

I'd really rather not do it with module constructors though. 
There might be
other solutions, like module locals executing constructors or 
something.


I see. Ok.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-23 Thread Nick Sabalausky
On Thu, 23 May 2013 23:09:54 +1000
Manu  wrote:

> On 23 May 2013 22:56, Max Samukha  wrote:
> >
> > You have module constructors in mixins. How did you solve the
> > circular imports problem? Banned circular imports?
> >
> 
> Pretty much.
> I anticipate the problem arising, but it hasn't come up.
> The codebase is fairly hierarchical it seems...
> 
> I'd really rather not do it with module constructors though. There
> might be other solutions, like module locals executing constructors
> or something.
> 

I don't know whether there might be a problem with this approach in
your particular situation, but I always try to avoid module ctors by
using lazy-inited module-level properties:

// From:
Foo foo;
static this {
foo = ...etc...;
}

>

// To:
private Foo _foo;
private bool fooInited;
@property Foo foo() {

if(!fooInited) {
foo = ...etc...;
fooInited = true;
}

return _foo;
}


A little more boiler-platey, but that be cleaned up with mixins. And
then if I need to force init to happen right at start-up, then I can
just make sure to "touch" each of the properties at startup.




Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-23 Thread Manu
On 23 May 2013 15:54, Brad Anderson  wrote:

> On Thursday, 23 May 2013 at 03:56:00 UTC, Nick Sabalausky wrote:
>
>> On Thu, 23 May 2013 02:08:15 +0200
>> "Brad Anderson"  wrote:
>>
>>> and one of the games featured prominently was Quantum Break by Manu's
>>> very own Remedy Games.  Any chance the system you described in your talk is
>>> being used for Quantum Break, Manu?  XBox One is x86 and I can't think of a
>>> reason you couldn't be using dmd on it.
>>>
>>
>> That would certainly be interesting to hear. Although unless they've
>> secretly had two AAA games in development, I imagine we can make a
>> pretty safe guess.
>>
>
> Looking at their release history it doesn't look like they work on
> multiple titles at the same time (several years between each major title).
>  Quantum Break doesn't come out until 2014 so I think it's a safe bet to
> say they are using D for a game featured prominently during a major console
> announcement. Very cool.
>

It's awesome that Quantum Break is finally announced!
And super awesome that they saw fit to feature it in Microsoft's Xbox One
unveiling conference, right alongside Forza, Halo and Call of Duty
announcements!
That's a big deal! Unveiling of a new console is massive in the games
industry, it's like, an octa-annual event, and generates a lot of hype :)


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-23 Thread Manu
On 23 May 2013 22:56, Max Samukha  wrote:

> On Friday, 17 May 2013 at 13:28:20 UTC, Andrei Alexandrescu wrote:
>
>> Great talk. Vote up!
>>
>> http://www.reddit.com/r/**programming/comments/1eiku4/**
>> dconf_2013_day_1_talk_5_using_**d_alongside_a_game/
>>
>>
>> Andrei
>>
>
> Nice talk, Manu! You
>
> You have module constructors in mixins. How did you solve the circular
> imports problem? Banned circular imports?
>

Pretty much.
I anticipate the problem arising, but it hasn't come up.
The codebase is fairly hierarchical it seems...

I'd really rather not do it with module constructors though. There might be
other solutions, like module locals executing constructors or something.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-23 Thread Max Samukha

On Friday, 17 May 2013 at 13:28:20 UTC, Andrei Alexandrescu wrote:

Great talk. Vote up!

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


Andrei


Nice talk, Manu! You

You have module constructors in mixins. How did you solve the 
circular imports problem? Banned circular imports?


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-22 Thread Brad Anderson

On Thursday, 23 May 2013 at 03:56:00 UTC, Nick Sabalausky wrote:

On Thu, 23 May 2013 02:08:15 +0200
"Brad Anderson"  wrote:
and one of the games featured prominently was Quantum Break by 
Manu's very own Remedy Games.  Any chance the system you 
described in your talk is being used for Quantum Break, Manu?  
XBox One is x86 and I can't think of a reason you couldn't be 
using dmd on it.


That would certainly be interesting to hear. Although unless 
they've
secretly had two AAA games in development, I imagine we can 
make a

pretty safe guess.


Looking at their release history it doesn't look like they work 
on multiple titles at the same time (several years between each 
major title).  Quantum Break doesn't come out until 2014 so I 
think it's a safe bet to say they are using D for a game featured 
prominently during a major console announcement. Very cool.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-22 Thread Nick Sabalausky
On Thu, 23 May 2013 02:08:15 +0200
"Brad Anderson"  wrote:

> On Friday, 17 May 2013 at 13:28:20 UTC, Andrei Alexandrescu wrote:
> > Great talk. Vote up!
> >
> > http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/
> >
> >
> > Andrei
> 
> Great talk indeed. My favorite so far (if I had to choose).
> 
> Also, Microsoft just had their big XBox One keynote

Pardon the OT, but:

What the fuck?! MS went from their first...to "360"...to **"One"**?

"No, Halo 437 isn't for the XBox1, it's for the XBox One."

Between that and Win8, that's it: now I *know* Redmond has slipped
into the multiverse's "asylum" reality.

First, I thought "Wii" was an unimaginably dumb name. Then I think:

"Holy shit, they actually managed to top it with 'Weeyuu'
, I didn't think such a
level of dumb was even possible!"

And now, the mere following year, Microsoft manages to
out-Nintendo Nintendo itself by naming their *third* Xbox "XBox One"?!?
What the fuck is wrong with these people? Is there *no* sanity left?

I *used* to think "I miss when consoles has *good* names." Now I miss
*that*: the days then they had *merely* generic names, or even merely
*bad* names.

XBox Onefor god's sake...

> and one of 
> the games featured prominently was Quantum Break by Manu's very 
> own Remedy Games.  Any chance the system you described in your 
> talk is being used for Quantum Break, Manu?  XBox One is x86 and 
> I can't think of a reason you couldn't be using dmd on it.

That would certainly be interesting to hear. Although unless they've
secretly had two AAA games in development, I imagine we can make a
pretty safe guess.



Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-22 Thread Brad Anderson

On Friday, 17 May 2013 at 13:28:20 UTC, Andrei Alexandrescu wrote:

Great talk. Vote up!

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


Andrei


Great talk indeed. My favorite so far (if I had to choose).

Also, Microsoft just had their big XBox One keynote and one of 
the games featured prominently was Quantum Break by Manu's very 
own Remedy Games.  Any chance the system you described in your 
talk is being used for Quantum Break, Manu?  XBox One is x86 and 
I can't think of a reason you couldn't be using dmd on it.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-18 Thread Joseph Rushton Wakeling

On Friday, 17 May 2013 at 22:52:19 UTC, Adam D. Ruppe wrote:
The last question in the video was if it would work in Linux 
too, and idk about the rest of their setup, but the C++ binding 
is something I've done before, and the code is virtually 
identical to what Manu did.


That's good to know, as Linux is my platform too and (though I've 
avoided it 'til now) I am always concerned that at some point 
I'll have to bind with C++.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Jesse Phillips

On Friday, 17 May 2013 at 13:28:20 UTC, Andrei Alexandrescu wrote:

Great talk. Vote up!

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


Andrei


These announcements should also be an update through the 
Kickstarter system.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Brad Roberts

On 5/17/13 3:52 PM, Adam D. Ruppe wrote:

On Friday, 17 May 2013 at 22:47:56 UTC, Joseph Rushton Wakeling wrote:

Really exciting to see how D is being used in this context, and the
C++ binding examples are inspiring.


The last question in the video was if it would work in Linux too, and
idk about the rest of their setup, but the C++ binding is something I've
done before, and the code is virtually identical to what Manu did.

I think while the C++ ABI is technically unportable, it actually works
more or less the same way in practice across the major compilers.


Among the posix world, the c++ abi has been well defined for over a 
decade.  The output from every major c++ compiler has been 
interchangeable for a long time now.  Windows and oddball compilers are 
the only hold outs that I'm aware of.  It's a mistake that the D 
compilers are making (and will address at some point in the not terribly 
distant future).


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Adam D. Ruppe
On Friday, 17 May 2013 at 22:47:56 UTC, Joseph Rushton Wakeling 
wrote:
Really exciting to see how D is being used in this context, and 
the C++ binding examples are inspiring.


The last question in the video was if it would work in Linux too, 
and idk about the rest of their setup, but the C++ binding is 
something I've done before, and the code is virtually identical 
to what Manu did.


I think while the C++ ABI is technically unportable, it actually 
works more or less the same way in practice across the major 
compilers.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Joseph Rushton Wakeling
Really exciting to see how D is being used in this context, and 
the C++ binding examples are inspiring.



Just one niggle -- the word "postmortem" makes it sound like a 
study of how something died, whereas this seems to be work that 
is very much alive and kicking!


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Walter Bright

On 5/17/2013 6:28 AM, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


And on gamedev.net:

http://www.gamedev.net/topic/643227-using-d-alongside-a-game-engine/


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Nick Sabalausky
On Fri, 17 May 2013 09:28:19 -0400
Andrei Alexandrescu  wrote:

> Great talk. Vote up!
> 
> http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/
> 

Torrents and all other links:
http://semitwist.com/download/misc/dconf2013/



Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread F i L

Good talk, I've been waiting for this one all week.

I know this was more a talk about interlinking C++ & D when you 
have too, but it's interesting to note that Manu's biggest 
problem appears to be that his engine is written in C++ not D :)


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Walter Bright

On 5/17/2013 6:28 AM, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


https://news.ycombinator.com/item?id=5725745


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Alix Pexton

On 17/05/2013 14:28, Andrei Alexandrescu wrote:

Great talk. Vote up!

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/



Andrei



I cheered when I saw the logo for Visual D pop up (cos I drew that 
version ^^)


I'm so glad I was able to contribute!

A...


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Andrei Alexandrescu

On 5/17/13 11:25 AM, Andrej Mitrovic wrote:

On 5/17/13, Andrej Mitrovic  wrote:

I get an error for the archive link[1]: "The item you have requested
had an error: Item cannot be found."

I guess it hasn't been uploaded to archive.org yet?


It seems to work now.


Just came here to announce that. (Uploading to archive.org is somewhat 
slow and not resumable, so I need to get to an Ethernet connection at 
work to do it.)


Andrei


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Andrej Mitrovic
On 5/17/13, Andrej Mitrovic  wrote:
> I get an error for the archive link[1]: "The item you have requested
> had an error: Item cannot be found."
>
> I guess it hasn't been uploaded to archive.org yet?

It seems to work now.


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Andrei Alexandrescu

On 5/17/13 10:14 AM, bearophile wrote:

Andrei Alexandrescu:


Great talk. Vote up!


I agree, it's quite good for D.



http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/



On the YouTube page I suggest to fix the PDF link to:
http://dconf.org/2013/talks/evans_1.pdf


Oops, thanks. Fixed now. I encourage you all to discuss on reddit. Thanks!

Andrei



Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Andrej Mitrovic
On 5/17/13, Andrei Alexandrescu  wrote:
> Great talk. Vote up!
>
> http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/

I get an error for the archive link[1]: "The item you have requested
had an error: Item cannot be found."

I guess it hasn't been uploaded to archive.org yet?

[1]: http://archive.org/details/dconf2013-day01-talk05


Re: DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread bearophile

Andrei Alexandrescu:


Great talk. Vote up!


I agree, it's quite good for D.



http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


On the YouTube page I suggest to fix the PDF link to:
http://dconf.org/2013/talks/evans_1.pdf



[Page 16] Compiling performed in 2 passes<


With some work on dmd I think this will get even better.


[Page 30] C++ can’t assert the signature matches.  Perhaps a 
template solution is possible?<


Maybe one solution is to write them only once each, on the C++ 
side. Then import the file on the D side and process it at 
compile-time to convert it to the desired code, later mixed in.


Bye,
bearophile


DConf 2013 Day 1 Talk 5: Using D Alongside a Game Engine by Manu Evans

2013-05-17 Thread Andrei Alexandrescu

Great talk. Vote up!

http://www.reddit.com/r/programming/comments/1eiku4/dconf_2013_day_1_talk_5_using_d_alongside_a_game/


Andrei