« first day (1806 days earlier)      last day (3144 days later) » 

12:01 AM
@StackedCrooked That doesn't ring true at all for me. Unless, of course, the overload is a match. Then it makes sense that the associated namespace is preferred
 
@StackedCrooked One of the side effects of Clang's development is that we can almost assume that if something like this is defined, somebody will develop an analyzer to enforce it (well, warning about violating it, anyway).
 
> Unqualified name lookup: Starting from the current scope, a name is looked up, escaping into the enclosing scopes and base classes if inside a class. Does not start from a specific named scope. This lookup form stops as soon as it finds a name. So a name in an inner scope (or class) hides a name found in an outer scope (or base class).
^ From Johannes
 
I don't think you can s/scope/namespace/ in that text
Scope would be the namespace(s) surrounding the invocation
 
Well. This is what I have to figure out next.
 
I guess if you place operators at global namespace and that in itself selects them (instead of ADL) then yeah, this allows other namespaces to hide them. But that is very much what you would want to have IYAM (otherwise global scope would not just be evil, but it would be deadly)
I'm curious whether we can have UDT as underlying type in enum class - then perhaps we could associate operators via ADL
 
12:08 AM
I can't believe I just spent a total of 6 hours trying to interpret a line of brainfuck in haskell
... and didn't succeed
fuck this shit
 
Xeo
@sehe nah, only fundamental, integral types allowed. or do you mean if that might be an option in the future?
 
I did it in java to feel better :<
 
Xeo
Whoah man, using Java to escape the harsh reality? Make sure you don't end up in Javaholics Anonymous.
 
they didn't allow C# for it
Java was the closest thing I could pick :(
on the bright side it only took me 10 minutes to write it :D
 
user406009
> Insert elitist Haskell statement
 
user406009
12:10 AM
In all seriousness though, Haskell has a horrible user experience.
 
I wrote so much shit in that haskell thing that it became impossible to read
I'll retry tomorrow or sth
 
Apparently this was a good book back in 2003.
 
@AlexM. Do it in assembly language (or, for extra points, write a Brainfuck interpreter in Brainfuck).
 
@Xeo I was wondering whether it was allowed now. I didn't have high hopes (Concepts could add stuff here ... dream dream)
 
Xeo
You can't even use other enums as the "base" type
 
12:14 AM
@StackedCrooked I like it
 
...where's the weekly "Friday" link from @elyse?
 
> Tiny Three-Pass Compiler
... I think I'll pick Java for this one too then lol
 
@sehe Yeah. It's informative and compact.
 
"bla trumps blo" is the kind of insight that sticks
 
12:15 AM
@Xeo My faith in the right of the fold is restored.
 
@StackedCrooked As originally written, that page wasn't very accurate. The way it stands now, the entire page was basically written by one of the proof-readers.
 
Who was it :_
 
@sehe Next chance you get, look through the list of proof-readers, then take a guess.
 
It'll be you
Or Xeo
I have no clue
 
user406009
@AlexM. Can you use Scala?
 
12:17 AM
I won't ever look at those proof readers. Even if they're published within the book :(
 
@Lalaland nope, just these for this particular problem
 
user406009
Wow
 
I really wish people also translated the problems to C# once translating them to Java
it's not that hard
 
also it seems you cannot use indexers on strings in java haha what
you can't use them on maps either
 
12:20 AM
@JerryCoffin Jerry Coffin!
David Abrahams is also there.
 
user406009
@AlexM. Java doesn't allow you to overload operators.
 
And James Kanze.
 
@AlexM. ~~operator overloading is **harmful**~~
also markdown sucks
 
@JerryCoffin I had it right
 
lol
 
12:21 AM
Did you write that page?
 
@StackedCrooked He could also have been the culprit :)
 
well the more I learn
 
@StackedCrooked Yeah, pretty much.
 
I already learned that java generics don't work with primitive types
so I naturally started with a HashMap<Integer, Integer>
 
user406009
Java generics sorta suck.
 
12:21 AM
@AlexM. Pro Tip: Java is not C++
 
@sehe I was mostly comparing it with C# :D
 
fair point
 
I ordered a second hand copy for $2.5.
 
There's a reaosn people say C# is a better Java
 
When he had it on his web site, he posted a link to comp.lang.c++ (or maybe comp.lang.c++.moderator). The email I sent him going over problems and and suggesting new wording was (as I recall) roughly 23 pages long.
 
12:23 AM
that must have been in the time when emails were written on paper
 
@sehe Nah--chiseled into rocks, but I translated into more modern measurement for your convenience.
 
@JerryCoffin from what I'm seeing in an online copy right now the book is actually quite decent. I might buy a copy so I can tell whether I would recommend it to people
 
Xeo
 
Apparently, John Carmack's idea of detail was everything that wasn't a BSP brush. Oh, the good old days.
 
@Xeo cool
 
Xeo
12:25 AM
The startgoal obviously already being far surpassed
 
@sehe I think it was decent for the type of book it was intended to be. The only problem is that nowadays, that sort of job is (mostly) better handled by something like cppreference.com.
 
True. I don't need books for this anymore. But first time learners might still need a tangible thing
 
@sehe Yup--and for that situation, I think it's about as good as anything you can get, and better than most (with the proviso that I could obviously be biased about it).
 
@JerryCoffin But a book is nice because it attempts to explain rather than document.
 
inb4 '98-'99 game dev (purrformance was based on predominantly using BSP brushes for world geometry)
 
12:31 AM
@StackedCrooked Well, some books do, anyway.
 
@JerryCoffin I had concluded that I was positively surprised before your endorsement (based off the single page Stacked showed, the ToC and some introductory chapter paragraphs)
 
@ElimGarak -1. Needs more saturated colors.
 
@JerryCoffin Tweet @ John Carmack :D
 
E.g. cppreference will document the effect of inline namespaces, but it won't explain why they were invented.
 
@ElimGarak Never! I don't do Twitter, and don't plan to do so either.
 
12:33 AM
> I'd love to see in 1D but what's the point?
he he
 
@StackedCrooked Yeah--and that sort of thing really does require some explanation. Hmm...perhaps I should talk to O'Reilly about writing an updated version.
 
Call it "Effective Modern C++ in a Nutshell"
 
Scott should have called it "Effective C++14"
 
@StackedCrooked I could probably get away with that (I'm at least a couple inches taller and 50 pounds heavier than Scott).
 
Or use a thesaurus.
"Contemporary potent C++"
Hmm :)
 
12:43 AM
"World Domination Through C++"
 
@StackedCrooked We could, perhaps, add other adjectives to the beginning, but I'm betting any notion of replacing "in a Nutshell" with any other phrase would be met with just a little resistance from O'Reilly (unless somebody else published it, of course--in that case using some other phrase would be mandatory).
 
C++ in a ballsac won't go?
 
@sehe I prefer world domination through...y'know...dominating the world.
@StackedCrooked Probably not.
 
@JerryCoffin But "C++ in a nutshell" was already published. So it'd be a 2nd edition then?
 
@StackedCrooked lol
 
12:46 AM
@StackedCrooked Probably. I suppose they might also go for "Modern" or "C++14" or something like that, but "Foo in a Nutshell" is pretty much their trademark...
 
Bar in a Fooshell
 
I'd read another C++14/17 in a nutshell.
 
@ThePhD <3
 
Borgleader!
@Borgleader How was your work week?
Also, welcome home!
 
@ThePhD ty, and not so bad aside from being sick on monday/tuesday (not enough to miss work, but those were shitty days)
 
12:51 AM
@Borgleader The snot-all-over-keyboard kinda days?
 
@ThePhD my nose is a faucet days yeah
 
@Borgleader Well, you're better now. <3
Oh, did I tell you? I managed to get sampler state / rasterizer state / blend state / depth stencil state all working.
So now it's literally just texture 2d. Debating whether to do it this weekend or nexy weekend.
 
@ThePhD nice
 
Totally agree with @gregcons. Stop teaching C. Just leave it to me. http://www.pluralsight.com/author/kenny-kerr 😊 http://t.co/rRiaJPf7Fl
lol
 
@sehe she gave a talk with james mcnellis at cppcon last year didnt she?
 
12:56 AM
@Borgleader Yep.
Kate Gregory or something.
 
@AndyProwl I didn't dislike his talk, but just when I thought the interesting part would come the talk ended.
 
@Stacked I didn't dislike it either, just found the message somewhat less strong than in previous talks, with a very abstract introduction which I could not quite connect to the moral of the story ("design containment relationship"). I should watch it again
Shit it's 6
I won't make it fuck /cc @Griwes
 
@Borgleader she?
 
How can it be 5
 
oh Kate
 
1:01 AM
6
 
@AndyProwl Yeah. I wish it showed some interesting code samples.
 
user406009
@AndyProwl You are talking about Sean's talk?
 
user406009
I didn't find it that useful either.
 
was he here this year?
 
user406009
@Borgleader You still angry about his talk?
 
1:05 AM
@Lalaland No, I wanna see how fast cache friendly code is again :)
All I remember from his talk was: hand waving, and him showing before and after code and glossing over the transformation process which incidentally is the hard part
 
A lot of his talk earlier was "de-virtualizing classes and not having monolithic base objects"
Which IIRC is a lot of what Sean Parent says. But his approach was "C-ify everything".
 
@ThePhD oh and "templates are terrible"
 
@Borgleader I think he literally used the word "bloat"
Which was... pretty hilarious.
 
@Borgleader and ranting about "last minute decision making"
 
@StackedCrooked i dont remember this bit. what was that about?
 
user406009
1:16 AM
@Borgleader He thinks bools inside data is bad.
 
@Borgleader His inability to read a clock correctly?
 
user406009
He says it's better to have two lists, one of each type.
 
ah
although im pretty sure he didnt advocate using lists ;)
 
@Lalaland Bools must be kept segregated, going to schools that are separate but equal to the schools attended by whites other data.
 
@Borgleader he doesn't like if inside functions
 
user406009
1:18 AM
Well, two different vectors.
 
user406009
He would probably have a heart attack if he saw a list in his code. /s
 
@Lalaland See, everybody has at least one good point.
 
@JerryCoffin I have a new answer for your question pertaining to the uses of lists ^ :P
 
@Borgleader E.g. there's was some node class where a method checked if it was root. He hated that. And proposed handling the roots in a separate stage. And then the non-root.s
Also he mentioned loops that read or write to a member variable inside.
 
@Borgleader Sorry, but I don't think "To induce heart attacks..." is going to be accepted (but it might get an up-vote or two).
 
1:20 AM
The compiler is bad a optimizing that. Taking a local copy before the loop and assigning back to the member variable after the loop improved the code.
 
@JerryCoffin For Aprils fools ofc
 
user406009
Wait, so I just rewatched the talk. He recommends manipulating the data format to fit into a cache line.
 
@Borgleader I don't know about you, but I'm sure I'll have forgotten this conversation long before April.
 
user406009
What if you need to perform two different operations on the same data? Each with another "suggested" layout.
 
@JerryCoffin @sehe can remind me of this periodically
 
1:21 AM
Also he mentioned profiling a branch by printing 1 on true and 0 on false. Then you get a file with zeroes and ones which gives you an idea of the branch distribution. And then you can use that information to rewrite the code.
He hated that software is regarded as a platform since obviously hardware is the platform.
 
@Lalaland So do I. If it won't fit to start with, you can usually induce anorexia nervosa with coordinated attacks on its self esteem.
 
"We write games. We know our data."
@Borgleader That's about all I remember..
 
@StackedCrooked Well we do. We can know in advance exactly what data is in the game, where in the level it is etc. I mean, unless you write a moddable game ofc.
 
@Borgleader Funny thing is that lists are used a lot in lock-free code high-performance low-level code.
@Borgleader I write network packet processing software. I don't know the data :(
 
well yes, but its a very specific use.
 
1:24 AM
I should write games instead :P
 
and waste your talent? pff
 
@StackedCrooked I thought it was network packet generating software.
 
@StackedCrooked yeah, lists finally have a legitimate purpose :P
 
@JerryCoffin Yeah. First we generate them. Then they go through the device under test and it comes back to us.
Actually, we do know the data.
@orlp I noticed that C libraries very often use intrusive linked lists.
 
I'm not sure intrusive linked lists are the greatest things ever.
 
1:27 AM
@StackedCrooked Precisely. Not that it's likely to really make a huge difference, but anyway.
 
@StackedCrooked I don't know if I'd consider linked lists in general the same as intrusive lists
 
@ThePhD Can reduce the overhead to a somewhat more reasonable level in some cases though.
 
@ThePhD it can often remove a log n factor
 
@JerryCoffin I thought the overhead would be identical?
 
@JerryCoffin I managed to improve TCP testing so the software never needs to read or write to the payload. While still ensuring correct checksum generation and verification of checksum of incoming packets.
It makes a huge difference in performance.
 
1:28 AM
if I want to associate an object A with another object B I can either make a map A -> B with log n lookup, or intrusively store a pointer for constant lookup
 
@orlp Ooh, that.
 
I'd argue that intrusive lists have many purposes (when designing data structures), and are often underrated if anything
 
I recently read that some routers prefer binary search over hash because the binary search has an upper bound while hash has a bad worst case.
 
user406009
@StackedCrooked Well, aren't you pretty much required to use them for lock-free code?
 
@StackedCrooked hashing is overrated tbh =/
 
1:31 AM
@Lalaland Yeah. Pretty much.
 
@ThePhD Depends on what you're comparing to, of course. For one obvious comparison point, if you use a Lisp-like node with a pointer to the value and a pointer to the next node, then yes, an intrusive list can reduce overhead quite a bit. Likewise, if you have what would have been a tiny node, and you avoid doing a heap allocation, that can reduce overhead quite a bit too.
 
people stare too blindly at the constant time average case
 
user406009
@StackedCrooked I guess the other option is to use binary tree like structures. IIRC the important part is that a linked list is an immutable data structure.
 
people also often forget that for any real purpose log n can be considered constant
 
user406009
And lock-free code is all about transactions, so you have to use immutable structures.
 
1:32 AM
@orlp Yeah. and then do things like make an interface which gives you a list to bucket iterators and get element iterators for that specific bucket and...
 
@StackedCrooked You verify the checksum without reading the data being checksummed? I presume that means you verify that you receive that the checksum is what should have been sent, but without verifying that the payload still matches?
 
@Lalaland this is my gripe with functional programming languages
it limits the construction of data structures
 
user406009
@orlp What? You don't like immutable data structures?
 
user406009
And you can technically use mutable structures through the glory of monads.
 
@Lalaland no
 
user406009
 
in my mind data structures are mutable at their core
 
user406009
Not really.
 
really? you know what goes on in my mind?
:P
 
user406009
@JerryCoffin But why would you ever hold a pointer to the value? Can't you just store the value directly in the node?
 
@Lalaland You certainly can use immutable data structures in creating transactions, but they're equally certainly not the only way.
 
1:35 AM
I implemented the socket so that it becomes a pull operation initated from within the TCP. The Layer5 doesn't write to the buffer but returns the number of bytes it should have written. So the payload is all zeroes. The TCP also asks L5 to calculate the checksum of the payload. This is checksum is also zero. So the final checksum only covers the TCP header + pseudo header.
 
you can construct 'equivalent' immutable definitions of data structures to analyze them mathematically
but that has no correspondence to how they actually work in computers
 
@Lalaland There are times it can make sense. Just for example, the standard way to delete the current node in a singly linked list is to swap the values between the current node and the next node, then delete the next node. If you store large values directly, that can be quite slow.
 
For verification the TCP first calculates the checksum on the header. If that results in zero it also checks if the first and last 8 bytes of payload are zero. If these conditions are met the checksum is considered ok. Otherwise full checksum is done.
 
immutability is a concept exactly opposite of how computers work
 
user406009
I'll admit that is true. Immutability comes with significant costs.
 
1:37 AM
I personally believe that any single paradigm borders on extremism
 
@StackedCrooked Okay--but that seems like it could miss some pretty significant (and obvious) errors, such as all the data coming through as zeros.
 
functional style and immutability have their merit - at the large scope of a programs design
there is no point to constrain yourself to immutability in function bodies
 
user406009
Yes, but you have to admit that immutability makes transactions much easier.
 
@Lalaland yes, but as I said, transactions happen at the big scope of the program
 
@JerryCoffin The software is used to test throughput and latency. Payload is meaningless.
 
user406009
1:39 AM
@JerryCoffin You could make the exact same argument for storing pointers in a std::vector.
 
For example, in Python it's nice that str.split is a 'pure' function that always returns the same result with the same input.
It provides guarantees over what it does
 
Well, unless for the Telnet. But that one is not performance critical.
 
but it's a needlessly painful excercise (not to mention grossly inefficient), to implement str.split using immutable recursive functions
 
@Lalaland You could--and there are places that makes sense too (thus, things like Boost ptr_vector). The big difference is that one of the most obvious reasons for preferring a list to a vector to start with is to avoid copying data around--and having a node contain a pointer to the data lets you avoid that under more circumstances than a node that contains the data directly.
 
I like composable, consistent functions when 'composing' the big picture, but when you get to the details I'd like to go back to von Neumann, please
 
1:41 AM
@StackedCrooked Then why do you bother with verifying the checksum at all?
 
user406009
@JerryCoffin Some people want std::list just for the iterator invalidation guarantees.
 
user406009
(Which IMHO, is often actually quite nice)
 
@JerryCoffin To detect corruption of the packets.
 
@Lalaland swap and pop_back :)
 
@Lalaland That's fine--and if that's what they want, it's easy to get that. That's not the only goal anybody could ever have though.
 
1:43 AM
an often underappreciated technique
(though obviously not relevant if order must be maintained)
 
@JerryCoffin But you have a point that maybe checksum verification could be made optional.
However, outgoing packets must have a correct checksum.
 
user406009
@orlp Doesn't push_back invalidate iterators?
 
@StackedCrooked ...except that some pretty obvious types of corruption won't be detected.
 
Or they could be blocked by routers/NAT etc..
 
@Lalaland I don't recall mentioning push_back
@Lalaland either way, it depends
 
user406009
1:44 AM
Cause push_back is very useful.
 
@StackedCrooked Yes, the packets should obviously be valid.
 
std::deque - no, std::vector - depends on how much you reserve()'d
 
@Lalaland If (and only if) reallocation happens.
 
But if the application sends all zeroes and it receives all zeroes then that's correct.
 
@JerryCoffin even then you're okidoki with std::deque
 
1:45 AM
@StackedCrooked Right.
 
because std::deque should be called std::chunked_list or smt
 
@orlp Reallocation never happens with std::deque.
 
@JerryCoffin semantics :P
 
user406009
Also, orlp, wouldn't your swap and pop_back thing result in holes in the vector?
 
@Lalaland that's what the swapping is for
 
1:47 AM
@Lalaland No--that's the point of the swap. You swap the item at the end with the one you want to delete, then delete from the end.
 
user406009
You have just invalidated the iterator for that end position then. I guess you could manually fix that one up though.
 
it's an incredibly useful technique for when order doesn't matter but you just want a fast collection of items
 
@JerryCoffin I noticed that under heavy usage (many push_back followed by many pop_front) deque gets into a pattern where it keeps allocating and deallocating 4096-byte chunks.
Doesn't mean its performance is bad.
 
You guys might enjoy this article.
 
But I rather have it retain its memory a little longer.
 
1:50 AM
@NathanOsman meh
@NathanOsman low effort low hanging fruit rehashing of old jokes
 
Holy fucking shit
 
@JerryCoffin unordered_deque :)
 
OpenGL texturs are 2 complicated 5 me
I'll do this after I talk to @ElimGarak.
 
@NathanOsman (no offense)
 
@orlp deque is not a list. it's an array of arrays.
 
1:51 AM
@StackedCrooked It's entirely possible to avoid that, but it's up to the implementation.
 
@StackedCrooked that would at some point have to reallocate
 
@orlp Hmm... I'm certainly not offended. I just didn't think they were common jokes.
 
@StackedCrooked oh I'm a tard
nevermind
it doesn't have to reallocate the data
 
@StackedCrooked It's an array of pointers to arrays.
 
just the bookkeeping
 
user406009
1:52 AM
So std::vector<std::vector<>>.
 
either way
I definitely believe std::deque has it's merit
 
Recently I've switched to dynamically growing boost::circular_buffer. Before push_back you check if capacity is full, if yes set_capacity to 2 * capacity. Or you can also use the space-optimized variant and give it a very high max capacity.
 
I just don't think it should be called deque =/
 
@orlp ...damned little with Dinkumware implementation though (with objects over a certain threshold, it ends up with only one item in each block, and that threshold is pretty small--only 16 bytes IIRC).
 
and then there's always devector :)
although I should really finish that implementation some time =/
exception safety just becomes insane though =/
 
user406009
1:55 AM
devector? What would have been the objective?
 
Ell
Hi guys
again, I'm more glad you said no to power hour
 
@Lalaland a vector with fast appends on either end, yet maintaining contiguous storage
 
@Ell You're welcome.
 
@StackedCrooked classic CS 101 question
'implement a queue with two stacks'
 
user406009
1:57 AM
But he's not doing that. He's implementing a queue using a ... queue.
 
@Lalaland no, he's using stacks that have been erronously stored in variables with 'queue' in the name
 
user406009
@orlp I see. Sorta like a vector, but expanding in both directions.
 
user406009
@orlp Read the code. Those are not stacks.
 
user406009
He's pushing to the back and reading from the front.
 
You can emulate pop_front from a vector using decltype(T)(std::move(vec.front())); front_offset++;
@orlp cool
 
1:59 AM
oh
 

« first day (1806 days earlier)      last day (3144 days later) »