« first day (3048 days earlier)      last day (1893 days later) » 

12:06 AM
I was in California during the burning man season. Dude, I was burning just under the sun, no desire to see any burning man. All I wanted to do was cooling down in a pool, having an ice cold drink.
On the other hand, I am totally into this winter camping surviving thing - I watched countless videos on how to surviving multi-days in the wildness when everything else is covered by a foot deep snow.
 
woah... is this some sort of unzycon?
 
What's unzycon? Is it like something like onesie con(ference)?
 
 
2 hours later…
1:47 AM
Is that the naked and afraid thing where you need survive in the woods with another naked stranger
 
2:28 AM
@Rick you need to find a sugar daddy
 
 
2 hours later…
4:30 AM
@Rick No, it's where you surviving alone in the harsh wild environment. As a consequence, you toughen up and get to show contempt towards lesser beings at appropriate times.
 
4:45 AM
@thecoshman You can also replace an empty block with a semicolon if you prefer ;)
 
 
1 hour later…
5:58 AM
Can I See
 
 
2 hours later…
7:42 AM
@Mikhail Mik, let's hear your sugar baby fantasies. With so many rich gay men in tech, I am sure we find something for you.
~Pulling out my whip~ need to chase after the guy who's renting my carport - 3 weeks rent in arrears!!!
The car was parked in the carport this afternoon. Checked it when I was on the way to do something else.
 
 
1 hour later…
9:08 AM
@thecoshman lol is that a question worth asking :)
 
 
1 hour later…
10:34 AM
This article shows why SIMD is dead. I'd rather buy a second core than write code like the author did.
 
The popular Sudoku puzzle has introduced millions of people to constraint satisfaction problems, although they may not recognize it.
 
nwp
People playing Sudoku are just relaxing with a game, not solving constraint satisfaction problems, although bad analysts may not recognize the difference.
 
I’m not sure how many of these optimizations will end up in meshoptimizer master -
 
@Mikhail let optimization lovers optimize some algorithms and copy their recipes :p
 
nwp
Copy them into the compilers' optimizers.
 
10:45 AM
That only works when the compiler recognizes the algorithm though
 
class Window:WIndow that is some galaxy brain DRY for class Window:IWindow if I've ever seen some :P
 
nwp
I thought SIMD instructions are sufficiently simple for a compiler to use properly without understanding the algorithm.
Maybe std::for_each becomes useful.
 
the compiler will SIMD-optimize your Batcher's odd-even mergesort for you
wait, it's the bitonic sorter which is sometimes SIMD-optimized, my bad
 
i might be stupid, but is a counting sort O(n) ?
 
nwp
I was totally about to call you out on that because I clearly know the difference.
@Wietlol Look it up.
 
10:52 AM
it's O(n+k)
 
where k <= n
right?
 
no
that's the trick
if you've got values 0 and 1000, you might have only two values, counting sort will probably need to perform 1000 operations
 
apart from creating an array to store the counts, everything appears to be O(n)
 
it's value-dependent
 
hmm... true
 
10:57 AM
creating the array is already enough to change the complexity v0v
 
k <= n when there are no gaps
 
k <= n when (max - min) <= n
 
11:08 AM
I made what I thought was an improvement to the code but found it actually resulted in the program taking longer to complete. Is the array operator [] much more expensive to use compared to arithmetic?
 
nwp

C++ Questions and Answers

Solve problems and approach solutions. Just ask and lurkers wi...
 
in C#, there is a feature which is a multi-dimensional array for example new object[100, 100]
iterating through the entire array using a fori loop (for (int i = 0; i < arr.length; i++) (but then with 2 nested loops) is a considerable loss in performance
because in the background, it is one big array, and the index is y * xLength + x and that gets evaluated for every iteration
this was quite a bummer
compared to nested arrays object[][]
 
Curiously, the one really good use for SIMD is in kernel code (can't gpu up in there)
 
nwp
I am amazed how everyone but me manages to run into performance problems.
 
Msvc
Msvc performs no auto vectorization on unsigned short types, resulting in a 30%+ loss in performance compared to gcc/ICC. In my codes I have to do those paths manually.
 
nwp
11:18 AM
I think all my code could take a 1000% performance hit and I wouldn't even notice.
 
I only ran into a performance problem once
or rather... a memory problem
i was trying to solve a project euler puzzle
but i needed more ram than my 4GB pc had
oh, those were the days
now I run around with a 32GB laptop :)
 
I think if you did more real-time processing you'd run into this stuff. That being said, unless it's the internal image processing steps, most fixes to the gui are order of algorithm changes.
 
even BogoSort doesnt make performance issues for me
and my algorithm is about O((n-2)!)
 
nwp
Lots of my stuff is real-time processing. I need to process like 100k events per second and generate a visualization every frame for the current state. But it turns out CPUs are really really fast and 100k events is nothing, even if you run expensive algorithms on them.
 
i think the growth of operations is still something to consider
I wouldnt run an O(n!) algorithm on 100k items
 
nwp
11:27 AM
I would not care until it becomes a noticeable problem, and so far it has not happened.
 
true, when you dont need moar performancez, you dont have to bother
 
11:55 AM
or your computer takes off from your desk from all the fans spinning at max speed
 
Who has tower PC on the desk?
 
nwp
How else are you going to marvel at all the RGB lighting you spent all your money on?
Got to buy that gamer hardware.
 
12:50 PM
all sorting algorithms should be - Unless, of course you want to sort by array index :)
I can optimize the hell out of any sorting algorithm that is value-independent
 
nwp
What is your understanding of value-independent? Any comparison-based sorting algorithm is value-independent because you don't get access to any values.
 
That was the point :)
Wait. What.
Oh. Now I get it. It seems a useless/impossible distinction to me then (how do you compare values without accessing them).
 
@sehe sorting networks
no matter the values you roughly always perform the same operations
 
I think I'm going to learn something new any moment now
 
nwp
@sehe With the comparison function that you are provided with. Some algorithms like quicksort and mergesort can work with that, others like counting sort cannot.
 
1:01 PM
@Morwenn wouldn't that be "shuffling", "swizzling" etc. Or are you referring to things like "heapify"?
 
I mean, you do look up the values, but the exact sequence of operations is always the same (provided compare-and-swap is an "atomic" operation)
 
@nwp there is a 'Quantum' sort joke in here somewhere
 
@nwp So, in my layman speak it would be "using only the weak total ordering (which implies equivalence), not requiring equality"?
@Morwenn Ah. So the complexity is value independent. Got it now. The algorithm obvious isn't.
 
the only operation which is dependent is whether to swap the values
otherwise the operations performaed are always the same, there's no adaptation
 
That makes sense. I did learn a thing.
 
1:03 PM
There's a name for that, like "data-agnostic" or something
 
nwp
The difference is whether all you have is an operator < to compare elements, or if you can access their value and can for example use the value of an element as an array index.
 
which is super interesting when you want your algorithm to be resilient to "listening" attacks
 
@Morwenn That would probably have made more sense to my untrained ear. But I don't mind learning additional lingo
 
I don't know much about the lingo though
 
@Morwenn I was thinking of that immediately. Many of timing-invariant algorithms have the same properties (and no, just padding with a delay often does not do the job, e.g. with side channels)
 
1:05 PM
It's like when you xor two integers: you don't care about the values, you always perform the same operations at the bit level
 
It's extremely valuable for security if you can always do actually the same work (be data-agnostic).
 
yup
And sorting network can theoretically offer that kind of advantage, but it's probably easier if they're implemented directly in hardware
I tried to implement the compare & swap for integers in a data-agnostic way and still have differences in benchmark when using the sorting network on shuffled vs. sorted values
 
nwp
I thought sorting networks were an if/else chain. How is that ever expected to produce the same benchmark results for different inputs?
 
It's a if (b < a) swap(a, b) chain
 
nwp
Which obviously has different performance depending on if b < a.
 
1:18 PM
IIRC there are bit tricks to compute that without a conditional for integers
You can get the min/max of two integers in a branchless fashion, and swapping doesn't require a conditional
I should rerun my benchmarks with this
 
Brainwave: is "data-agnostic" still data-agnostic if you make assumptions about input length :think:
 
Data-agnostic probably requires many assumptions x)
 
(certainly when doing hardware implementations it would seem that assuming fixed input lengths would be common place)
 
I know that « vector length agnostic SIMD extensions » exist but not what it entails
Here is an example of a branchless compare-and-swap for int that only uses conditional instructions: godbolt.org/z/vSI8FJ
I'd need to run that through my benchmarks
 
nwp
1:34 PM
You would need a guarantee that cmov takes the same amount of time independent of the condition which it most likely does not.
 
@Morwenn IIRC it boils down to having the width of the simd vectors be queryable at runtime and you can then use that to adjust the pointer increment between loops and such
 
@nwp agner says it takes one cycle regardless
that doesn't mean the power draw is the same however
 
The same example with GCC doesn't use cmov though
 
@Morwenn aren't those GCC only though?
 
@Mgetz There is a standard proposal mentioning they appear as a RISC-V extension
 
1:42 PM
@Morwenn replacement for std::valarray?
 
Not really, many things could be seen as partial replacements to std::valarray
More like: we need to standardize abstractions that fit modern hardware
 
@Morwenn just curious, in what sense? I know that the evolution working group has at some point talked about something to allow for proper abstraction of GPUs etc
 
@Mgetz It's more on SG1 plate, trying to standardize CPU stuff really
 
ah yeah I knew all that was super preliminary, just didn't know where it had gone. I know that quite a few big players were interested in it.
 
1:51 PM
@Morwenn why can I see Intel going hard to torpedo this... and losing
 
nwp
2:02 PM
The channel 9 feed URL seems to have died.
 
is channel 9 even still a thing?
 
nwp
Although the last thing from STL was 2016.
I gave up trying to find a valid feed URL for STL.
Today I learned you can do implicit forward declarations by adding struct or class.
So instead of struct S; S f(); you can write struct S f();.
I'm so good at knowing stuff about C++.
Maybe I should read one of those recommended books -.-
 
2:22 PM
Maybe it doesn't matter because it's useless most of the time x)
It's just fun when you need to tag templates: foobar<struct YouDidNotExpectThis> balhblah;
 
nwp
Also apparently a friend declaration does not actually forward-declare the friended thing. I thought it did.
 
Friend declarations are funny beasts
Some classes even define their operators as free friend functions inside the class to make sure that they can only be found through ADL and without random implicit conversions
 
2:40 PM
Looks like there won't be any Networking TS in C++20
In other news I got new hormones /o/
 
I'd think that by 2019 we'd at least have a few animal parts
 
nwp
struct Cat : std::tail{};
 
I'll report if I notice any additional breast growth
 
Be sure to note the location
 
On my chest
 
nwp
2:54 PM
@Morwenn That is indeed neat. std::vector<struct S> f(); compiles.
I am now considering replacing my forward declarations with this. Probably a terrible idea.
 
I never found a use for it, but as I said some people use it to tag templates, but I'm unsure why
 
My memory apparently decays faster than my bewbs grow
 
Sometimes I miss variadic templates :(
 
Variadic templates are the pinnacle of "it's powerful to the point that it's dumb and annoying, but I want them"
2
"I'll make more errors but write less code"
 
nwp
2:57 PM
Can't you pass an Iterable<pair<K, V>> or something?
I imagine this also being terrible when used.
 
oh, the simplicity
(dont mind the indentation, that is paste.ofcode's fault)
@nwp you can pass a Pair<K, V>... (assuming its Java) but there is no standard Pair construct afaik
 
@Wietlol You can do it in one line: return values.fold(ChampMap.empty()) { (m, (k, v)) -> m.put(k, v) }
 
nwp
Not being able to construct a Pair<K, V> from a K and a V seems really weird.
 
@fredoverflow this is one line
but this is not kotlin
kotlin doesnt have this varargs type afaik
@nwp there is no standard one
for example Map uses a pair, but it uses one of its own: java.util.Map.Entry<K, V>
 
@Wietlol Sure it does: vararg values: Pair<K, V>
 
3:07 PM
but that is a paired one
 
oh, right
 
of(Pair(a, b), Pair(c, d))
vs
of(a, b, c, d)
ofcourse, the difference is that kotlin has infix functions
so, you can do this
of(a to b, c to d)
which imho is neater
(which does indeed use a paired vararg parameter)
 
@Wietlol Honestly? I think of(a to b, c to d) is even better than of(a, b, c, d) from a readability standpoint.
 
I dont always use infix functions, but when I do, they are awesome
> so, you can do this
of(a to b, c to d)
which imho is neater
@fredoverflow ^ I agree
 
I though you just found a to b to be (hiccup alert) neater than Pair(a, b). I find it the neatest of all! Well, except in Scala you could say a->b :)
 
3:12 PM
I should use scala more :(
the thing that keeps me with kotlin atm is that its dynamic syntax is composed of standard functionality
no special parsing rules, no special operators, no special contexts
 
@Wietlol I left Scala's overpowered expressiveness for Kotlin's simplicity and build speed.
 
I do miss Result<T> tho
but now I work in C#, so I miss a lot of stuff :(
 
Do you mean exceptions? :D
 
What is exception?
Baby don't hurt me, don't hurt me, no more!
 
Exceptions are an easy way to control program flow
 
3:18 PM
Results are an easy way to control the control of flow
 
Don't you throw function pointers three times a day? Shameful.
 
@Wietlol Do you miss C# stuff elsewhere, or do you miss stuff in C#?
 
I miss stuff in C# that exist in other environments
im not sure if I miss C# stuff elsewhere
 
Isn't C# one of the most expressive managed languages out there?
 
C# is old
 
3:21 PM
no u
 
I miss the simplicity of languages like kotlin
have you seen the ceremony to create an extension function in C#?
 
C# isn't even old enough to drink alcohol in the US
My goldfish is older than C#
 
C# is still a statement language as well
and C# has a lot of very context specific language features
such as yield returns for example
they only work in the function that returns the IEnumerable<T>
not lambdas inside them
no other functions that are being called
etc
and then... there is async/await
cries internally
 
Don't worry, we'll have worse than that with C++ coroutines
 
I dont work in C++ though
 
3:25 PM
Me neither
 
I do (now and then) work in LLVM... but I think that is too low level to even care about such constructs
 
It's just a hobby
 
@Wietlol static class with method taking an explicit this or something?
 
"work" ofcourse is an exaggeration... I attempt to understand how it works
@fredoverflow 1, a non-nested, static class has to be made to hold the extension functions
2, extension functions must supply the instance part as a parameter (which messes with the signature and generics)
and on top of that, it also doesnt work without a this qualifier
so this.MyExtensionMethod() works, but MyExtensionMethod() does not
 
@Wietlol that makes a lot of sense, if you think about it
 
3:31 PM
@Wietlol Maybe JetBrains will someday port Kotlin to the CLR? :)
 
Unless you mean, you cannot have an iterator block inside a lambda (you can have one inside Func<...> so I wonder)
 
@fredoverflow meh
 
@fredoverflow Just IKVM.Net
 
I find the issues in kotlin equally annoying
but there are just less
@sehe this makes a lot of sense, but its absolutely unnecessary
 
Okay so what language would you prefer to work in instead?
 
3:32 PM
my own :)
 
@Wietlol well. No.
 
that is why im attempting to understand LLVM
@sehe it is
kotlin doesnt require you to do so
 
I don't have time to argue this, but I'm pretty sure it makes sense at the CLR/IL level
 
because kotlin doesnt use a switch in the background
 
Regardless, you can have your opinion :)
 
3:33 PM
C# uses a switch
kotlin uses coroutines
 
> Narrator: It doesn't, but a mental model like that might not be far from a useful crutch
 
> completely incomprehensible
 
@sehe Is the narrator Scott Meyers?
 
check
 
3:35 PM
@Wietlol I'm not sure how the inner function yields the outer coroutine, but I'm happy to see a simple example
@fredoverflow I'm afraid I'm substituting today.
 
simple example, eh? (the big stuff comes later)
first of all, yield isnt a keyword
yield is a function of the SequenceScope class
this is what the code actually is like
however, the "this@sequence" part can be omitted, just like other this qualifiers
when the coroutine awaits a value, it runs the code inside the sequence part
until it yields a value
then it continues at the caller until it awaits another value
this all is done inside the implementation of the Sequence that gets returned by the sequence function
which is an Iterator<T>
because yield is not a keyword, but just a function, that means that we can call this function somewhere else
kotlin's coroutines work slightly better than C#'s but still are quite limited in their behavior
 
4:13 PM
@fredoverflow that is quite interesting
but I have no clue about some stuff
for example
- multi-paradigm
- non-hygienic
- visual
and ofcourse... there are a few flaws
 
Meanwhile I'm abusing polymorphism on a daily basis with Python
 
> There are less than 100 programmers on Earth smart enough to use your language
I dont think there will be 100 programmers that would attempt to use it
abusing polymorphism is fine
try abusing multiple inheritance :)
 
Doesn't work when the objects are not pure Python objects :(
I had to make a function that took a type and returned a type derived from it at some point because I had to avoid multiple inheritance and Python doesn't have templates
class SomeClass(augment_some_type(ParentClass)): ...
where SomeClass actually derived from a type deriving from ParentClass
mixins for the masses
 
 
5 hours later…
9:02 PM
 

« first day (3048 days earlier)      last day (1893 days later) »