« first day (236 days earlier)      last day (4698 days later) » 

2:02 AM
Looking at n3290 §15.4/14-15, deallocation functions (not destructors) have a special noexcept(true) by default. A destructor is noexcept if all functions it calls (subobject destructors) are noexcept.
 
noexcept destructors very, very nearly made it in to the Standard
but then didn't
 
But that's actually defined indirectly through exception-specifications. So there's another point of possible breakage, if the empty exception-specification failed to translate to noexcept.
 
I mean, destructors marked as noexcept(true) by default
 
So I tracked it to GCC's std::unique_ptr's destructor not being noexcept, now to check the Draft...
 
oh
your comment above then is hardly representative of the actual problem
 
2:09 AM
Yes, I expanded on that on my last message to Potatoswatter
and what do you know, std::unique_ptr's destructor is not noexcept.
 
Of course, unique_ptr has to call its client's destructor.
 
But isn't there a trait for that?
 
But your minimal case still looks like a bug, right…
 
I'm not sure
 
@LucDanton Well, noexcept( type().~type() ) would do too
 
Xeo
2:12 AM
Argh, I wish you could step through HLSL code...
 
@Xeo: Post it and I'll take a gander
 
But derived classes defeat all of that…
 
@Xeo And you can't even use printf! :P
 
@Potatoswatter And there's std::is_nothrow_destructible to boot
 
Why not just do it the old-fashioned way and define an empty destructor?
 
2:16 AM
Actually my usual way is to declare, and then define elsewhere. I used to default define but this particular snapshot segfaults now. So I guess it's back to an empty destructor indeed.
 
Xeo
@DeadMG ideone.com/CLhuu is the code that seems wrong. We have to implement the Game of Life in a pixel shader, and its really easy AFAICS. My neighbor counting function just seems to fail
 
it would be easier to take the position of the pixel on the screen in as the pixel shader parameter
then draw a single full-screen quad
that would directly give a tex-coord, if you gave the screen resolution as a uniform extern variable
 
Xeo
Or what do you mean?
Also, the framework is already done
 
also, I'm not sure what you're doing with the channels, but I'd set a specific RGBA colour as "alive" (like white) and black for "dead"
 
Xeo
we only need to tinker in the .fx shader
@DeadMG Black == alive, white == dead
 
2:19 AM
well, sure, but there's more logical and less logical ways to do it
oh well, let me take a minute to read this
 
Xeo
I just have that psMean because the colors may or may not be exactly black / white
 
they will be
so I assume that g_sGOLInput is the back buffer, essentially
or rather, probably the front buffer
and what is the output compared to expected?
 
Xeo
> (Bitte beachten Sie, dass die Markierung der Zellen in den gegebenen Texturen möglicherweise nicht 100% Weiß bzw. 0% Schwarz ist)
> In english: (Please note that the cell marks in the given textures may not be 100% white or 0% black)
 
ok
so this is literally just the shaders, you don't control any of the app code at all?
 
Xeo
@DeadMG With my little "debug check" (neighbors > 3) return red, all the input cells that are alive in the input are red
i.e., they would die
@DeadMG I think I could change the app code, but I don't want to if I don't have to
 
2:23 AM
yeah, I don't blame you
why not set the cell's colour to the number of neighbours? normalized, of course
then you can get a nice greyscale image of the output
and you could use PIX to view it frame-by-frame
 
Xeo
white
:D
all cells seem to have 8 neighbors
 
ok
so your neighbours function is just wrong
 
Xeo
Thought so
 
what format is the texture?
i.e., what data type are we getting back from sampling the texture?
 
Xeo
the sampler is wrapping, output is float4
 
2:27 AM
you're a moron ;p
 
Xeo
D:
 
the offsets table is written in screen co-ordinates, but the tex-coords you get back are going to be in texture co-ordinates
 
Xeo
What did I overlook?
...
in my defence: it's 4:30 am here
 
ok, fair enough
you need to know the size of the texture to convert
 
Xeo
We have that
 
2:29 AM
is the texture 1:1 with the screen?
because you can write the pixel shader to take in screen-space co-ordinates of the pixel
 
Xeo
nope, 32x32
 
ok
 
Xeo
> float2 g_vTextureSize; // size of game of life / input texture
 
well, if you have the texture size, then it shouldn't be too hard to convert
 
Xeo
Note: I'm not responsible for the hungarian notation...
 
2:30 AM
just change them to -1 / g_vTextureSize, etc etc
in the offsets table
that should convert them happily to tex-coords
 
Xeo
or rather float2(-1,0) / g_vTextureSize. Lets try that
 
same thing
 
Xeo
hooray for working
 
make sure to credit me, else it's plagiarism
 
Xeo
damn coordinate spaces
thanks
 
2:33 AM
tis cool
 
Xeo
I still can't wrap my head around all of them..
especially the clipping space
 
you don't need to know all of them or even close
 
Xeo
I hate that one
damn 4D stuff
 
just when you pass something to the rendering pipeline, know what it's in
it's not that bad
all you do is (3dpos, 1.0f), multiply by 4x4 matrix, pass on result
problem solved
 
Xeo
Yeah, but I got that bad habit of needing to know how everything works internally
 
2:34 AM
you don't need to know about perspective dividing or anything like that
 
Xeo
I'm knowledge-greedy
So
 
I'm not completely sure why the 4th dimension has to be there either
but it's the same for 2D transformations- they have to step into the 3rd dimension and use 3x3 matrices
 
Xeo
it took me 5 minutes to determine that the exam is super easy and 2 hours to finish it
 
ahem
it took you 2 hours to finish it?
 
Xeo
hey, my code was perfectly working on a 32x32 screen!
 
2:37 AM
lol
yeah, I'm sure it was
I've got an exam starting in five hours and 20 minutes
 
Xeo
And you're still awake?
 
sick
well, that and I was very sick last night, didn't get to sleep until 6am
so actually, I've only been up 15 hours
 
Xeo
:|
13hours for me, I went to bed 4am yesterday and woke up 6pm
 
oh, I only actually got 6 hours sleep
that's sick for you
all my blood tests and my breath test came back negative
except apparently my liver is failing, but since they ran a shedload of tests, then apparently it's likely to be an anomaly rather than my liver is actually failing
that tends to be fatal in rather less than five months
 
Xeo
lol
 
2:43 AM
oh well
I'm feeling pretty fuckin' confident about this exam now
tokenization, syntax and shit? I can do that motherfuckface
if I can read C++, I'll take your Javascript and XML any day
 
Xeo
Heh
I need to get a book on writing a compiler soon
I'm way too interested in that
And it's itching me to write my own little language, just for the sake of it.
 
@Xeo What kind of language?
 
I very nearly wrote a very sexy little languagte
 
And do you mean compiler or interpreter…
 
Xeo
Dunno, something fun. Heck, maybe even an intermediate bytecode
I still have no specifics
but I think I want it compiled
 
2:48 AM
it was statically-typed for maximal speed, had a sexy VM with no operations, and registering stuff from C++ was easy as fuck
 
Xeo
I ultimatly want to find out how compilation of C++ works
 
the trouble with that is that you have to know x86
 
Xeo
I tell ya, I'm way too interested in this language.
 
C++ has a fuck of a lot to ffer
offer
from low-level bit-twiddling, to inheritance and encapsulation, to template metaprogramming
and everything in between
 
Yeah, I recommend compiling to an IR like gimple or llvm-as rather than going right to x86
 
Xeo
2:50 AM
Maybe it's just my natural curiosity. I mean, when I started writing C++ in Visual Studio, I immediatly wanted to understand the internals and didn't hesitate to step into the MSVC headers like vector and stuff
Granted, I didn't understand anything in there for the first few month
 
except LLVM I found was a total bitch to get to work with Visual Studio
@Xeo: I found it quite natural, personally
 
Xeo
But now? I love stepping through the standard headers
 
it didn't take me long to start saying, "But what if I want to take a function that takes ANY argument type?" "Why, DeadMG, now would be an excellent time to introduce you to templates!"
"But I want to construct an argument that stays around so I can pass it to Lua!" "Why, senor DeadMG, here's dynamic allocation!"
 
Xeo
I still don't understand why people would code in C
 
well, at the time, it was a fuckin' huge step forward
but now, it's just ass-backwards
 
Xeo
2:52 AM
If they can have C++
 
I've been contemplating attempting a C++ compiler… to be finished never… it comes down to figuring out the "actual" design intent of the language
 
yeah- there are some implementation problems on very niche embedded platforms
 
Xeo
even if they only use some little templates and overloading, that enough should encourage them to switch to a C++ compiler!
 
not coincidentally, I've been getting into GCC. Which happens to be written in straight C, y'all.
 
Making C++ compiler is crazy.
 
2:53 AM
honestly, I figure that if you want to write a C++ compiler, it would be less effort to design, specify, and implement a totally separate language that sucks less
 
Xeo
Heh
 
@Xeo: It's RAII that's the big killer for me
all the other features, you could have them in C if you really, really, wanted to do it manually
but RAII, you just can't
 
That's what the inventor of D said… much easier said than done.
 
Hell, making C++ parser alone is crazy.
 
@Potatoswatter: D can come back when it's advanced beyond printf formatting
 
2:54 AM
@DeadMG And how many features of C++ are invoked by iostream Hello, world?
 
quite a few
 
Xeo
@Potatoswatter Way too many.
 
better that than printf
 
… but it sure is nicer than printf.
 
especially since most of those features are quite adequately implicitly used
ADL, etc, you don't have to know ADL to use it
 
Xeo
2:55 AM
Though, formatted input / output in the sense of stylistically formatted kinda sucks.
Too verbose
But I recently found Boost.Format
I like it.
 
Funny, I was just looking at the Forth submissions on ideone. That's a language anyone can reasonably write a true compiler for.
 
Xeo
Could only be made better if it parsed string literals at compile-time
 
Forth is a structured, imperative, reflective, extensible, stack-based computer programming language and programming environment. Although not an acronym, the language's name is sometimes spelled with all capital letters as FORTH, following the customary usage during its earlier years. A procedural programming language without type checking, Forth features both interactive execution of commands (making it suitable as a shell for systems that lack a more formal operating system) and the ability to compile sequences of commands for later execution. Some Forth implementations (usually early...
@Xeo I'm sure it will once the compilers support user-defined literals…
 
Xeo
@Potatoswatter Holy sh*t, the possibilities!
 
HAHAHAHA
Forth 200x
boy, doesn't that sound familiar to us C++0x'ers
 
Xeo
3:00 AM
std::cout << "Hi %1%!\n"_fmt % name;
 
I'd still rather take std::cout << "Hi " << name;
 
Xeo
you forgot the newline
 
fuck you
excuse my rather horrific language, ahem
 
Xeo
:)
 
I forgot the "bitch", so I must apologize
 
Xeo
3:02 AM
Oh, and also the exclamation mark
Both in the code and your answer
 
haha
double fail
std::cout << "Hi " << name << "!\n";
fuck you, bitch!
now my life is complete
 
The irony isn't just that templates weren't initially intended to be Turing-complete, it's that metaprogramming is now the defining feature of the language, and there's a kind of competition against the compiler writers to make build times slow.
 
Xeo
@DeadMG Now they have the same count of characters
 
you know what I hate?
my exam questions keep asking questions about specific languages
like
"Did you memorize the Javascript grammar?", effectively
 
lol… I'm glad I didn't study CS.
 
Xeo
3:07 AM
Answer: std::cout << "Fuck JavaScript.\n";
 
well
 
Xeo
Or better, in the output format of that specific language!
 
I think that Software Engineering, things like "Don't use exceptions as control flow", "Use source control" would have been much more what I was looking for
but I didn't even realize that there was a difference and this university does not offer them separately anyway
 
Exceptions are delicious.
 
Xeo
Incidently, I thought of using exceptions to transport "requests" across function boundaries
It's just so nice that they can be handled where you want to :(
 
3:10 AM
I know
 
Xeo
What performance impacts do exceptions have anyways?
 
pretty much nothing until you start chucking them
 
20
Q: Are C++ exceptions sufficient to implement thread-local storage?

PotatoswatterI was commenting on an answer that thread-local storage is nice and recalled another informative discussion about exceptions where I supposed The only special thing about the execution environment within the throw block is that the exception object is referenced by rethrow. Putting tw...

^ performance analysis somewhere near the end of the question, if I recall
about 4000 cycles, and that's a best-case scenario. If you're actually throwing to somewhere, it could be longer.
 
oh shit
that exception thing is fucking amazing
not that he got it to do TLS or anything like that
but you could use it for arbitrary data
 
Xeo
Yep
Fuck return types, I have exceptions.
 
3:13 AM
that's more than a tad crazy and WTF and genius™
 
lol… fuck performance.
 
Xeo
You forgot the TM
 
I mean
can that really be used to pass data where it's not normally allowed?
 
Xeo
You know, the only problems with using exceptions to return stuff is, when you return something nobody expected.
 
heh
 
3:18 AM
Like Spanish inquisition.
 
Xeo
struct Spanish_Inquisition{};

int main(){
  try{
    // nobody expects the spanish inquisition!
    throw Spanish_Inquisition();
  }catch(std::exception& e){
  }
};
 
Lol… there's also boost::any
@Xeo nice
 
hahaha, it actually works
 
Xeo
Are those includes really all necessary?! Wow xD
 
no, not really
I have a blank project for quick play-arounds and it has includes left over from where I may have used them before
but holy shit, why did I never think of this?
 
Xeo
3:22 AM
Heh
Now that's awesome.
The performance will die but it is awesome.
 
oh yeah
you could use it for the window proc for WinAPI
throw the .. window object pointer .. and catch it inside the function
this is the craziest bullshit I have ever seen
and I've seen that template library that lets you draw shapes at compile-time and measure their area and volume
 
Xeo
Analog literals
 
More "unexpected"… ideone.com/XSbFF
 
Xeo
@Potatoswatter Why doublepointer?
 
Single pointers get inspected for inheritance, so the incomplete type is illegal
 
Xeo
3:25 AM
Oh, I see
 
please tell me method to print individual byte of an integer as a Hexa value.
 
Also, because it's not what you expect.
@Janaka std::cout << std::hex << ( i >> 8 & 0xff )
 
Xeo
@Potatoswatter Hehe, good one
 
Hey, have you guys looked at C++11 suspended exceptions? You'll get a big kick out of that…
 
Xeo
Huh?
 
3:30 AM
See §18.8 of the FDIS… I don't think there's a core language extension involved.
It's kinda like perfect forwarding for your wacky data-passing scheme.
 
lol
it's just
so unbelievable
and then some
throwing exceptions up the stack instead of down it
 
@Potatoswatter I need to do it with out using cout (as c style)
 
Xeo
@Potatoswatter Which part specifically?
 
@Janaka Then why are you in this room? See man printf.
 
Xeo
Also, I'm currently reading the part about exception_ptr .. holy shit, exception-type-erasure!
 
3:35 AM
@Xeo I think most of it is pretty ripe for hacking… I didn't even know about nested_exception before, it must be a late addition.
 
Xeo
Damn adobe reader, it's dying on me again -____-
> The class nested_exception is designed for use as a mixin through multiple inheritance. It captures the currently handled exception and stores it for later use.
 
Apple Preview FTW…
 
Xeo
That exception_ptr is pretty badass. I wonder how it works.
 
@Xeo It's inspired from Boost.Exception, which does all that as a library already. I believe it's straight out type-erasure, as you guessed.
I meant that you can peek at the Boost code already
 
Xeo
So it basically is Boost.Any?
Though the implementaton needs to store the actual type somewhere...
 
3:39 AM
@Xeo Occam's razor… Or Alexandrescu's as the case may be.
 
holy shit, man
that's just, just, just, bullshit
impoosible
 
Xeo
What specifically?
 
i funno
well, what I'd really like to know is, how can this mechanism be thread-safe?
I mean, surely, it just boils down to a global pointer anyway
 
@DeadMG The library specifically implements thread-safety by calling pthread_this as necessary.
 
If it's a thread-local pointer, it's thread safe.
 
3:44 AM
no, I meant, the exception thing
that I posed
 
It's essentially a threading API wrapped in a generic language construct.
 
or just exceptions in general, really
 
Since the C++03 standard says nothing about threading, the library is left to figure out how to make it work.
 
Xeo
HOLY SH
This.Is.AWESOME.
 
When I figured it out, first I thought I had this reality-bending hack, and then I realized that I was just accessing something that was well hidden, but specifically put there for that purpose.
 
3:48 AM
well
it's basically thread-local storage, completely type safe and all that shizz, managed for you by the compiler
in C++03, which is pretty sweet
 
anyone willing to answer a stupid question real quick?
 
@yaegerbomb So long as it's quick and stupid. Good questions go on stackoverflow.com.
 
yes that is why im not posting in on there
 
and the question is…
 
well let me upload an image real quick
 
Xeo
3:52 AM
kekeke
Now we just need to think of a good way to put it to use.
 
I think that passing arguments to function pointers is a pretty good use if you ask me
 
I realize this isn't C++ but its not about the language. Would this method be considered a recursive method since it is calling upon itself?
http://i.imgur.com/NTADh.png
 
@DeadMG That was similar to my original motivation. I wanted to pass arguments to stateless allocators.
 
you could throw just before invoking any functions that might cause re-allocation
 
@yaegerbomb Good grief. It's some kind of Unix script, meaning it's on a Unix-like system, but you have no way to get text out of it?
 
3:56 AM
@po
oopps
its bash scripting. It sucks. I hate it. And it works but im not sure if its considered recursion
 
Yes, that's the very definition of recursion.
 
good. then im done with bash forever
 
Xeo
To understand recursion you must first understand recursion.
 
^indeed
 
if you google recursion, it will ask you if you meant to google recursion
 
3:57 AM
Note that recursion is rather different in languages that lack call frames like the C family.
 
Xeo
@Potatoswatter Huh?
 
how, exactly?
 
Sorry, that was ambiguous. The C family of languages has call frames, so recursing creates new local variables.
 
how would that be different in any other language?
 
Shell-scripting languages usually have a global pool of variables, so modifying a local in the called environment modifies it for the caller.
 
3:59 AM
well that's just insane
 
Xeo
That sure must suck.
 
Not insane, just retarded.
 

« first day (236 days earlier)      last day (4698 days later) »