« first day (1946 days earlier)      last day (2993 days later) » 

12:00 AM
almost half a second for a function call :S
 
... Run over 100K times, sheesh.
This also isn't using Nonius (it's not my benchmarks).
 
@milleniumbug Of course I was right :p
 
12:34 AM
@melak47 pizzas per square thermometer
it's an american unit
 
lol. "it's an american unit, you wouldn't understand"
 
here's a pretty sweet track with vocals by a mean sounding chick
 
Ugh.
I don't wanna optimize sol right now.
I'm tired AF.
But these benchmarks...
They compel me.
COMPEL MEE.
 
just do a little exploratory surgery :)
 
Oh yeah I forgot to ask @jaggedSpire The scarf, you said you were finishing it a couple of days ago, did you send it off?
> error C2971: 'sol::arity_tuple': template parameter 'I': 'I': a variable with non-static storage duration cannot be used as a non-type argument
The fuck does this even mean?
 
12:42 AM
you're trying to pass a non-static variable as a template parameter?
 
Yeah, but... I is a template parameter.
By definition, a compile-time, static variable. .-.
 
@slaphappy was having problems with something shadowing template parameter names?
 
template <std::size_t Ix, typename... Args>
using arity_tuple_t = typename arity_tuple<Ix, std::index_sequence_for<Args...>, Args...>::type;
template <std::size_t Ix, typename... Args>
struct arity_tuple;
It... LOOKS okay to me?
Maybe there's somehing I'm missing here?
 
wrong order?
 
Says that's the reason... better backtrack.
Bwuh.
These are all compile-time entities.
WTF is microsoft smoking.
 
1:11 AM
How to write a power and lgoarithm funciton in oop way?
 
AH
I'M EXPERT IN THAT
first
you need to pick a design pattern or many
let's say that you want to have a power and logarithm builder, one for each right
and you want the resulting built objects to be able to notify others when they have answers to give because who knows maybe in the future you'll ask a server for 2^2
so you want those to be observable right
you unify their interfaces with a facade
 
@Morwenn 5.pow(3)? :S
 
don't listen to this guy his solution is not extensible
anyway on a more serious note
OOP is for storing state and behavior together
functions like math stuff by default have no state
they're not supposed to be part of any class
 
@Morwenn You don't
 
so they've nothing to do in an OO design
 
1:16 AM
auto operator"" _pow(double d) { return pow_functor{d}; } or something :p
 
see Stepanov's rant about OOP (it's in the Stepanov's interview)
 
@ThePhD so what are you doing that amounts to this? :D
 
namespace MyReInventedMathFunctions { put your functions here }
and make them so that people can combine them together
and do nice stuff like mapping them over collections
and shit
 
@jaggedSpire
 
@melak47 Nothing. >.>
...
I fucking hate VC++.
Fuck this noise.
 
1:22 AM
@milleniumbug It's not a rant. He mostly just says: "All that stuff that makes up OOP? Yeah, I never do any of it." I suppose you can call it a rant if you want to, but if you're looking for a real rant, with lots of loud opinions and no factual backing...well, Linus would be a lot better bet.
 
you don't really need a rant
to understand that you can't OO the sine and cosine functions
srsly
 
@AlexM. Sure you can. Start with Number as a class, and it all flows...smoothly from there.
 
I think noda time (skeet's datetime lib) does extension methods on ints
so you can write
 
Well, if you are desperate enough... you could have multiple implementations of abstract class Math, and pass them in your program (one faster, one more accurate, one reproductible across machines)
 
14.December(1993) or something like that
 
1:26 AM
I think of the code I wrote this week as a burning car racing in a desert in an apocalypse.
 
"No appropriate default constructor available" fuck you too VC++.
 
@ThePhD :v
are you using Clang with Microsoftâ„¢ Codegen yet?
 
No.
Because it's buggy.
 
but is it less buggy than regular MSVC? :v
 
Lets bug Chandler until he fixes it :)
 
1:30 AM
next time you play a game
remember
one of your team mates or enemies might be kim jong un
and you won't even know it
 
> manually replace all of the variadics by hand
> compiles just fine
> make it variadic? everything breaks
F U C K Y O U V C + +
 
@ThePhD take. a. break.
<3
 
NO.
Look at those
benchmark numbers
 
Hey guys, not sure how kindly you take to questions... but here goes. I've been writing in Java for a bit and just settled down to start learning C++, and the :: operator confuses me. If I declare some class Car with a public function void Start(), and then later, outside of the class, define Start() as Car::Start(){return 'started';}, this seems to imply to me that when I originally declared Car, it was actually already sitting somewhere in memory, as an instance?
 
yea you've been rambling about C++ for the last few days non stop
 
1:32 AM
@ThePhD you mean buggyadics?
 
This is totally foreighn to me
 
I've no idea why you invest so much time
in linking that language
to that other language
 
sol is vastly slower for member function calls. I MUST fix it.
 
@IsaiahTaylor TL;DR: C++ compilation model (to the despair for everyone) is based on 70's compiler technology
 
Meaning, without creating a new instance of Car, with a reference to that instance in memory, im modifying it?
*without
 
1:33 AM
@IsaiahTaylor is start static?
 
no
unless that's default in c++?
 
it's not
 
and no :: does not mean that
void Car::Start() just tells the compiler to look for Start in the namespace of Car
 
@IsaiahTaylor I really recommend choosing one of the books in here and reading it
 
1:35 AM
man this new tomb raider sure looks impressive i.imgur.com/Qs5AACF.jpg
look at those details
the hair is still crap tho
 
Right. But just to confirm, I'm actually modifying what Car is in memory? Car itself, not some instance?
@milleniumbug thanks, I'll check it out
 
@melak47 pow(std::integral_constant<int, 5>{}, std::integral_constant<int, 3>) way better.
 
@IsaiahTaylor No
:: is the scope resolution operator
 
@Morwenn eh...if you're gonna do pow on integers at compile time, shouldn't you use std::ratio? :p
 
I'm obviously not familiar enough with how Classes work in memory
Just sat down to work at this an hour ago haha
 
1:37 AM
Declaring/defining a class does nothing to memory (unless you mean the code section of it)
 
Oh... really?
 
@Morwenn C++
 
That's insightful
 
@melak47 Not classy enough, I like my pow(5_c, 3_c) == 25_c :p
 
@Borgleader oooh
 
1:39 AM
@IsaiahTaylor No memory is involved until you actually request an instance of a class (i.e. an object), so if in a function you do Car c; the compiler will have to allocate memory on the stack of an object of type Car.
 
@Morwenn but what about pow(5_c, -3_c) :p
 
@jaggedSpire sexy innit?
 
@melak47 Yeah, I handle that one too.
 
@Borgleader and yet, :: is not asking for an instance of the class?
 
no, again its the scope resolution operator
all it does is tell the compiler where to find names (of objects, functions, classes, etc)
 
1:40 AM
I guess I'm having a hard time understanding exactly what the compiler is doing with ::
 
can't you just get a C++ book
and like, start at page 1
and end at the last page
 
@IsaiahTaylor The :: operator is only related to finding names. It's roughly like a phone number. At a typical office or hotel, you can dial somebody there by just dialing their extension. If you want to dial a local number outside the hotel, you dial 9 (or 1, or whatever), then that number, but for a local number you don't (usually) have to dial the area code. If you dial a number in a different area code, you have to dial the area code first, then the number (likewise country code).
 
@Borgleader indeed
@AlexM. rekt
 
@Borgleader with the example you just gave, wouldn't baz have to be static in order to run bar::baz()?
 
1:44 AM
no, those are free functions (something java doesnt have)
 
C++ finds names the same way: for a name local to a class, you can just use the name by itself. For a name in another class, use classname::membername. Likewise, if you have code with a member inside a class inside a namespace, you might use something like ::namespace_name::class_name::member_name to find it.
 
Alright. I thought I could get through this by my Java bootstraps. I'm gonna break down and read the C++ book I have on my shelf downstairs. Thanks for the help! :D
 
Which book is that?
 
Umm... I'll tell you in a sec
 
@IsaiahTaylor If it's not on the list, get one that is (seriously--there are lots of horrible C++ books around).
 
1:46 AM
@ThePhD im assuming lower is better (for all but the rightmost column?)
 
@Borgleader Lower is better or all columns.
 
oh i misread that one, i thought the last column was # of calls
@ThePhD oh youre winning in 2 columns, doing pretty good in a 3rd one
thats neat
 
I had originally opted NOT to do tunneling
Because fuck that noise
But that benchmark forced my hand.
 
rofl
 
lol
 
1:49 AM
I mean, look at that piss-poor performance.
700 ms
We beat Selene
But then again, Selene is easy to beat.
It's kaguya that's my main competitor.
 
Well I'll probably be running to the library tomorrow to see if any of the books on 'the list' are there
Thanks again for the help
 
@AlexM. how does one learn F#
 
@Borgleader there's the F# for fun and profit site
 
Honestly though, I don't know where I'm losing the performance here.
 
Ell
How on earth did my friend convince me to go to Cardiff
 
1:52 AM
@Borgleader this one: fsharpforfunandprofit.com
 
Ell
That involves me getting up at 07:00 in the morning
 
@ThePhD pssssttt @Mysticial help a phd out ;)
@AlexM. thx
 
One more question... if im was using namespace x, I could further define x::bar (or ::bar?), correct? Similar to Java extend ?
 
no
 
using namespace x is like import x.* from Java
 
1:55 AM
I'm not sure actually
 
... Wait a second
 
What I do know, is that if you have using namespace x; then you can still use x:: in front of objects or functions in the x namespace.
 
I wasnt sure but no, you have to prefix anyway
coliru.stacked-crooked.com/a/9165aab33def9412 (if i define with just foo() i get a linker error)
 
I've got some gnarly branches in my function calling code.
 
is import static x like using static x in C#
 
1:55 AM
I should probably throw those out.
 
So x::y would be probably ambiguous
 
don't know what's using static
 
Alright, makes sense
 
using static Math;
//can now do Sqrt instead of Math.Sqrt
it just brings everything in the scope
everything that's static
 
import static
 
1:57 AM
essentially shoe horning free functions into the language
 
is Math a class? if so, then yes
 
ye class
 
Just like C#'s static classes (i.e. classes you cant instantiate and only containt static things, aka namespaces for free functions)
 
so java had import static
before C# had using static
THIS CANNOT BE
 
Well its not like its an awesome feature anyway
 
1:58 AM
tbh
it's only good if you use lots of those functions and the place they come from is obvious so you want to reduce boilerplate
there is one place where they're really good tho
 
well, it's an improvement over what Javaers did before import static was introduced
 
switch (myWindowType)
{
	case WindowType.FullScreen:
	case WindowType.Windowed:
	case WindowType.WindowedFullScreen:
	default:
}
 
(implementing a dummy interface containing static functions and constants)
 
there is no ambiguity there
just getting rid of WindowType. is a big improvement
so using static on that is great
 
Isn't that like redundant in Java
 
2:01 AM
using static works on enums?
 
ye
 
o.O
 
well enum values are kinda static
it also brings forth constants
 
> 5 Features in Java 9 that WILL Change How You Develop Software
lol
 
will number 4 blow my mind?
 
2:04 AM
@Morwenn well not you
since you write C++
you'll get 5 features in C++ that WILL change how you develop software
in C++ 27 :P
 
> 1. Java + REPL = jshell
> 2. Microbenchmarks are coming
> 3. Will G1 be the new default garbage collector?
> 4. HTTP 2.0 is the future
> 5. The process API just got a huge boost
 
user image
5
@thecoshman Check this out
 
So basically, no new exciting language feature.
 
No value types? Well, that's suckage
Nothing interesting
Also lol Java REPL
let's start every session with a shitload of imports
the third point is not relevant to writing software
 
A new garbage collector will totally change the way people develop software.
 
2:07 AM
> "Whats the first game you will show your kids?"
 
it won't, unless you're actually hit by problems with current garbage collector in Java... you aren't, are you?
 
baldur's gate
on a pentium 3 with a 4mb video card
that shit will stay with that PC until he's 16
so he knows the pain
the little shit
 
Seriously, that's boring. If C++ gained crazy features that slowly, we would call it C99.
 
Next question: are static factory methods a best practice (given the right circumstances of course) in C++?
 
wait what happened to the book
 
2:12 AM
@AlexM. library. tomorrow.
 
@AlexM I get the whole RTFM. But I learn through trying to understand as much around something as I can, and every answer presents more questions. The fucking manual doesn
 
@IsaiahTaylor question too overgeneralized
 
't always present the answers in that format
 
I dunno static factory methods are a best practice where the other practices are worse I guess
 
well if someone would be aiming a gun at me and shouting "USE THE STATIC FACTORY METHODS", that would a right circumstance... I think
 
2:14 AM
say, you made this nice testing lib and you let me build some kind of thing using what I want in it
var thatNiceThing = NiceThingBuilder.defaultNiceThing.withProp1("something").withProp2("somethingEls‌​e")...Build();
cant beat that
 
Set<String> set = Set.of("a", "b", "c");
 
esp if that nice thing is immutable
 
So exciting.
 
@AlexM. I'd say this is a bad emulation of named arguments
 
except piping doesn't look bad
and a constructor with 10 arguments does
 
2:16 AM
...why do you have a constructor with 10 arguments
 
because that's your alternative to providing the customization offered by setters
to an immutable object
furthermore
withProp1 can be lots of things with meaning added by the builder
e.g. PersonBuilder.regularJoe.readyForX().build() <-- readyForX can change many things about regular joe to make him ready for X, and the rules are part of the builder
 
elegant
 
If you need to convince someone of the impact of cache misses on performance tell them that their program's memory access patterns are like those "first mallocs" and that some reorganizing could bring them in the "third malloc" state.
 
2:26 AM
@Borgleader Yep :D
 
> Magic: The Gathering: Man Charged With Theft of Card Collection Worth $10,000, Officials Say
Micheal Thomas Coates is accused of taking nearly 400 cards at an event in January, Lethbridge police said. Police said that 35 cards were recovered but 350 remain missing.
damn, thats a lot of money
 
Mike's logic is really straightforward on this topic.
 
@StackedCrooked wow that's informative
 
@Borgleader Yep.
 
that's rare thing nowadays in lounge
 
2:30 AM
However, don't let them think they should call malloc a lot :)
 
@milleniumbug When I'm informative about MinGW you feel the need to double-check é___è
 
@Morwenn his claim was more believable
:D
 
As you can see, @Morwenn, milleniumbug is naive.
"Nobody would ship crappy code like that in their stdlib".
 
:D
 
2:35 AM
doing it on a chair sounds awfully easy to break something
 
depends on the weight of the participants and the quality of the chair
 
do you also make lateral movements when you have sex on a chair
maybe you can fall off?
you can fall off a bed too I guess
maybe the floor is the safest spot
I wouldn't know
time to sleep cya
 
@AlexM. G'night.
@StackedCrooked It wouldn't surprise me if that first one was more than just cache miss--more likely includes a switch to kernel mode to allocate some physical memory for your process to use as its heap.
 
wow even more informative
what's happening to the lounge
that would explain why the first allocation there takes way longer than the first after each delay
 
@JerryCoffin The very first one yeah.
 
2:48 AM
@milleniumbug Shitposters are on discord
 
@JerryCoffin Notice that I free the memory after each test. So it shouldn't do kernel calls after that.
 
@ThePhD yep, I sent it off last Saturday
 
@jaggedSpire v. nice
Ugh.
 
@ThePhD I hope that's how he finds it. :P
?
 
I wish I could control more than the individual bits here.
I want to be able to statically analyze a whole expression damnit.
 
2:51 AM
ah
 
Maybe I can make the "safe" assumption that function_result won't ever get auto'd...
... Yeah, I'll do that and just document it.
 
@StackedCrooked Exactly--that's (probably) why the second time around the penalty is ~1k cycles, vs. ~70K for the very first.
 
Hm, I should add a comment about that.
I don't want it to be misleading.
 
@StackedCrooked Doesn't seem like it could hurt anything, I guess.
 
@ThePhD WOW that's disappointing
 
2:58 AM
Anyone know if you can transfer github issues between repos?
@HubertApplebaum Cut me some slack, I haven't implemented traverse yet. :<
I'm sure when I do performance will be up again...
 
where is my slack cutter
 
near the pizza cutter
 
I just re-opened that issue in sol2 because of that benchmark.
I thought "eh not a big deal"
And then that benchmark uppercuts me in the mouth
Also, the fact that my member function calls are 2x slower than kaguya's worries me greatly.
Why are they so fuckin' slow? :<
 
Reading The Cathedral and The Bazaar
> the older system is still valid at low energies, but if you push mass and velocity high enough you get surprises like nuclear explosions or Linux.
 

« first day (1946 days earlier)      last day (2993 days later) »