« first day (448 days earlier)      last day (4724 days later) » 

00:09
makes sense to me
the Standard basically knows in advance that vector<bool> is just a blob of binary bitfields
it has no invariants, no higher meaning, just a bunch of bits
but if I say std::vector<std::string>, then WTF is that even supposed to be?
because what you're talking about is does { "aa", "bb" } hash to the same as { "bb", "aa" } and such things
@DeadMG They implimented operator< and operator== for the containers, I don't see how hash is all that different.
@DeadMG wait, yes I do, if it's standardized you can't customize it. Gotcha
I didn't think they had those operators except for ==
@MooingDuck You can always customize. All you need to do is change hash functions.
@DeadMG I could have sworn....
vector on MSDN mentions no comparison ops
00:17
@DeadMG § 23.3.1 in the standard, msdn.microsoft.com/en-us/library/691s080z.aspx on MSDN
@DeadMG it's in the header, not the class, makes it trickier to find
The general container requirements require a == b to work for containers a and b of the same type.
@RMartinhoFernandes so it seems silly to me that they didn't make (nearly) everything hashable then.
I would have left them undefined
@DeadMG why?
00:19
because
let's say that I have vector<Matrix>
if I multiply together the matrices in order, I might get the same results for two vector<Matrix> even if they are, for example, different sizes
But equality compares sizes first.
exactly
that's the problem
"let's say I want to shoot my leg"
the point is that vector<T> has no meaning unless you know what T is and the context in which the object is being used
If you're not happy with the collisions in the standard implementation you can write your own.
@DeadMG Oh, I think I agree with that.
00:21
so pretending that you know whether or not they're equal is silly
because you don't
I still can't wrap my head around the idea of a vector being a key.
me neither
Much less a container with actual structure.
@DeadMG I don't follow (of course). Why can't can simply be a boost::range_hash of the elements? You'd get different results as often as anything else.
@MooingDuck I just gave an example of why.
00:22
@RMartinhoFernandes I've seen several questions asking for std::hash<std::pair<X,Y>>
if I use vector<Matrix> to represent a series of transformations, then they are equal and should be equal, and should compare equal and hash equal, if the final transformation matrix is equal
@MooingDuck I don't count pair as a container (and neither does the standard).
but that doesn't mean, at all, that they took the same route to get there
@DeadMG then use a custom hash.
@RMartinhoFernandes there's no hash for most of the types in the standard, including pair, container or no
yeah, I got that far
the point is that there is no meaningful default
00:24
I think it's a good thing that there are no hashes for everything around.
I have experience from .NET and Java.
@DeadMG It has no more meaningful default than operator== and operator< do.
which also don't have meaningful defaults
Where people just stick the thingies in the Dictionary and the wonder why it's not working.
and IMO implementing (and requiring) them is a defect
@DeadMG and yet I use them all the time to compare the elements.
00:25
that's not really at all relevant
operator== for containers is based on std::equal.
a meaningful default would be good in most situations
you've only said that they're good in some situations
@DeadMG I don't see how there's no meaningful default. It compares each of the elements. If you want something else, do something else.
or even just a couple of situations
RARGH
stop talking!
00:26
go re-read what I just wrote!
@MooingDuck It doesn't work on unordered_maps btw.
just because it has a default behaviour doesn't mean it's a good default behaviour
@DeadMG doesn't seem fair to ask me to stop talking and then continue your side of the debate :P
you can resume talking when you've read and understood my point
right now I feel like I've said the same thing six times and not gotten anywhere
@DeadMG in all our conversations this happens, but I'm still unsure if you're a bad communicator, I'm a bad listener, or we just speak differently.
00:29
or maybe there is just lag
it wouldn't be the first time that messages which appear in one order to one person appear at different orders, or not at all, to another
It could just be that the committee does not want to give the idea that everything is fine for a key.
so it could well be that you literally read a different thing to what I've written
And hash_combine should have been in.
@RMartinhoFernandes I could believe that they learned that from Java even if I don't know the details.
that would be hilarious
Java learns sweet fuck all from C++, and then C++ avoids Java's mistakes
00:33
Anyway, if I find a map with vectors as keys in my code, it needs refactoring.
That vector thing needs a class.
(Yet I still need the ability to hash vectors, and that would have been easier had hash_combine been in)
this class will use operator>(C lhs, C rhs) { return lhs.v > rhs.v; }
@RMartinhoFernandes that (which will wrap vector, which was a key of map)
I can't find operator< or operator> for vectors. Anyone mind giving me the paragraph number?
00:37
@Hubrid (be careful with DeadMG, I made him mad)
"Beware of dog"
@RMartinhoFernandes § 23.3.1. in the header file, not the class.
@MooingDuck I was looking for the semantics :)
(It's also in 23.3.6 together with the class introduction)
@RMartinhoFernandes I closed the file a while ago. I don't recall seeing semantics. I can never find stuff though.
The description of the containers library is hard to navigate. This are strewn all over the place between "general requirements", "slightly more specific requirements", and "very specific requirements". It's annoying.
@MooingDuck You close the file?
Wow.
00:41
fclose
Ah, found them. Table 98.
@RMartinhoFernandes I habitually close windows I think I won't need again soon. I'm always wrong but I can't stop
Yep, doesn't seem to work for unordered_maps either.
@RMartinhoFernandes what doesn't seem to work?
@MooingDuck operator== and operator<. They depend on order.
00:45
@RMartinhoFernandes yeah. operator== compares all the elements in order. That should work for unordered_map.
@MooingDuck How come?
@RMartinhoFernandes wouldn't expect a operator< for a unordered_map though
It only works if you use the same object.
@RMartinhoFernandes operator== on unordered_maps?
If I build two unordered_maps from the same data, they may not iterate on the same order.
@MooingDuck Yes.
00:46
I dislike semantic analysis
@RMartinhoFernandes you're right. I hadn't thought of that. The other containers (non-unordered) all have a well-defined order though.
So operator== for unordered_map is either not required, or pretty much has reference semantics.
Which is crap.
@RMartinhoFernandes what's the standard say?
I want to discover that it's not required.
what am I gonna do, start including the LLVM headers into my parser code?
00:47
@RMartinhoFernandes I'm looking
@MooingDuck General container requirements say it's like a call to std::equal.
@RMartinhoFernandes it's totally there :( I agree that for unordered containers it definitely ought not be.
Wait, it's worse than reference semantics.
@RMartinhoFernandes yeah, it is
It's like reference semantics, but you can't even trust it to be have reference semantics.
Because you can build different maps from the same data, and they luckily end up comparing equal.
Ah found it!
> Unordered associative containers conform to the requirements for Containers (23.2), except that the expressions a == b and a != b have different semantics than for the other container types.
§23.2.5p2
00:51
@RMartinhoFernandes where's the rest of it? :(
@MooingDuck Paragraph 11.
Like I expected, it's a mess.
And O(N^2).
"worst-case complexity remains O(N2), e.g., for a pathologically bad hash function"
that's worst case though. Average case should still be fast
It's certainly messier and slower than the others. It involves hashing a lot of things.
std::hash(thing) {return 0;}
00:55
if I use a memory arena, which I am, then PIMPL shouldn't be so bad
no wasteful new
lol
Also, they don't conform to the optional requirements in table 98, so no operator<.
@RMartinhoFernandes makes sense
Container requirements are crap. Every container just picks what they want to conform to.
@RMartinhoFernandes yes
There should be a list of real container requirements.
00:57
@RMartinhoFernandes I would be happier if their interfaces were more similar, slow or not. Maybe tags to let you know which functions were slow. Iterators too.
so
Step 1: Clean up Bison code and refactor the Parser class and the AST listings
Step 2: Ditch Collater class and collate the AST directly
Step 3: Profit
he thinks
Sounds like a good plan, but it's missing a 2.5. ??? step.
lol
You can't jump directly to profit.
sure you can
Step 2.5: goto Profit;
01:00
And then raptors.
aaargh, my innards
A raptor is eating your guts?
yes
yet somehow, I find the remaining strength to not punch the raptor in the face or poke out it's eyes, but to type about it in a random Interwebs chatroom
You could multitask.
true
but that's not very Manlyâ„¢
also, I appear to have accidentally cut my nested comments code
01:07
It's not really that important.
meh
I lieked it
But it makes your lexer context-sensitive! (Is there even such a thing?)
actually, it only puts it in the realms of PDA
Yeah, you're right. Silly me. It's still a long way from being CS.
and I made it into the hardware stack as the stack of the PDA, so I think it'll run just fine
01:09
Designing a language like that would truly be an achievement in fail.
return (MakeEquality(L'/') >> MakeEquality(L'*') >> *( !(MakeEquality(L'*') >> MakeEquality(L'/'))  >> (multi_line_comment() || opt) >> eps) >> eps >> eps)(begin, end);
no, wait, wrong place
fixed
looks like boost.spirit or xpressive, same unreadable thing
I can read it just fine
sure
Hm, D's arrays are quite rich. Enough learning. Eating corn now, and then reading Crichton.
01:12
@FredOverflow What you're (going to be) reading?
"First a forward slash, then an asterisk, then whilst (not an asterisk and then a forward slash), {recognize possibly another multi line comment, and consume the next character}, then consume the two ending characters".
@RMartinhoFernandes Prey, the novel about nano-technology. I read it last year as paperback, now I have the (forgot the word... more expensive) edition. Way more fun to read.
@DeadMG You don't have a function that takes a string?
@FredOverflow Hardback.
@RMartinhoFernandes Wut?
@FredOverflow I liked Prey a lot
I learned recently that hardbacks cost the same as paperbacks to print. That annoys the hell out of me.
01:14
@RMartinhoFernandes I think it's "Hardcover", isn't it?
@FredOverflow "Hardback" in English
paperback and hardback
lol
A hardcover, hardback or hardbound is a book bound with rigid protective covers (typically of cardboard covered with cloth, heavy paper, or sometimes leather). They may have flexible sewn spines which allow the book to lie flat on a surface when opened, although most modern commercial hardcover books have glued spines. Hardcover books are usually more expensive then their paperback counterparts. Hardcover books are often printed on acid-free paper, and are much more durable than paperbacks, which have flexible, easily damaged paper covers and glued spines. Hardcover books are also margi...
@DeadMG I'm a total Crichton fanboy. Read all his "techno thrillers" except the latest one which was published after his death.
@FredOverflow Also valid.
01:15
@FredOverflow I read many, if not all of them, but I forgot many of them
he was publishing since before I was born, I think, and read most when I was a lot younger
@RMartinhoFernandes How can that be? It's bigger pages, bigger font, more pages...
@DeadMG Have you read Jurassic Park? It's so much better than the movie, especially the second one.
@FredOverflow Well, assuming all other things equal (not all hardbacks are bigger than the paperbacks).
I still like to watch the first movie, though :)
@DeadMG I mean return (MakeEquality(L"/*") >> *( !(MakeEquality(L"*/") >> (multi_line_comment() || opt) >> eps) >> eps >> eps)(begin, end);. I think it would be a bit more readable.
@RMartinhoFernandes Most paperbacks I own aren't really fun to read. You have to split the pages very hard to be able to read the entire line.
01:18
Doesn't seem to match /*/**/*/. Is that intended?
you still have the supporting source code?
@FredOverflow Yeah, some are very annoying. But hardbacks are so much more expensive.
@DeadMG I have all your code here (well what you last pushed).
yes, I expect you do
@RMartinhoFernandes Not if they're old and used. I get them 2nd hand for 1 cent plus 3 Euro shipping at amazon. And for some reason I love used books!
well, it should match /*/**/*/
01:20
@FredOverflow Ah, I see. Sadly, I can't live without my books looking new. It's not something I can fight :(
because the eps consumes the next token without checking it
the eps eats the second closing asterisk
@RMartinhoFernandes Oh, most of the times the books are just fine, maybe a little spot on the cover or something. Nothing to lose sleep over.
return (MakeEquality(L'/') >> MakeEquality(L'*') >> *( !(MakeEquality(L'*') >> MakeEquality(L'/'))  >> (multi_line_comment() || eps)) >> eps >> eps)(begin, end);
try that
The Andromeda Strain
The Terminal Man
Congo
Sphere
Jurassic Park
Lost World
Airframe
Timeline
Prey
State of Fear
Next
^ Crichton novels I've read so far
@DeadMG Oh, I seem to have fucked up the parentheses with my transformation.
01:23
well, this specific code should go with a std::wstring::iterator
I use a const wchar_t* in my current iteration, which is obviously close enough
@DeadMG: Have you read the "Crichtonesque" novel by that Microsoft guy?
@FredOverflow No?
Zero Day by Mark Russinovich
If you like Crichton, you'll probably like that as well.
Anyway, back to bed it is :)
night
01:28
you know, I'm re-considering using my own recursive descent parser
Bison's ... incompatibilities ... with C++ are irritating
concurrent_queue doesn't have a clear()?
it would be easier and faster to maintain the code if I didn't have to reduce everything to a C API
yes it does
@DeadMG I'm sorry man, I still don't get it. I feel like if two sequenced containers(vector/list/map/etc) have elements that compare equal in the same order, the containers are "equal" for the general case. For unordered containers(unordered_set/etc), if each element in one is also in the other, they are "equal" for the general case. Although I admit operator< has no meaningful default.
there's a bug in concurrent_queue
@DeadMG Deja vu?
01:30
actually, you must have missed it
@DeadMG Then why do you loop through to work around the bug?
because try_pop doesn't have the bug
Ah, the bug is in clear.
in my university machine, the bug doesn't exist
01:30
only on my home machine
so I must have failed to update it correctly or somesuch like that
I gather you're going with "one module per file". Am I right?
I should really make a proper wrapper to guarantee success, but I don't expect to be needing the fix again
do you mean a C++ class or a WideC module?
no
that's what the Collater class is for
to glue them together
01:33
but it's soon to be eliminated
You could just add one more node to the tree.
what do you mean?
Add "Modules" rule that is a sequence of "Module"
why would I do that?
01:35
Avoids the need for collater?
no
the parser parses many files, in parallel
and modules may be introduced repeatedly within the same file, for example
the need for the collater is fundamental to the design
@Xeo Ah, you took the easy challenge. Do it in Java now.
the way I'm going to eliminate it is simply by doing it's work in-place on the AST
Ah, I see, it's there to merge the module parts.
Xeo
Xeo
@RMartinhoFernandes Java sucks, so no.
01:36
@Xeo Wuss.
Xeo
Xeo
@RMartinhoFernandes Also, I think the same trick the C# guy uses should work, no?
@Xeo Ah, possibly.
although I'm not too sure how I'm going to handle some constructs which Bison appears to not have a problem with and I've got no idea why
must be that LR magic
Xeo
Xeo
Bison > DeadMG
nah
LR might be a great theoretical algorithm, but it has it's limitations
that fucking POD restriction, for one
and two, unlike LL, it can't be converted to use the hardware stack as it's "stack"
it needs an explicit, separate, heap-allocated stack
that, in my opinion, is a rather large fundamental limitation on what LR can do in terms of raw performance
that, plus the fact that it can produce some fucking unreadable output and code
and it's interface is ... questionable
01:43
I agree with Xeo. Bisons are bigger than puppies.
mmh
bison > dog
I'm fairly sure that my code is effectively an LL and LR hybrid anyway
puppies will chew anythin
01:45
photoshop
the proportions on them are wrong, especially the left one
btw robot, did you check my updated nested comment code?
27 mins ago, by DeadMG
return (MakeEquality(L'/') >> MakeEquality(L'*') >> *( !(MakeEquality(L'*') >> MakeEquality(L'/'))  >> (multi_line_comment() || eps)) >> eps >> eps)(begin, end);
This one?
yes
and?
01:50
Looks fine.
awesum
anyway, I realized I was being completely idiotic about my previous statement
I can parse those things just fine
@DeadMG Nothing new, then :P
roflcakes
mmm... cakes
Btw, I like your comment style.
what comment style?
01:53
// It was already inserted! Now we can happily read it to our hearts content, and modify the contents, verify it, etc.
heh
Most people would probably write // already inserted.
@RMartinhoFernandes somebody misspelled sock puppets
did you like my yylex trick with Bison?
01:54
Haven't looked at the bison parts yet.
bison calls a free function called yylex to get it's token information
Xeo
Xeo
Look at the compile time xDD
but I cheated and defined it as a std::function instead, then gave it a lambda
Xeo
Xeo
Oh wait, it doesn't show that. :s
> 3 minutes 23 seconds ago
result: compilation error
Xeo
Xeo
01:55
Was when it finished
for sum(1..10000)
@Xeo Just wait a few days!
:P
@DeadMG As would be expected.
Xeo
Xeo
@DeadMG That's the desired behaviour
oh yeah#
ok
Xeo
Xeo
I wonder how long Clang would take
@Xeo Gosh, that's awesome.
01:57
I definitely have the power of LR within me, so fuck you Bison, I hate your union shit, and it's time for me to get a new parser
lol "the power of LR within me".
I've Got The Powerâ„¢!
Xeo
Xeo
Let's see how long Comeau takes
imagine my nerd arms shaking with pure energy!
Xeo
Xeo
Anyone got a Clang copy handy?
01:58
ok
I had the power
Xeo
Xeo
lol
but the nVidia display drivers decided that displaying it was too much
and crashed
@Xeo on gcc 4.6.1 64bit: real 0m1.433s
my code: so awesome, the display driver can't render it
Xeo
Xeo
01:59
@sehe Nice, what are your specs?

« first day (448 days earlier)      last day (4724 days later) »