« first day (855 days earlier)      last day (4315 days later) » 

18:00
@Cicada Why? I thought B-trees were about optimising disk access patterns.
According to this question and its link apparently Andrei is advocating something that looks similar to my exceptional<T>, I'm surprised.
Just today?
@KonradRudolph It was a joke... I'm sorry if you don't find it funny, but there's no reason to be a douche about it :(
@CatPlusPlus Well I don’t normally have two run-ins a day with him
@CatPlusPlus lol
18:01
@KonradRudolph To fill it in for you, one such danger would be the wife. That's where that was going.
@KonradRudolph "Run-ins"? Please explain how we have had a "run-in"!
No, I know what a run-in is. I fail to see how the term applies here.
0
A: C++11 Best Practice: When to accept by value vs const&?

FredOverflowYou didn't include it as a choice, but may I suggest perfect forwarding? class Doer { public: template<typename T> Doer(T&& thing) : m_Thing(std::forward<T>(thing)) {} private: Thing m_Thing; }; This will result in a single copy/move for lvalues/rvalues, which ...

I fail to see how that isn’t obvious
You jumped in on a message I wrote to someone else, that was a lame joke, in order to call me names. That's not a run-in. That's you being a twat.
18:02
what's the recommended warning level for clang? Because -Weverything -pedantic is apperently too high
@R.MartinhoFernandes That's right, because it has amortized logarithmic insertion & deletion time. A simple table has constant access time but is terrible for insertion & deletion.
@LightnessRacesinOrbit Uh? It’s an answer to a technical question on SO. How is that obviously a joke? (Or even non-obviously – it’s not supposed to be a joke)
@MooingDuck -Wkids
@KonradRudolph Perhaps we're speaking at cross-purposes, then
@KonradRudolph Yeah he's completely excited today for some reason.
18:03
@KonradRudolph In the absense of any other context, I could only presume you were responding to my last chat comment. Sorry if that's not true. Please provide that missing context after the tone.
@MooingDuck how do you define too high?^^
@Cicada Don't you start.
@MooingDuck I use same as GCC plus -fcatch-undefined-behavior (or whatever its replacement has become). Not exactly warning-related, but still useful in test builds.
@R.MartinhoFernandes hmm, my gcc is -Wall -Wextra -pedantic-errors, I guess I'll try that
@LightnessRacesinOrbit Ah hmm. I was responding to this:
@KonradRudolph: Warnings are warnings. They are not errors. Warnings do not trigger on erroneous situations, but on suspect ones. Actually, they can trigger whenever the heck they like. — Lightness Races in Orbit 4 mins ago
18:04
@KonradRudolph Oh, that. Well I still don't see how that's a "run-in". I was not being rude, or offensive, or harsh. I was just stating my opinion of the technical facts. I'm sorry that they don't marry up completely with your differing opinion... but that's life.
@bamboon I've got several warnings for using functions that weren't declared in a header
You can't make tea with cold water. I need to pay more attention.
What the fuck is wrong with the lounge today
@bamboon Lots of false positives.
@LightnessRacesinOrbit Well, we clearly are arguing different, contradictory statements here. That’s a run-in for me
18:05
@KonradRudolph In particular the standard does not make any mandates on when a diagnostic can and cannot be emitted, as far as I'm aware.
@KonradRudolph Alright, well it's certainly not me being "obtuse". I disagreed with your technical assessment, and quite without any aggression replied with my differing opinion. I ask you not to call me names for doing that.
@LightnessRacesinOrbit No idea, but a warning would obviously be fucking counter-productive here
Ugh, bitbucket wikis are either invisible or editable by everyone. WTF
Ell
Ell
Anyway
@Cicada Yeah. Everybody seems to be taking everything very personally for some reason.
Ell
Ell
18:07
Gitlab ftw!
user142019
Yay got IL to work. :P
@Cicada We should go back to our mutual trolling. It was much easier.
user142019
Hello.
@LightnessRacesinOrbit I currently lack the energy for that, sorry :(
Ell
Ell
18:08
Hei
@Cicada Maybe that's why the balance is off here today
@Cicada i.e. it's all your fault
I figured so.
@Ell you forgot the 'l' there, Skippy
@Cicada Okay
@CatPlusPlus Good morning, 19h here.
@CatPlusPlus Morning.
18:09
Yes
@Cat yes what?
I'm still in the same timezone, I don't move
@CatPlusPlus We are having a bad day. We need to you to inject some of that CatPlusPlus sanity and calm, rational thinking that you do so well!
Ell
Ell
I hope I feel better tomorrow
Also, where does hcl in your stomach come from?
@CatPlusPlus We have so much in common.
18:10
From your stomach walls.
@Ell the stork deposits it from within its own stomach
> Gastric acid is a digestive fluid, formed in the stomach. It has a pH of 1.5 to 3.5 and is composed of hydrochloric acid (HCl) (around 0.5%, or 5000 parts per million) as high as 0.1 N[1], and large quantities of potassium chloride (KCl) and sodium chloride (NaCl).
@R.MartinhoFernandes There is a confluence linky flashy thing to the right winking and wiggling its eyebrows suggestively to the right of those settings.
Gastric acid is a digestive fluid, formed in the stomach. It has a pH of 1.5 to 3.5 and is composed of hydrochloric acid (HCl) (around 0.5%, or 5000 parts per million) as high as 0.1 N, and large quantities of potassium chloride (KCl) and sodium chloride (NaCl). The acid plays a key role in digestion of proteins, by activating digestive enzymes, and making ingested proteins unravel so that digestive enzymes break down the long chains of amino acids. Gastric acid is produced by cells lining the stomach, which are coupled to systems to increase acid production when needed. Other cells in ...
@LucDanton Ugh what?
18:12
@R.MartinhoFernandes I am probably not meta enough for those
missed that Q
it's depressing that you can refresh SO like every 5 minutes and still completely miss questions in your pinned tags. too many questions!
@FredOverflow It's faster because the compiler didn't move the variables in registers in the xor solution.
But I get your point.
No, it didn't.
(disclaimer: I don't know assembly)
18:14
Maybe it would have with restrict, I don't know
which are the registers?
I wouldn't even care if xor was faster, because it is useless if it cannot swap a variable with itself.
Because swapping a variable with itself makes perfect sense anyway.
I was just pointing out that the comparison isn't fair.
18:15
@Cicada Branching to detect when it's about to negates the performance gain
@Cicada It happens a lot in algorithms.
@LightnessRacesinOrbit You don't add branching: you don't swap with yourself, that is all.
@Cicada How do you know when you're about to swap with yourself?
@LucDanton Oh. That.
Sigh.
Add restrict and test again please.
18:15
swap(*it1, *it2);   // is that a self-swap or not?
@Cicada Since when does C++ have restrict?
@FredOverflow Hence the restrict. sigh
@Cicada ... don't do that
C++ doesn't have restrict?
18:16
"The comparison isn't fair, because you didn't use a feature that doesn't exist in this language"
@LucDanton Similar to what I had planned for Wide.
@Cicada restrict is not listed under 12.2 Keywords, no.
@LightnessRacesinOrbit Alright then. His claim is false in C where restrict does exist.
17.2/2 explicitly says that any use of restrict in the C standard library is emitted in C++
I was pretty confident there was a restrict mechanism in C++
18:17
@Cicada Okay but the question is tagged C++ ;)
@Cicada: I'd still like you to help me understand the assembly. From what I can tell, register values are moved in both cases.
@DeadMG I'm always on the fence purging it from my codebase because it's just not convenient as a library feature. If it's in the language though I believe it can be made really convenient.
@Cicada What exactly does restrict mean? This is the only pointer to X? How would that help in the case of swapping one variable with itself?
> [C++11: 17.2/2]: The descriptions of many library functions rely on the C standard library for the signatures and semantics of those functions. In all such cases, any use of the restrict qualifier shall be omitted.
@LucDanton Actually, I had intended to make it part of my ABI (so language-implemented).
no other mention of it. frankly I think it should be mentioned in the compatibility annex
18:18
@LightnessRacesinOrbit Look at the swap-through-temporary assembly. See how both variables are loaded in registers (first 2 instructions)
Maybe I'll give git another try. Let's see if I can convert my repo to git.
@FredOverflow I think it makes the code UB when both arguments alias the same object. Which is similarly useless.
In the case of swap-through-xor with non-restrict pointers, the compiler doesn't know whether the two pointers refer to the same location, so he can't optimize the dereferences away.
Which is why there's extra loads and stores. Which are slow.
My point isn't "use xor it's faster derp"
It's "the comparison is unfair"
@FredOverflow Yes. Because the compiler would optimize away the load & store
@Cicada okay but one of those happens in the XOR case too
18:20
@DeadMG Yeah I'm giving you the go-ahead, because you might see me badmouth my particular C++ implementation but I believe the intention behind it has some merit.
is @DeadMG writing a language too?
@LightnessRacesinOrbit The temp has 2 loads and 2 stores. The other has 3 loads and 3 stores. That's 50% more of each!
@R.MartinhoFernandes Confluence is free for open-source projects btw
@LightnessRacesinOrbit He's been at it for long.
@Cicada yeah, the XOR trick has 50% more of each...
18:21
Most if not all Atlassian tools are
@LightnessRacesinOrbit And it wouldn't have happenned with restrict. Oh well. I thought it was interesting.
@Cicada you may be the only one :P
This is a sad world.
> markdown is also a standard widely used on the internet, people already know it.
fucking comma abuse
18:22
@LightnessRacesinOrbit Yep.
partially written, now.
Can it compile to Zoidlang?
@R.MartinhoFernandes I'm used to wikis not supporting anything sane (not that Markdown qualifies)
vOv
lol
@CatPlusPlus The thing is that I already have a bunch of stuff written in Markdown and am not willing to convert it :/
@Cicada Okay, I wrote a third version with restrict, is this correct?
@LightnessRacesinOrbit lol
18:24
void swap3(int * restrict a, int * restrict b)
{
    *a = *a ^ *b;
    *b = *a ^ *b;
    *a = *a ^ *b;
}
Compared with the restrict-less version, this generates one more instruction, not less:
movl (%rsi), %edx
movl (%rdi), %eax
xorl %edx, %eax
xorl %eax, %edx
xorl %edx, %eax
movl %edx, (%rsi)
movl %eax, (%rdi)
a Fruit Owl
hahah, one more instruction.
The version with one more instruction may still be faster, though. I'm no x86 expert.
18:25
Microoptimisation fails yet again
I instruct you to care less
That's absolutely right, but it now has only 2 loads and 2 stores
The compiler isn't optimizing away the xors, though, so it's almost certainly slower
Y U MICRO OPTIMIZE?
On the other side
xor-swap is generally not used to swap in-memory stuff
18:27
xor-swap is generally not used
you use it when you have high registry pressure
I was about to say that myself, cat
@TonyTheLion Nothing better to do, I guess.
do note the positive effect on loads&stores of restrict, though :)
OMG it worked.
18:29
Breaking news: Undefined behavior causes xor trick to not fail on identity swap.
lol
xor swap makes sense only when swapping registers
doing that on memory is silly
doing that on non-restrict memory is even sillier
doing it at all is silly
Wow we're all learning so much. Thanks.
If you love the xor trick so much, why don't you marry it?
18:30
whatever, i'll just leave you to your amazing superiority anyway
@FredOverflow Can't. The xor trick is also a female.
(Or is that now allowed in France? I lost track)
You kept track?
As with all things that don't affect me directly, I couldn't care less
18:32
@R.MartinhoFernandes I don't think so.
How do lesbians not affect you directly? What is wrong with you?
@Cicada Do modern CPUs still suffer from registry pressure? Don't they have like 256 virtual registers or something?
If I were a lesbian they might but alas I'm not
Also, u selfish bro
No, you're a man. Lesbians affect men.
@FredOverflow nobody will ever need more than 256 virtual registers
Maybe you're a lesbian
18:33
Woot, migration successful! github.com/rmartinho/ogonek
@FredOverflow They do but you can't use them.
user142019
@DeadMG if you have an AST do you convert it to a different data structure during the sema step or do you immediately generate code from the AST?
@R.MartinhoFernandes Did you fix your file extensions yet?
they're basically only used in function calls and context switches.
@Zoidberg What is "the sema step"?
18:34
hmmm nope.
Though GitHub seems to think the project is 89.4% Python.
I don't think the CPU can use a virtual register to optimize a register spell
x86 is hilariously register-starved
@Zoidberg I convert.
user142019
@FredOverflow semantical analysis.
18:34
no way the AST is going to hold my LLVM context and all that shit.
@R.MartinhoFernandes I like how your project is 89% Python
although, thinking about it, I probably could immediately create that representation...
user142019
I presume that structure is similar to the AST except it has type information and such?
@Zoidberg Kinda, it's also a lot more low-level.
1
Q: Code stolen by the compiler, how do I circumvent its criminal ways

BenI wanted to stress out the processor on a new computer at work. I figured a good way to do it would be to open a thread for each processor with the function: void soStressful() { int j = 0; for (int i = 0; i < 10000; ++i) { j += i; } } But for some reason the compiler ta...

18:35
like I have to have nodes for conversions and to store LLVM function pointers and such things.
^^ quite surprised by the lack of upvotes on this.
@CatPlusPlus Yeah, wtf.
I made spaghetti!
user142019
I'm using .NET IL now because that actually works and has decent API.
18:36
@R.MartinhoFernandes scons
excellent, my ming-clang can't compile it's own headers again. and GCC isn't compiling my code at all (It thinks there's no files to compile)
user142019
I think I will generate the code from the AST.
@CatPlusPlus I know. :/
hah.. your ming-clang
Clang on Windows?
Poor you
@CatPlusPlus Seth did that a while back.
user142019
I already wrote some toy code to generate IL code for free functions, void return statements and unreachable statements. :P
Do exceptions work yet? :v
throw code_was_written_by_zoidberg_exception();
18:39
@CatPlusPlus I mostly just use it to confirm that clang compiles my code without warnings.
I'd make a VM and run Buildbot on it
@CatPlusPlus and if I can't figure out what's causing an error with MSVC
@CatPlusPlus Rubens' description says "Clang: works great for 32-bit, aside from some minor DLL-related issues."
Ugh 32-bit
@CatPlusPlus That fact that it works at all on Windows is surprising to begin with.
It really shouldn't be
18:41
I see references to gcc-dw2, should I pick that over straight up gcc?
DW2 is a zero-cost exception model, but it only works for 32-bit code and can't pass exceptions through foreign frames
Xeo
Xeo
@Mysticial, did you get to watch Kotoura-san yet?
@Xeo ep5?
yes
Xeo
Xeo
Ep6 is out already
already?
Xeo
Xeo
18:45
@Mysticial How do you like it so far?
I just DL'ed ep5 2 days ago...
YAY BEER
Xeo
Xeo
@Mysticial Every Thursday evening (my time)
@Xeo It's okay. Not great, but not bad.
user142019
I like dynamic better than visitor pattern.
Xeo
Xeo
18:47
You also suck.
How is that related?
I really hate Ruben's mingw-w64.sourceforge.net website. Software is good. Figuring out what to download is a PITA though
epic failure link
user142019
@CatPlusPlus dynamic does overload resolution at runtime.
18:47
It's not his project, he just makes builds
don't care
@Xeo Horriblesubs has it out already. Commie is a bit behind.
Xeo
Xeo
@Mysticial Ah, right, I remember you hating HS.
18:48
(They're multilib)
hey
is that code ok? data[x * size * size + y * size + z];
@CatPlusPlus Nice.
because I'm wondering if I screw up completely
In computing, row-major order and column-major order describe methods for storing multidimensional arrays in linear memory. Following standard matrix notation, rows are numbered by the first index of a two-dimensional array and columns by the second index. Array layout is critical for correctly passing arrays between programs written in different languages. It is also important for performance when traversing an array because accessing array elements that are contiguous in memory is usually faster than accessing elements which are not, due to caching. Row-major order is used in C, PL/I, Py...
@CatPlusPlus does that have clang?
18:50
@BartekBanachewicz Do you have a cube`
Xeo
Xeo
53 mins ago, by Mooing Duck
I don't even know what that means
Global constructor means static construction, IIRC.
@FredOverflow yes.
Cube of cubes, to be exact
Xeo
Xeo
The warning is just a hint that that happens, basically.
@MooingDuck No
@BartekBanachewicz Is that supposed to be 3D or someshit?
18:51
@Zoidberg The problem with that is that you basically have to have declarations, else you can't create the necessary code for each structure.
user142019
I only have definitions.
@R.MartinhoFernandes that's kinda obvious. x, y, z
user142019
Or well,
user142019
definitions and declarations are paired.
user142019
And cannot occur without eachother.
18:52
I also only have definitions.
but you don't know about future definitions when parsing a function.
user142019
(Except for C functions, but yeah I'll fix that later.)
so you can't resolve the identifiers, can't know their type, and can't do jack shit.
user142019
@DeadMG no I don't generate code directly in the parser.
@Zoidberg But doing pretty much anything, semantically, requires knowing the types involved.
Oh. I forgot. GitHub does not allow arbitrary downloads now.
user142019
18:52
The parser generates an AST, and when that is fully complete I traverse that to semantically analyze and generate code.
@R.MartinhoFernandes what?
and you can't know the type of the identifier without knowing all the code (unless you want declarations).
@BartekBanachewicz They took it out. It's source-code only.
so it's impossible to generate a useful semantic/codegen tree as you parse.
user142019
18:53
@DeadMG The parser doesn't need that.
@ThePhD Oh. I never download something other than code.
no, I know that.
I mean, you were talking about not producing an intermediate AST.
and what I'm saying is, "That's impossible unless you want declarations".
ok you people have gone all nerdy
18:55
images work.
you're just jealous of my technical acumen
@CatPlusPlus Is it [x * size_y * size_z + y * size_z + z] in particular?
user142019
@DeadMG you can look ahead while traversing the AST.
There's an equation at the end, you can figure it out :v
@CatPlusPlus I can't maths. I think it is that, just want confirmation
18:56
Hm.
@Zoidberg But that still requires having an AST to look ahead into.
Does math traditionally have the z-axis pointing up?
user142019
@DeadMG Yes, that's what the parser generates.
user142019
You first parse everything.
yes, so it's impossible to not have an intermediate AST.
user142019
18:57
And once parsing is completely complete you analyze it.
What's with the title?
@IDWMaster Sorry, it's buggy.
@IDWMaster s/title/topic/
room topic changed to Lounge<C++>: Welcome to Hell++. [c++] [c++11] [c++-faq] [no-helpdesk]
That's better
18:59
@BartekBanachewicz Yeah I think so
hmm
I have no idea what my grammar was for function arguments that had to be a particular type.
if I even had one.
@ThePhD No, inwards
.... Huh.
That's weird.

« first day (855 days earlier)      last day (4315 days later) »