« first day (2260 days earlier)      last day (2685 days later) » 

9:02 PM
Yeah probably
Would you say the code on that project is good?
 
Dunno, probably not
Haven't touched it for a year
 
What blew me away is the fact that this project actually has 301 commits.
How did that happen?
 
Ven
writing code
 
It's quite a few though, isn't it?
I mean, maybe it isn't, I don't know
 
@набиячлэвэли Who cares. Best gams on earth is much more interesting. :-) [Oh damn! There I go being sexist again!]
 
9:07 PM
@EnnMichael 75/month
2.5 per day
easy
 
Hmm ok :D
 
@EnnMichael http is at 65 over 10 days
 
struct {
		std::chrono::milliseconds between_frames;
	} graphics;

	struct {
		int time_between_lines;
} credits;
Okay, I fucked up the formatting
Sorry about that, should have just sent a link to the file
 
It's spelled "fucked"
 
...What do you think about these anonymous structs?
And inline object declarations.
 
9:10 PM
They make nice shit happen
like allowing for categorising config options
 
@EnnMichael they are not well indented
 
Really?
I didn't quite notice
 
@LoïcFaure-Lacroix They're indented properly
 
They seem fine to me, too
 
But he can't copypaste so
 
9:13 PM
Shhh
 
@EnnMichael I missed that message
 
I think anonymous structs and inline declarations are kinda bad
 
Reason
 
And those are not anonymous structs
 
9:14 PM
They don't have names
 
they're named graphics and credits respectively
 
...no, those are object names
The structs themselves are unnamed
 
SO WHAT?
THEY DON'T NEED TO BE
 
I know
 
THEY ARE BETTER LEFT UNNAMED
 
9:15 PM
Why?
 
why are you shouting
 
@EnnMichael Some poor struct is a victim of identity theft, and you think that makes it bad. How dare you?
 
heh
 
not sure if troll or
 
@набиячлэвэли I'm not a puny little troll. I'm a mighty Balrog!
 
9:17 PM
Not you I know you
 
Well... Here's the thing. Inline declarations are awful because they're so unreadable. Also, anonymous structs are bad because they make it really difficult to declare functions having parameters of those structs (I believe the two only ways are decltype and templates).
 
That Enn thing
 
No I am being dead serious
We're just talking
 
> they're so unreadable
are not
> they make it really difficult to declare functions having parameters of those structs
exactly the point
they store DATA
 
What?
 
9:18 PM
@EnnMichael which is why you don't use them as function arguments, except when passing them to template functions
 
you use the DATA thereinfrom to do stuff
not them
 
It's not like you forbid someone to make a function taking a parameter of this type
 
they're just the means to an end
@EnnMichael Well yes
also exactly the point
you either pass/get the whole package configuration deal
 
Hmmm, okay
 
9:19 PM
Right, okay.
@набиячлэвэли Also then, why are they structs and not just normal variables? Like,
std::chrono::milliseconds graphics_between_frames;
int credit_time_between_lines;
 
BECAUSE YOU CAN'T READ
11 mins ago, by набиячлэвэли
like allowing for categorising config options
 
Okay okay jesus chill the fuck out
Just asking
 
Asking the same thing for the fifth time
 
...You're not categorising much though
 
And not understanding anything
And you're not thinking much
 
9:25 PM
Ayy
(You hurt my feelings)
 
We're nice :o
 
To people who are not idiots, quite
 
Dude
 
I'm not your dude, bro
 
I'm not your bro, dude
 
9:27 PM
I'm not really a dude, bro
 
@EnnMichael You clearly don't have the mental capacity to understand the message even when it's laid out right in front of your eyes
@Morwenn I know
 
@набиячлэвэли I know you know
 
For how long are you going to advance on this
Dude
 
@Morwenn Now I know you know I know
 
@набиячлэвэли Now now...
 
9:29 PM
@набиячлэвэли I was just asking, you don't have to insult me
Telling me things I'm already aware of, I just don't like to be reminded
 
I don't have to but you deserve it so I did
You certainly don't make an impression of someone who knows things
Even after being told them for the fifth time
 
That's because I don't know things
 
...even after being told them for the fifth time
 
Yes
Precisely
 
OK, this is ridiculous. My brother has bought XCOM2 just today or yesterday. FML.
 
9:32 PM
@набиячлэвэли But also please don't act like you're definitively right. If these were named classes you wouldn't be much worse off, and you'd avoid the ugly-ass syntax
 
Like... I can't buy him a gift that he would not buy immediately himself just hours later.
 
@EnnMichael If what was classes?
> ugly-ass syntax
a) it's not, b) opinion
 
@набиячлэвэли I have had Master of Orion as a gift prepared and he bought it. I bought XCOM2 instead and he bought that too!!
 
9:34 PM
Oh shut the fuck up, Bjarne himself said that syntax was just inherited from C and shouldn't even be there
 
@wilx That just means you have knowledge of your brother
@EnnMichael u2thanks
 
@набиячлэвэли I can see his wishlist on Steam. I just did not expect him to buy shit right before Xmas.
 
@EnnMichael I can't hear you over your preferences and opinions
@wilx Maybe he's gonna gift it to you xD
 
@набиячлэвэли That would not show in a list of his games, AFAIK.
 
@wilx Yeah, probably not
 
9:36 PM
@набиячлэвэли Can I ask you something
 
@wilx People shouldn't be allowed to buy shit for themselves before Christmas.
 
@EnnMichael You just did
 
@Morwenn I totally agree.
 
Well, I totally bought myself a mug, like one hour ago, but sshhhh.
 
9:37 PM
@EnnMichael But go ahead
 
Why did we have to end up arguing by the end of this
I didn't have that intention
 
We didn't do anything
 
> Lounge<C++>
 
also that yes
 
@Morwenn but what if nobody is going to give you anything?
 
9:39 PM
@LoïcFaure-Lacroix That means you don't deserve anything, so don't buy it by yourself either :D
 
@Morwenn no it doesn't mean anything
 
Please don't give serious answers D:
I'm hungry.
 
@Morwenn Sorry, you're not allowed to eat until Sunday night (unless it's given to you), just in case somebody wants to buy you food.
@EnnMichael Look at it from the other direction for a moment. If you're going to use a struct in a way that doesn't require a name, why should you be forced to make up a meaningless name you're never going to use anyway?
 
Right, you're correct
...My logic was that, if you can't name it, you're making a mistake
If it doesn't have a name, then what does it do?
What is it for?
Am I talking nonsense?
 
10:03 PM
@EnnMichael Nonsense? No, just not looking at every possible use case.
 
for instance, say you want to store the present and previous state of an algorithm that you've implemented in a single function. There's no reason to define the struct containing the record of the state outside of the function, and within the function the only name it could have is some variation on state, which is sort of redundant and rather useless, given you'll only be referring to the state by the two named variables of that type: present and previous
 
And this is where you would use an unnamed struct?
 
yes
 
Would you judge someone for still having a named struct?
 
they're like lambda functions: you don't need to name every struct, especially when you're using it as a way to conceptually group a set of variables that will only have one or two instances, and don't need any particularly complex functionality.
@EnnMichael no
 
10:09 PM
@EnnMichael Here's a really old (ancient) example: coliru.stacked-crooked.com/a/d71916186f7572b7
 
I see
But the compiler is still shouting at you for doing it
 
@EnnMichael A union (roughly) like this was used to pass register values to the interrupt function provided by most MS-DOS compilers.
@EnnMichael Yes, so it is.
 
@JerryCoffin I do that sometimes.
When you're eating vinegar & salt crisps, and suddenly you don't have lips anymore.
 
Why is the compiler shouting though?
I just looked it up on cppreferece, says that unnamed structs are fine.
 
@EnnMichael If you don't name the type, you have to define at least one instance of it--since it has no name, you can't do so later. coliru.stacked-crooked.com/a/e68f3dd28ed26eed
 
10:14 PM
Oh, that's the reason.
Thanks
 
Also when you return an instance of a function-local struct, you generally don't care whether it has a name or not.
 
10:59 PM
@JerryCoffin No sl/sh?
 
@Puppy Nope--si/di aren't split into 8-bit pieces.
 
11:14 PM
Somehow we need language features that optimize locks that are taken one after the other. For example, I have a function that looks like (current_pattern()+1) % total_patterns() where both functions grab the same std::mutex.
 
nwp
@Mikhail Why would that need a language feature? Looks like a valid compiler optimization to me.
 
Well if it were 2 function calls it would not be a valid, because the value could change between those calls...
Yeah, so for the case where the mutex is taken in the same line, we should write an angry letter to MS
 
nwp
@Mikhail that should not matter, the compiler can extend the area where the mutex is held as long as that doesn't cause a deadlock
generally that is a terrible idea so I can understand that compilers don't do that
 
Maybe we're talking about different things?
func = [&]{std::lock_guard; return global;};
auto foo = func();
auto bar = func();
So, it can't optimize the lock here, by design
 
Ven
it can if it wants to, really hard
 
11:25 PM
no
 
nwp
@Mikhail why not?
 
Because another thread could grab the mutex, and modify the value before the second call to func. One could imagine that func, has a _sleep(1000) or similar.
 
But if you extended the mutex lock it couldn't
 
?
 
Well if the compiler did apply the optimization, that couldn't happen
Right?
 
11:29 PM
Yes, that is the dream :-)
 
user1804599
It's so nice to change the DB schema and instantly get a list of queries to fix.
 
nwp
The optimization would still be valid. That the other value-changing function didn't get scheduled between the 2 calls to func, even though it had 1000 somethings time is a valid outcome and therefore a valid transformation.
 
@rightfold What do you do when you get bored of working on a project?
Someone told me to ask you that
 
nwp
start a new project, obviously
 
user1804599
I start a new project.
 
nwp
11:31 PM
lol, called it
 
Do you eventually finish the old one though?
 
user1804599
No.
 
@nwp Now that I think about it, this optimization may not be as valid as we thought
Does it really respect the as-if rule?
With the optimization, there is never a possibility of another thread jumping in between the two calls
 
nwp
@EnnMichael yes? Removing an interleaving that was previously possible does not violate any rules.
 
Without it, there is
Really, it doesn't?
 
nwp
11:35 PM
you cannot even tell if that other interleaving is impossible or just didn't happen
 
user1804599
createEdge conn (FileID fileID) {parentID: VertexID parentID, childID: VertexID childID} =
    execute conn [query|
        INSERT INTO edges (parent_id, child_id, index)
        SELECT $2, $3, coalesce(max(e.index) + 1, 0)
        FROM edges AS e
        WHERE
                e.parent_id = $2
            AND (SELECT v.file_id = $1 FROM vertices AS v WHERE v.id = $2)
            AND (SELECT v.file_id = $1 FROM vertices AS v WHERE v.id = $3)
    |] (fileID /\ parentID /\ childID /\ unit)
 
user1804599
This is so beautiful.
 
Ven
do you replace \$\d+ with ? in that perl 6 script?
 
user1804599
No, I use superior PostgreSQL protocol version 3.
 
Ven
okay
 
user1804599
11:37 PM
Fuck ?.
 
Ven
:P
 
user1804599
This isn't MySQL.
 
user1804599
Better: (SELECT every(v.file_id = $1) FROM vertices AS v WHERE v.id IN ($2, $3)).
 
user1804599
Boolean aggregates! \o/
 
11:56 PM
@nwp I think there is another practical limitation. std::mutex is implemented by some mysterious system call, so the language actually has no clue what it does?
I think different versions of the MSVC rt implement it differently, with different performance
See the article where they were shocked to find that std::mutex was significant slower on Winodws than ever other similar structure (such as QMutex)
 
nwp
@Mikhail It is implemented by compiler writers with the semantics the standard specifies, so the compiler should know exactly what it does.
I think it is just more of an artifact of multithreaded code being notoriously hard to optimize and easy to get wrong than a limitation of the language.
 

« first day (2260 days earlier)      last day (2685 days later) »