« first day (1781 days earlier)      last day (3153 days later) » 

11:00 PM
@r3wt Google query "c++ compiling" gave me two irrelevant entries, but the third looks interesting
 
I just made up a new term for SO performance questions: "Statistically Interesting"
No I do not care about your question that asks, "Why is A 1% faster than B?"
 
@Morwenn what's the difference?
 
@orlp Between?
 
@Lalaland I dive right in and then back up and do research once i've properly fucked everything up
baby steps are for babies
 
@Morwenn pdqsort and your variation
 
11:04 PM
can i use single quotes instead of double quotes in CPP
(dumb question, sorry)
 
@orlp A wild guess that seems to work since it passed all the unit tests.
 
@r3wt No, not interchangeably.
 
@Morwenn which is?
 
@orlp If the partial insertion sort fails, the array is sorted enough for an unguarded insertion to work.
 
@Morwenn that's not how it should work at all
 
11:05 PM
@rewt single quotes for chars, double quotes for string literals.
 
@r3wt that's a question a google search could answer for you
 
@Morwenn worse, that's O(n^2)
 
Oh I just noticed.
 
Oh hey, I haven't seen you in a while.
 
I had Greasemonkey off.
No wonder my SO chat looked different.
Heyo.
 
11:06 PM
@orlp I mean, I just put the boolean flag to false if the partial sort fails.
 
@Mysticial Stalker.
 
@Morwenn what do you mean?
 
    if (already_partitioned) {
        if (partial_insertion_sort(begin, pivot_pos, comp) &&
            partial_insertion_sort(pivot_pos + 1, end, comp)) return;
        leftmost = false;
    }
 
Yeah I missed you nerds.
Been a while.
 
@r3wt No, I mean literally, you could type all that as a Google or DuckDuckGo query
 
11:08 PM
Why'd you leave us :(
 
@Morwenn oh that's not the same as what you said before
 
@orlp Yeah, what I mean is that changing this flag only has an effect on the choice between the guarded and unguarded insertion sorts. But I agree that it was unclear.
 
hrm
 
@unordered_meow ok, i'm sorry. i will refrain from asking stupid questions as much as possible.
 
@orlp I thought that it could as well make everything fail because I didn't check the effects on the call to partition_left, but it seems that everything works smoothly for some reason. I didn't proove that it was always safe but it passed the unit tests.
 
11:12 PM
@Morwenn which unit tests?
 
@orlp Assert that is_sorted in the benchmarks after each sort, plus my unit tests in cpp-sort.
 
well, I think it always works
partial_insertion_sort does a maximum of 8 moves, with the exception that it will always finish correctly positioning an element once its started shifting it
 
@r3wt and the answer is, no, you can't, as single quotes are for characters and double quotes are for strings ("a string" is not of type std::string, but that's a detail you don't need to concerned about right now)
 
actually
hrm
no I think it's unsafe
 
user406009
@r3wt For interests sake, why are you looking into build systems like Make?
 
11:17 PM
@Morwenn here's why
 
Make is not that good, especially when you consider it's almost 40 years old
 
user406009
Make is good for simple projects.
 
Except it's not
 
@orlp That's what I'd say, but I have yet to find a counterexample :/
 
@Morwenn if there is an element smaller than *begin, the unguarded_insertion_sortwill compare *(begin - 1) < *begin (which is always true on everything except the leftmost recursive call, acting as a sentinel)
 
11:19 PM
If you want usable makefile for your project, you start with a lot of boilerplate you shouldn't need to deal with
 
@Morwenn did you run the unittests with valgrind set up to detect memory access errors?
 
@orlp Yeah, but can there be an element smaller than *begin after a call to partial_insertion_sort?
 
@Morwenn most definitely
 
@orlp It seemed to complex to use with Windows.
 
user406009
@unordered_meow Less junk than CMake though.
 
11:20 PM
for example, see here - it's a simple project, with an almost simple makefile
 
10 9 8 7 6 5 4 3 2 1 11 12 13 14 15 16 17 18 19 20
 
...now make me a debug build of this project
more boilerplate
@Lalaland No, not really. CMake can do more stuff with less boilerplate, at the cost of being more specialized (C++ code)
the problem of CMake is that it tries too hard and its scope is too wide
it has a half-assed package manager and an IDE project generator
 
@Morwenn already partitioned only means that the arrays are already partitioned correct
consider the concatenation of [100, 0] 101 [102, 200]
that's partitioned correctly
(example might need some editing because sort3 might mess some things up)
but after partitioning the first half is in reverse order
and *begin is 100
while the smallest element in that partition is 0
 
@Xeo Does your cat do this too ?
 
@orlp I see what you mean. I'm only surprised that the load of tests couldn't find a suitable failing example.
 
11:30 PM
@Morwenn how are you sure no out of bounds memory has been accessed?
 
@orlp That's quite hard with the tools at hand. It seems that you're right and the UB played in favour of the results.
 
sorry :(
cool idea though
 
No problem. It helps to see where the problem was :)
 
I probably got confused by the fast that the first n elements of the partial insertion sort are indeed sorted, but not guaranteed to contain the smallest values.
 
user406009
11:33 PM
I wish we had an option to crash on UB. For testing purposes.
 
user406009
Cause it's UB and all, it shouldn't effect correct code.
 
@Borgleader are you the borg queen
 
@Lalaland At that point you has well have a error: UB message printed out
If you are going to detect all possible causes of UB
 
Ell
I think it is very difficult to do
 
user406009
@Ell It's easy to do at a great performance cost.
 
user406009
11:41 PM
It's hard to do efficiently.
 
Ell
I think sometimes its hard even at great performance cost
Else we'd just do in debug mode
Which we do
 
Clang has compile options for that
 
Ell
For only some UBs though
Yeah like fsanitize-*
 
Sure, catching them all would be very hard, and also sometimes the result won't be pretty
For example, what would a compiler do if faced with UB combined with implementation-defined behaviour
as in, UB that happens when arguments are evaluated left-to-right, but not when right-to-left
 
@unordered_meow launch a game
 
11:54 PM
If I have a library (libA) where I typedef a bunch of basic types (like namespace a { using u32 = std::uint32_t; }), and another library (libB) that depends on libA, is it weird to do namespace b { using u32 = libA::u32; }, etc for common types I'll be using from libA? It feels weird
 
Ell
it sounds pointless in the first place
Why typedef int32_t to I32 etc.?
To save on typing? Is it worth it?
 
because its a chore to type
 
@Lalaland i'm interested in make because thats the only thing i'm aware of. i'm brand new to C++ and moreover, to compiling/building in general. I have read some portions of bitcoin source and compiled it, so thats how i know about make
 

« first day (1781 days earlier)      last day (3153 days later) »