« first day (1014 days earlier)      last day (3932 days later) » 

8:00 PM
@ThePhD okay and what would real use case be?
@Borgleader isn't IO really a solved problem? And will reflection significantly simplify it?
no sarcasm here, I am genuinely interested.
 
What's "a solved problem"
Reflection makes structured serialisation boilerplate-free.
 
^ this, im not sure what you mean
 
@CatPlusPlus something that has tested, well known and wll available solutions
hm, I see, so you want to always exchange some sorts of static data based on C++ types?
 
user142019
I/O is not a solved problem in C++.
 
Sure, we had PIO, then DMA. PATA, SATA.
I/O is a lot of things.
 
8:02 PM
isn't it kinda inflexible?
 
What's inflexible?
 
57 secs ago, by Bartek Banachewicz
hm, I see, so you want to always exchange some sorts of static data based on C++ types?
 
Have you worked with serialised data, like, ever
 
Diamond is inflexible.
But Ruby is.
 
user142019
8:04 PM
It's beautiful outside.
 
I mean, you can exchange structures like JSON or XML, or data of fixed structure
 
Dynamic types are rarely needed in serialisation. Sure, you can use generic stringly-typed dictionaries, but it's always better to work with statically typed models.
 
user142019
@StackedCrooked "X is Y, but Z is."
 
@CatPlusPlus "always"? isn't that an overgeneralization?
 
JSON and XML is presentation and has nothing to do with this.
@BartekBanachewicz Not really.
It makes the code simpler and less error-prone.
 
8:05 PM
in a dynamic language you can build that fixed model in runtime though, right?
 
{"foo": "bar"} and <type><foo value="bar"/></type> are both the same thing, struct type { string foo; }.
 
what's the deal with everyone using 'foobar' in examples?
 
except they also carry the information about structure itself
 
user142019
8:07 PM
I know a guy who had to store a list of objects in memory in C#. He used a List<List<string>> with strings in the format key=value rather than proper objects and properties.
 
@BartekBanachewicz That's mostly useful for consuming remote schemas like XSD or JSON Schema or WSDL or whatever.
 
@CatPlusPlus they carry the structure of, well, structures, as well as parameter names
 
@rightfold Did you finish him off?
 
user142019
@StackedCrooked I rewrote his code.
 
And even then it's still better to generate the types from the schema and use them statically.
 
8:08 PM
hm, that reminds me of ICE library
 
@rightfold lol, I just actually read your message. lol, that's hilarious.
 
I really liked their .slice description files
 
@BartekBanachewicz What does?
 
user142019
@StackedCrooked lol
 
I don't know what you mean.
 
8:08 PM
but why did he need a nested list? just list<string> would work for that?
 
Evening fellas
 
Ell
@ThePhD is your reflection runtime?
 
Oh, the list contained lists of length 2?
 
@Ell Has to be.
 
Ell
@ThePhD howcome?
 
8:09 PM
Because I'm not a compiler vendor.
 
You'd need codegen or compiler extensions to do static reflection in C++.
 
Ell
@TonyTheLion evenin'
 
@CatPlusPlus string { int foo; } can be serialized as 0 0 0 4 in terms of bytes; {"foo" : 4} however has the name foo inside and basically allows you to understand the data without knowing the model beforehand
 
I can't modify the compiler to do stuff it doesn't do. D:
 
@Ell Sup?
 
user142019
8:10 PM
Or use a language that offers reflection instead.
 
that ^ I actually agree with
 
@BartekBanachewicz Well, yes, but that doesn't mean you shouldn't use a model. And it doesn't carry enough data, hence why schemas are used.
 
Ell
@TonyTheLion Not much, just attempting for the 50th time some image recognition for a bot :P
 
user142019
D has static reflection to some extent.
 
Ell
@BartekBanachewicz like... ruby trollface
 
8:11 PM
Fuck Ruby.
 
@Ell use OpenCV for image recognition
 
user142019
And it can read strings from files at compile-time.
 
I'm going to be migrating Rails app into Azure next week.
 
@CatPlusPlus schema doesn't have to have everything, right?
 
It will end in tears.
 
Ell
8:11 PM
@TonyTheLion I am now. I think I'm gonna compare histograms or something
 
user142019
@CatPlusPlus Hahahahahaa. :DDD
 
@BartekBanachewicz What?
 
@Ell fuck, I meant OpenCV not OpenCL, sorry
 
@CatPlusPlus How come you do all this web dev stuff?
 
@CatPlusPlus I suppose that means that Azure isn't that great?
 
8:11 PM
You hate doing that.
 
Ell
@BartekBanachewicz it's okay, I knew you meant that
I read it as OpenCV anyway xD
 
@CatPlusPlus it can have some static fields and a k/v pair list
 
@StackedCrooked Because they pay me to.
 
And nobody will pay you to do C++?
 
@BartekBanachewicz What for ugh
 
8:12 PM
people pay me to program silly little websites ._.
 
@Ell There is some algorithms that can help with image recognition, but they're quite hard mathematically
 
The point of schema is to describe the entire data model.
 
Xeo
@StackedCrooked As if he'd willingly do C++
 
can't remember the names though, been a while since I looked into that
 
@TonyTheLion It's not a problem with Azure.
 
8:12 PM
@CatPlusPlus because for example an object might have 30 properties, but usually only a few of them would not be default?
 
@Xeo He's willingly doing web development.
 
@BartekBanachewicz So?
 
@CatPlusPlus oh, a problem with Cat then?
 
They're still model fields, they just have defaults supplied during deserialisation.
 
@CatPlusPlus you would only want the significant ones, no?
 
8:13 PM
@TonyTheLion No, Rails and Ruby and all that crappy shit.
 
Ell
@TonyTheLion well I feel like I don't need such a complex algorithm, it's a bot for Puzzle Pirates. All the games are tile based so I have the pixel perfect images of the tiles
 
@BartekBanachewicz No.
 
@CatPlusPlus but you have to describe them in serialized format, right?
 
@CatPlusPlus ah. Its funny though how you end up dealing with these languages you don't like so much.
 
If you have a schema, it describes the entire thing.
If you have defaulted fields, you can skip them during serialisation.
 
8:13 PM
@Ell ah right
 
I'm gonna be Crow Plus Plus
 
(Nobody really bothers doing that, because why would you, but hey, you can)
 
@CatPlusPlus so your serialization format has to have a way of setting them to "default" somehow
 
woot ethernet driver installed
 
8:14 PM
@BartekBanachewicz Uh, no.
 
user142019
@BartekBanachewicz yes, absence
 
@CatPlusPlus how is the receiver gonna know that they are not there and he should use defaults?
 
@BartekBanachewicz Because they're not there?
I've lost track what this discussion is about.
 
1 min ago, by Bartek Banachewicz
@CatPlusPlus so your serialization format has to have a way of setting them to "default" somehow
I think I am explaining my questions rather clearly :S
maybe I am not using proper terminology, I don't know
 
room topic changed to Lounge<C++>: Happy SysAdmin Day! [c++] [c++11] [c++-faq] [no-helpdesk]
 
8:16 PM
Schema: foo: int, bar: string = "some default value". Model: class T { int foo; string bar; } Serialised data: { "foo": 42 }. Deserialised data: new T { foo = 42, bar = "some default value" }
 
Ell
@BartekBanachewicz well the receiver knows what the class is, so the absence of a data member means he should use defaults
 
Just realized I should do this.
 
I'm not sure what's difficult here.
 
SysAdmins and IT are evil.
 
@CatPlusPlus yeah, you are using JSON which as I said carries the field descriptors
 
8:17 PM
Shoot them all. With all their... ~~~Rules~~~
 
@BartekBanachewicz The presentation format doesn't matter here.
 
in raw flat binary format it wouldn't be exactly that easy
@CatPlusPlus it has to have that particular feature I was asking about.
 
Xeo
@ThePhD Our SysAdmin's cool
 
Nobody uses raw flat binary format.
 
performance?
 
8:17 PM
@Xeo Well, lucky you. D:
 
(without squiggles)
 
Ell
inb4 purrrformance
 
Perforcemance.
 
user142019
3 mins ago, by rightfold
@BartekBanachewicz yes, absence
 
Protocol buffers.
 
8:18 PM
for large data overhead of JSON can be significant
@CatPlusPlus that's better
 
user142019
I should give Cap'n Proto a try.
 
user142019
It's by the same guy who initially created protobuf.
 
Sure, you can have a crappy custom binary format with reserved fields and shit, if you're weird or something.
 
so, can you combine protobuf with runtime type reflection that @Borgleader and @ThePhD are totally obsessed with?
 
4 mins ago, by Cat Plus Plus
I've lost track what this discussion is about.
 
8:20 PM
lol
 
Ell
protobufs are really awesome imho
 
I think the conversation was originally Bartek trying to understand the use of reflection for IO in C++
 
@CatPlusPlus ok, I'll leave you alone then
 
Ell
I remember someone recommending boost.serialization to me over protobufs because they were apparently overkill
 
Besides, the serialisation format really doesn't matter. If you can't skip a field, you just set it to default during serialisation.
 
Ell
8:21 PM
But protobuf is truly awesome
 
Boost.Serialization's binary archive format is not portable.
 
@ThePhD inspired me to buy some fruit. :)
 
At least wasn't a year ago.
 
@Borgleader if you want C++ classes to describe your model, then perhaps it's apt
 
Ell
the only thing you have to do with protobuf is write the size of the packet
 
8:21 PM
however, I think that something like ICE is by far more useful and easy to use at the same time.
 
@Ell Not really.
 
Ell
@CatPlusPlus Howcome? It needs to know the length of bytes to read if transferring over network, for example
or can it read from a stream?
 
Depends on the transport.
 
@BartekBanachewicz ICE?
 
Ell
@CatPlusPlus well let's say network for example
 
8:24 PM
@Borgleader here
 
Depends on the transport.
 
Ell
@CatPlusPlus tcp :£
* :3
 
@Borgleader TL;DR you use language-agnostic interface definitions and generate C++ headers from them, then implement them like local code. ICE takes care of connecting, reconnecting, discovery, and amazing lot of other stuffs
 
You can just use a high-level protocol that does framing for you, like HTTP.
 
you can send both data and RPCs
 
Ell
8:27 PM
@CatPlusPlus isn't that a bit overkill?
 
Ell
When you are sending messages with protobufs, then surely [size, data] will do
 
HTTP tends to be slow in latency-critical applications like games
 
I cringe at "overkill" being used as much as "bloat".
Ugh
 
Ell
But then you have to run a http server :O
meh, that just seems silly
 
8:28 PM
@BartekBanachewicz Oh it's pimpl kindof no? You'll declare the struct, then you make a class on top of it that contains all the code?
 
Ell
http is for hypertext
 
user142019
Well then use (size, data) pairs whatever.
 
@Ell cat doesn't accept the idea of "too much dependencies"
@Ell not only
 
Better run custom-made TCP server you gotta spend two months working on!
 
@Borgleader well yes and no.
 
Ell
8:28 PM
@rightfold well yeah, that's my point
 
user142019
Five minutes.
 
@CatPlusPlus first spend two months years on reflection mechanism
 
user142019
Also ØMQ. :D
 
@Borgleader it's closer to a real interface, really, except it specifies members. Since it's language agnostic, you can find stuff like sequence<int> in it
@rightfold it's cool, but IMHO ICE is even cooler
 
user142019
dat pun
 
8:29 PM
pun intended.
too bad it's LGPL which means dynamic linking
 
@Chemistpp way to leave
 
other than that, plusgood.
 
user142019
Erlang terms.
 
Ell
@BartekBanachewicz why is that bad?
 
@Ell hassle.
 
user142019
8:30 PM
Damn.
 
Ell
dynamic linking is hassle? :P
 
user142019
Now I want to write Erlang.
 
I think I will build Minicraft on ICE.
 
user142019
David Hasslehoff
 
@Xeo Someone ping me?
 
8:31 PM
@Ell it can be more bitchy than static linking imho
 
Xeo
@Mysticial Aliasing rules
 
lol I'm here
 
@Mysticial apparently you can help me
 
user142019
@Chemistpp ok
 
I had an idea to teach you but you were in the middle of convo and I didn't want to butt in
 
Xeo
8:31 PM
From array of vec3, which is struct vec3{ float x, y, z; }; to GLfloat*
 
@Xeo well, it's not really that struct exactly
 
Xeo
@BartekBanachewicz What else, then?
 
user142019
Copy individual elements and have no problem ever.
 
@BartekBanachewicz I've found that aliasing is almost impossible to avoid when doing manual SIMD.
So you need to know where it matters and where it won't.
 
To really understand optical rotation, the next think you should understand is chirality. Chirality is the idea of handedness.
But it only matters under one condition
chritality only matters in chiral environments.
 
8:33 PM
For example, aliasing across different function calls is safe in all the compilers I use.
 
@Mysticial well I'll skip introduction and ask you if you know if vector<glm::vec2/3/4> will be always properly read as GLfloat*
@Xeo SSE shit, possibly unions, a lot of possible outcomes IIRC
 
Xeo
oh
 
@BartekBanachewicz wth is glm?
 
but in general, 8/12/16 bytes of memory of IEEE format
 
user142019
#define unicorn union
 
8:34 PM
@Mysticial glm.g-truc.net
 
vec2/3/4 is an actual type name?
 
user142019
It's an abbreviation of three different type names.
 
@Borgleader actually it's why it's so fast
 
That's "why is stl so fast"
which is.. weird.
 
8:35 PM
@Borgleader lol wat
 
@BartekBanachewicz Then the normal aliasing guidelines should apply. That is, don't try to alias them in the same function call.
 
@Mysticial fuck.
 
@Rapptz Oh shit, i can answer "because you suck" xD
 
Because your implementation, let's put it openly, sucks compared to standard one? — Bartek Banachewicz 21 secs ago
 
@rightfold too slow
 
8:36 PM
@BartekBanachewicz lol'd. nicely put though. :D
 
On MSVC it won't matter. But GCC will bitch if you try to access it in two different types in the same function.
 
> http://codebin.org/view/3194beca
holy fuck
 
@EiyrioüvonKauyf i.e. a left hand only matters when I try to put on left glove. Well molecules are also handed like this, and so is light (which I don't understand but I think it comes from the angular momentum of the photon particle) so when light passes by an R enantiomer it twists one way, and by an S enantiomer it twists the other way. That's our chiral lesson for the day.
 
Xeo
I love how you know this will do what you want because there was no design team behind it at all. Look at how cluttered and awful the UI is, that's how you know software engineers put this together! — Rob May 1 '12 at 19:23
 
oops
I hit the wrong guy
sorry right
 
8:36 PM
But it's safe to cast to a different pointer and pass into a function. GCC doesn't seem to do aliasing across function calls.
 
user142019
@Chemistpp ok
 
@Mysticial you are saying things that to me sound condracting
 
@Abyx oh god what the hell is that ;A;
 
user142019
Yay installed OS X.
 
@BartekBanachewicz gimme a sec to show an example:
 
8:37 PM
Soddin' mobile web chat. Can't star stuff:((
 
Yeah you can... i think
click on the arrow at the left end of the message
 
@MartinJames you can switch to full version just to star something
you can also star if something was already starred, I think
 
damn the spacing
 
"fixed font" on the right is your friend
 
//  This is safe
void function(double *scalar){
}
int main(){
    __m128d *vec = ... ;
    function((double*)vec);
}

//  This is not safe
int main(){
    __m128d vec = ...;
    double *scaler = (double*)&vec;

    scaler[0] = ... ;
}
 
8:40 PM
@Xeo Yeah, I remember posting it here months ago and naming it the ugliest UI I've ever used.
 
@BartekBanachewicz I did, but it's weird when combined with the reply macro.
 
Xeo
@Mysticial Yeah, that doesn't really work
@Abyx Apart from violating the rule of three, the class looks just like a normal linked list you'd do in class. However, the "method1" function... HOLY SHIT
 
@Xeo yup LOL
 
@Mysticial okey. It is copied directly to the GPU memory for all I know. Anyway, I was mostly asking about std::vector of such vs
 
Xeo
And that guy even used a loop right afterwards!
 
8:41 PM
@Xeo yep, that
 
@BartekBanachewicz Also, it's safe to cast the pointer and access it as the new type as long as you never access it as the old type.
 
@Xeo method2 is similar
 
Xeo
I noticed
ugh
 
@Xeo amazing, huh?
he deleted the Q
 
yup
 
8:43 PM
@Mysticial I am just putting it inside the GL call. I simply don't know if using vector to store my vectors guarantess no spaces between them if they are standard-layout
 
Xeo
@BartekBanachewicz The vector can't insert padding
The type itself can, however
 
:F
the question still stands anyway
 
Xeo
Although it's highly unlikely for just struct X{ float x, y, z; }
 
@BartekBanachewicz There is no guarantee unless they specifically say so. So when I'm aliasing for SIMD, I always do my own struct.
 
8:45 PM
here's our vec3 @Xeo @Mysticial
 
@Rapptz Freaked out, yeah right. More like belated abortion.
 
@BartekBanachewicz And what are you trying to alias it with?
 
@Chemistpp cool :3
 
@Mysticial GLfloat* which is float*
reinterpret_cast<GLfloat*>(std_vector_of_glm_vec.data())
 
@Rapptz That's quite a freakout... Also, how did her parents not notice she was pregnant?
 
8:47 PM
@Borgleader I have no clue
 
@BartekBanachewicz I'd say it's safe as long as you follow my example above and avoid accessing it as two different types in the same function.
 
@Mysticial cool, thanks. :)
 
I think I starred something, but PITA on my S3. Now I have virtual KB on half screen and a huge Vim bottle in the other half.. Fuck this interface.
 
@MartinJames zoom out
 
Specifically you want to avoid this stuff:
 
Ell
8:49 PM
@Rapptz my gosh
 
int main(){
    __m128d vec = ...;
    double *scaler = (double*)&vec;

    scaler[0] = 12.3;
    scaler[1] = 45.6;
    print(vec);  // May not actually print (12.3, 45.6)
}
 
nah, I am not doing that. only pushing raw data further thru C api
 
GCC on -Wall should warn about it.
 
ugh why would you number two examples with one number
 
I found that GCC doesn't always warn about uninitialized member variables. It's supposed to work when using -O1 or higher, but even then it doesn't always work.
 
8:52 PM
seriously.
 
cpx
You guys never seem to rest at any moment.
Oh well but maybe I'm just very lazy.
 

« first day (1014 days earlier)      last day (3932 days later) »