« first day (973 days earlier)      last day (3967 days later) » 

12:00 AM
Yes.
 
user142019
I would use a for loop.
 
I guess I'd write some range library, or perhaps using Boost.Range
but I don't know that very well
 
Xeo
That's what I mean
You have to write such building blocks first
 
Yes, now I see
 
Boost.Range is pretty primitive too.
 
user142019
12:01 AM
@StackedCrooked So?
 
I thought you were talking about core language
 
I don't get why that's a bad thing.
 
With overloading it becomes possible to write a generic print function for containers std::vector<std::map<T, U>, etc..
 
Xeo
@Rapptz What?
 
I think that's cool. And it raises the language to a higher lever than mere imperative.
 
12:01 AM
Because it adds noise to the code and masks the salient functionality.
 
@Xeo Having to write your own building blocks.
 
Oh that's worse.
 
user142019
@StackedCrooked So?
 
Uh and you can't see how that's a bad thing how
 
user142019
// You still have to write.
// step 1
auto container = make_container();
// step 2
print(container);
 
12:02 AM
@rightfold It's getting late, kids should go to sleep :P
 
You don't see how reusability is good, or what I don't know
 
user142019
It's getting weekend, you shouldn't sleep at all.
 
Uh no?
I said I don't get what's so bad about having to write your own functions.
 
@rightfold Indeed, it's not nirvana yet. But it's much better than having to write max_f, max_i functions like in c.
 
I.. what
 
12:03 AM
Just forget it.
I don't care.
 
@Xeo Ha, you think functional now, hehe.
 
@Rapptz How irresponsible.
 
For every composite range I have to write e.g. range::filter, range_operators::filter and range::manipulators::filter. It's repetitive boilerplate.
 
user142019
@StackedCrooked Imperative programming doesn't mean that you cannot have generics, overloading or polymorphism.
 
@StackedCrooked I just don't feel like repeating three times if it apparently doesn't make sense the first time.
 
12:05 AM
@LucDanton What's that last one?
 
I just don't know how to respond.
 
@R.MartinhoFernandes Curried version, result is [a] -> [a]. You pass it every other argument.
 
@CatPlusPlus with more lollipops
 
Xeo
@R.MartinhoFernandes I told you already that you guys converted me.
 
@Rapptz If you are being attacked about something you said you just need to be quiet for a while and they'll forget.
 
12:05 AM
You know the concept of reusability and how it's beneficial, but can't see how having to write your own reusable components is against concept of reusability
Or something
I really don't know
 
user142019
Reusable code is code that is well-formatted so it's easy to copy and paste.
 
I'm probably phrasing that wrong
 
@Rapptz It's not really clear to me who you are talking to here.
 
@CatPlusPlus Assuming I only have to write it once I don't think I care.
 
@StackedCrooked IME function overloading, aka ad-hoc polymorphism, is not powerful enough and tends to add significant complexity to languages.
 
12:07 AM
If I had to write it more than once then yeah, I agree with you that it's dumb.
 
I'm kinda impressed with how JavaScript libraries are organized. They can really decompose that shit.
 
So if C++ had no containers, you'd be okay with that, because you only have to implement them once?
 
@Rapptz In Xeo's original example std::transform and boost::transform make for already two of writing the same thing.
 
Xeo
@Rapptz People who will use your code will care, likely. And with everyone writing their own stuff and having their own notions of how everything should work, that doesn't make for a beautiful picture.
 
@R.MartinhoFernandes Which features do you consider more important then?
 
12:08 AM
It's effort redirection
 
user1182183
hm is there any CMS you guys can recommend where (guest) users can submit texts and other people can browse them? (eg submit by category)
 
You're writing something, but constantly have to write things that are not directly related to it, but rather should be available as basic blocks already
 
@GamErix you mean like a ...forum? :D
 
I guess dynamic dispatching is much more powerful.
 
user1182183
@melak47 nah too powerfull xD
 
user1182183
12:09 AM
Just a simple index, browsing page by category and submit page
 
Xeo
@StackedCrooked Concept-based overloading, and generic programming through type inference, obviously! :P
 
@StackedCrooked Parametric polymorphism
 
@CatPlusPlus Good way of putting it.
 
Dammit, now I have to go to Wikipedia again.
 
C++ templates
 
user142019
12:09 AM
Strepsils y u taste so good.
 
@LucDanton Must have missed that example.
 
user1182183
I would like to make one myself but I can't design any HTML SHIT.
 
Don't take drugs Zoidberg.
 
user1182183
php part is easy...
 
@StackedCrooked The other forms of polymorphism (parametric, aka templates; and subtype) are more powerful and tend to be simpler in terms of language complexity (well, theoretically... C++ templates are kind of an exception there...).
 
user142019
12:11 AM
@GamErix Gebruik geen PHP, jij dwaas.
 
user142019
Gebruik Python.
 
user1182183
@rightfold oh ja sure welke goedkope webhost supports python webpagina's...
 
user142019
Mijn poepgat.
 
user1182183
Gefeliciteerd.
 
Но гиббериш.
 
12:12 AM
I think it's cool that you can have a function which takes, say, 4 template arguments, and that you then can choose to implement overloads which have one or more of those as a non-template argument. Even better the template function always dispatches to an foo_impl. Then you have a single point for logging etc.
 
@CatPlusPlus lol
 
user142019
@CatPlusPlus :D
 
user1182183
@CatPlusPlus yep
 
@StackedCrooked Cool isn't always a good thing.
 
@StackedCrooked That makes things crazy complex.
 
user142019
12:14 AM
 
It reminds me of pattern matching.
It's not the same of course.
@CatPlusPlus For the compiler perhaps.
 
user1182183
and I thought windows or linux GUI design with C++ is a brain breaker but fuck html just makes it worse.. I love C++ and GUI... compared to html -.-'
 
For reasoning somewhat too.
@GamErix Stop complaining and use Bootstrap.
 
@StackedCrooked Erm, as a programmer you need the ability to reason about the code.
 
user142019
Give your code a reason for its existence!
 
12:15 AM
Oh shit, the cat is back o.o
 
user1182183
@CatPlusPlus ;o that sounds promising
 
user1182183
will have a look right away
 
user142019
@Borgleader As is the Slowpoke.
 
@R.MartinhoFernandes I meant compile time length or amount of generated oject code.
 
You can restrict overloading to a couple of simple patterns, but that amounts to losing power.
 
Xeo
12:16 AM
Question: How often have you really needed overloading, aside from operators and const/non-const?
 
@rightfold I havent been here at all today and I just got home
 
@StackedCrooked Cat was talking about language rules.
 
which variant should i choose
I'm just a beginner
 
@Raindrop Visual Studio 2012
 
12:16 AM
download boost, compile it yourself
 
user142019
@Raindrop All of them, can't be wrong.
 
latest version is 1.53
 
@Raindrop Unless you have a HDD from 2001, pick all.
And yeah get a newest version.
 
I have not yet noticed increased complexity from this. I don't see how it's more complex than a typicial OO design where you have strategies and decorators and shit.
 
@StackedCrooked You never had the wrong overload being picked accidentally?
 
12:17 AM
Not the same thing.
 
@R.MartinhoFernandes Once. Nasty char/int.
 
@StackedCrooked Then I guess you just keep to the simple patterns.
 
user142019
Haha implicit conversions.
 
It's not about code complexity, it's about semantical complexity.
 
That means you don't get much power from it.
 
12:18 AM
I avoid it with things like void foo(T& t) { foo_impl(t, Identity<T>);
 
user1182183
Wow Cat, thanks, I love you!
 
@StackedCrooked Again, both me and the cat are talking about the complexity of the language, not the code you write with it.
 
user142019
Thanks Cat, another website with a boring repetitive default Bootstrap design.
 
I actually think my code is on the conservative side compared to yours.
 
@R.MartinhoFernandes Time to quote the pit of success? :p
 
user1182183
12:20 AM
@rightfold well noobs like me don't have much choice
 
@R.MartinhoFernandes You mean for the language creator, but not the user?
 
@rightfold Doin' my share.
 
user142019
@GamErix Hire a web designer.
 
user1182183
@rightfold Oh sure I'mm going to pay someone to make a free website...
 
user1182183
from which I won't even have any revenue
 
12:21 AM
What you seem to forget is that Bootstrap is a CSS framework, and default look and feel is mostly coincidental and for prototyping.
 
@StackedCrooked No, I mean the language.
It affects everyone.
 
do eeeeeeeeeet
 
lol
 
user142019
12:21 AM
@CatPlusPlus I am fully aware.
 
So it's only wrong because it looks strange to other people.
 
user142019
It's just that virtually everyone uses the ugly boring default design.
 
Good.
 
@StackedCrooked NO
 
@rightfold I like the default design and I'm lazy SO SUE ME
 
Xeo
12:22 AM
@R.MartinhoFernandes Wait, what?
 
:<
Also I really can't be bothered with L&F.
And the icons are great so WHATEVER
 
If the language rules are a gigantic arcane behemoth (C++ overloads and templates, I'm looking at you), writing code in it is like walking on one of those Star Wars railless bridges over bottomless pits.
Even C# overloading rules are a fucking mess.
 
user142019
Haha C++.
 
At least C# doesn't have that many implicit conversions.
 
Is there a language where overloading rules are not a mess?
 
12:24 AM
@Xeo C# throws you into the pit of success, i.e., it makes it easy to do the right thing, and hard to do the wrong thing.
 
Isn't that mostly due to implicit type conversions becoming candidate for overloading?
 
@Borgleader Where overloading is governed by constraints on polymorphic types.
 
Such as?
 
Xeo
@Borgleader Overloading through type-classes in Haskell?
 
user142019
> You blocked me on Facebook, and now you're going to die.
 
user142019
12:25 AM
The only lyrics in this song.
 
Xeo
9 mins ago, by Xeo
Question: How often have you really needed overloading, aside from operators and const/non-const?
Nobody answered. :<
 
@Borgleader More or less my point. (this is not a "no" answer)
 
Xeo
@R.MartinhoFernandes I see.
 
@Xeo Overloading is the feature I love the most about C++.
 
@Xeo I can live without it.
 
12:26 AM
@Xeo who needs overloading when you can have void HandleAllTheThings(void* thing_or_maybe_things);
 
Xeo
@StackedCrooked I didn't ask for preference. :P
 
@StackedCrooked Overloading interferes with pretty much all other polymorphic stuff in the language.
 
I use overloading when I use ostream, min, max.. I'd need to check my code for more specific examples.
 
@Xeo Quite a bit.
 
12:28 AM
@Borgleader In ML (the original, not Caml, Ocaml, etc.) they're somewhat sparse/restrictive, but not particularly messy.
 
Xeo
@StackedCrooked ostream is operators again, so yeah.
 
@Xeo Constructor overloading is the primary one, as well as assignment-op.
 
Xeo
min/max are templates, or what do you mean?
 
Oh templates are excluded?
 
Bleh...
I hate configuring this Linux server.
 
12:29 AM
@Xeo Main design principle driving ogonek's design.
 
@StackedCrooked That could be easily implemented without overloading.
 
I have wrappers for ntohl, noths etc.
 
This is so much goddamn work just to give these fuckers their TFS Code REview shit
I would rather fucking write a TFS <-> Perforce Utility myself
 
@Rapptz Templates (parametric polymorphism) are not overloading (ad-hoc polymorphism).
 
This is next-level ridiculous shit.
 
12:29 AM
template<typename T> void foo(T); template<typename T> void foo(T, int); uses overloading, unquestionably.
 
Xeo
@Rapptz If they're not overloaded. (I know that a function template can be seen as an infinite group of overloads, but ignoe that.)
 
What about namespace detail { /* implementation detail with same name */ } actual function ...
I do that quite often.
 
That's not overloading either.
 
I guess.
 
Xeo
@ThePhD Hah, you got one?
 
12:30 AM
what about something like std::to_string?
 
user142019
@StackedCrooked class HasEndianness a but with a less retarded name. :3
 
it seems to me like if you did not have overloading, you could not generically call the function
 
Xeo
Better handled by type classes / concept (maps?), and a perfect example, really.
 
When implementing something like std::future<T> execute(F&&) I use overloading to deduce void or nonvoid return type.
 
@Xeo I am currently setting up a Hyper-V on my own machine. IT has refused to get back to me, just like the other 3 e-mail chains sent me 1 e-mail, and after I respond, go absolutely quiet.
 
12:30 AM
6 mins ago, by Cat Plus Plus
@Borgleader Where overloading is governed by constraints on polymorphic types.
 
Usually I only overload methods.
 
std::to_string is literally show :: Show a => a -> String
 
Not so much free functions.
 
I like that we have std::begin and std::end now.
 
They're really throwing me under the bus. Tomorrow, I'm going to just write my own TFS <-> Perforce utility and tell everyone else to fuck off.
 
12:31 AM
@CatPlusPlus I like that one too.
 
Xeo
@StackedCrooked Eh, might count. Fault of C++ for not having a Unit type, though, I guess. :P
 
@CatPlusPlus Well, of course I do, since I just love overloading :P
 
void is gross.
 
Whatever... 2n42i
IT'S FRIDAY
 
Xeo
I'd wager that, looking at what you overload, it'd work better with type-classes, which are a richer, more powerful and saner feature than ad-hoc overloading.
 
12:32 AM
I'M OUT OF HERE
 
@ThePhD K
 
@Xeo Yup.
 
Hits eject button.
 
@CatPlusPlus The void is not merely gross, but infinite.
 
Xeo
@StackedCrooked Again a great candidate for type classes. :)
@ThePhD lol
 
12:32 AM
Eh, I'm not overly fond of type classes.
 
user142019
@Xeo std::tuple<>
 
They're fine.
 
@Xeo I want those too. Esp I do think it's frustrating that the constructors for containers are so restrictive.
 
@JerryCoffin That a German joke?
 
@CatPlusPlus Right, but how do I "specialize" Show a?
 
12:33 AM
Doesn't matter.
 
user142019
But yeah screw void.
 
user142019
Screw incomplete types.
 
@DeadMG instance Show ConcreteType
 
Xeo
@DeadMG instance Show YourType where ... for Haskell specifically.
 
where implementation = ...
 
12:34 AM
FWIW, I was clear from the beginning about this, because I knew it would at some point devolve into definitions of vague terms ("overload" is an overloaded term).
 
so basically it's a template that you specialize, rather than overloading
 
27 mins ago, by R. Martinho Fernandes
@StackedCrooked IME function overloading, aka ad-hoc polymorphism, is not powerful enough and tends to add significant complexity to languages.
 
But the point is that there's no overload set, because there's one type and either zero instances (= can't use, error) or one instance.
 
Thanks, I almost forgot.
 
Xeo
@DeadMG 'cept on a higher level.
 
12:35 AM
@R.MartinhoFernandes Vaguely German, anyway. OTOH, I grew up largely with second generation German Americans. Most of their parents somehow figured swearing was more effective if it was done in German, so most of the German I know is swearing.
 
anyway
 
I think the existance overload sets is where things went wrong. Although it gave us SFINAE.
 
the main place where I'm really not sure what you could do without it would be constructors.
 
It's the ad-hoc nature
of ad-hoc polymorphism
Who knew right.
 
Xeo
@StackedCrooked SFINAE is a hack.
 
12:36 AM
 
user142019
data User = User { userName :: String, userAge :: Int }
class Show a where
    show :: a -> String
instance Show User where
    show user = userName user
putStrLn $ show (User { userName = "rightfold", userAge = 18 }) -- prints "rightfold"
 
The fact that C++ has implicit type conversion and overloading is a recipe for pain.
 
@DeadMG Sum types. :v:
 
@Xeo It's a cool hack.
 
C++ has all the bad design decisions.
 
Xeo
12:37 AM
You again with your "cool". :P
 
@CatPlusPlus Aren't those run-time polymorphic?
 
As much as variant<> is I guess.
 
so what you're suggesting is that I replace the static overload resolution for constructors with a run-time cost for every single type (since I need to overload, say, virtually all of them for default, move, etc)
 
Bloo bloo runtime cost.
 
@R.MartinhoFernandes I am, however, reminded of a much funnier version of the same (that I may have told here before). American family in Germany walking along the street, and sees a German guy peeing between a couple of buildings. Teenage girl looks, wrinkles her nose in disgust, and says: "ewwwww...gross!" German finishes up, walks about to the street, smiles widely, and says "Danke shein!"
 
12:39 AM
I see
 
I don't care about runtime costs, I care about language semantics here.
Besides, even without them I'm not sure how constructors would be a problem.
 
A like that static visitor can capture all cases with a template operator(). Because it can be used as a hooking mechanism.
 
Xeo
Not that there necessarily is a runtime cost.
 
But then again I don't want to think about it.
 
@JerryCoffin :) (it's "Dankeschön")
 
Xeo
12:40 AM
@R.MartinhoFernandes Might count as dialect.
 
@DeadMG No matter how much you overload the C++ constructors all instances of the type have the same state space.
 
@LucDanton Sure, but you really need to know which constructor to call.
 
Eiffel has named constructors. (and no overloading)
 
user142019
Objective-C :3
 
@R.MartinhoFernandes See earlier comment -- all I really know is swearing. Worse, most of them were really "German Russians". Originally Hessians who were hired by a Czar, and stayed in Russia for the next few centuries, so what they spoke and what was spoken in what's now called Germany grew apart quite a bit, most likely.
 
12:41 AM
@DeadMG Yes.
 
Xeo
1
A: Is there some trick that would allow me to pass stream manipulators to a variadic template function?

Andy ProwlThe problem is that manipulators like std::endl are function templates. Therefore, you have to be explicit about which specialization of that function template you want to be passed (otherwise, no type deduction is possible). For instance: f(1, 2, 3, &std::endl<char, std::char_traits<char>>); /...

 
Only during the last year I started caring about performance due to my current work project. I believe @LucDanton reviewed my multithreading old utilities and was appalled by the many indirections.
 
Xeo
[]lalala
 
@Xeo Heh.
 
@Xeo right
You should work on that proposal :)
 
12:43 AM
I'm indifferent to indirections.
 
Xeo
I should indeed.
 
@LucDanton So if you have something like map::emplace, how do you propose that is implemented when it comes to forwarding the arguments?
 
What meaning of forwarding?
 
Ew mutable types.
 
Xeo
@DeadMG You two already discussed this.
 
12:44 AM
Better question
 
Today that code would look esp bad now that we are used to moving and forwarding.
 
What the hell is LightSwitch
 
I'm pretty sure I asked the robot, and I thought his solution was quite subpar
 
And what does it do in my VS2012.
 
@CatPlusPlus The type can change at runtime?
:P
 
12:45 AM
I like that my usage of "esp" is catching on
 
Xeo
@DeadMG True, it was with the robot.
 
user142019
@StackedCrooked Ruby!
 
Xeo
May 7 at 12:22, by DeadMG
@R.MartinhoFernandes It's a solution to the fact that map::emplace cannot know what parameters you might wish to pass to the constructor of some arbitrary T.
 
@LucDanton Well, if I currently do new (mem) T(args); how is the map going to know which constructor to call if the constructors are named rather than overloaded
 
As evolutionary beings we change our types over time as well.
 
12:46 AM
@Xeo I seem to recall that it involved passing umpteen trillion constructor objects everywhere and had about the same scalability as Java's checked exceptions.
 
Xeo
@DeadMG It's basically just another argument, so yeah.
 
I mean, seriously
 
You make it look like constructors are special, but they're not. It works like for any other function. (Speaking as what is done in the Haskell world, not about how things should or shouldn't be.)
 
I need of a lollipop -> candies converter...
 
if you have variant<X, Y, Z>, then you might need a default, move, or copy constructor for all of them.
 
12:47 AM
@Jeffrey Spell.
 
@CatPlusPlus MS' new idea of how to develop 3-tier database applications, if I'm not mistaken.
 
@CatPlusPlus Where d'you do them?
 
@Jeffrey Sorceress.
 
So if you don't want to commit to any particular signature you'd accept a simpler function and let the caller worry about passing the correct closure.
 
user142019
class X {
public:
    default ctor foo() { … }
    move ctor bar() { … }
    copy ctor baz() { … }
    ctor boo() { … }
};
 
12:49 AM
The solution to most situations is 'accept a function' btw.
 
Xeo
@DeadMG Think again - this isn't much different to how, today in C++, you need to either have those types be building blocks that handle that stuff themselves, or write the constructors of the containing type yourself to handle all three.
 
Haskell doesn't need move or copy ctors though.
(And thank gods)
 
Right thanks
 
@LucDanton The issue with that is scale. If I have a tuple<T...>, how many constructors is it going to need to call?
 
@CatPlusPlus They must be jealous.
 
12:50 AM
As a value type?
 
of course
 
@StackedCrooked Nobody is jealous of value types.
 
Xeo
@DeadMG How many arguments do you have to pass anyways?
 
@DeadMG No I meant of the map. There was a map in the example.
 
@Xeo Dunno.
@LucDanton Right. The tuple and the map are separate examples. If I have make_tuple(args...), then I'mma need a closure for every argument.
 
12:52 AM
Also seen through a C++ lens nullary functions are really a in Haskell (i.e. values). So the caller would call as many constructors as they'd need to and the client code would call none.
 
and on top of that, if I copy a tuple, I will need another closure for every contained element. And the same for moving it, assigning it, etc.
 
@DeadMG No. The closure/value is for the tuple.
 
Xeo
@DeadMG And if you want default construct them, hello new concept, type class, whatever with a function default that does the work for you.
 
so the number of closures involved here is rapidly becoming ridiculous.
 
Or is this some kind of uses_allocator situation?
 
12:53 AM
In C++ you can design your objects to have optimal memory layout for underlying machine. Are things like this considered valuable in the Haskell world? Or to they shun such low level things.
 
@DeadMG I wouldn't expect it to, for a tuple.
 
well, it seems pretty obvious that any design that calls for the user to pass a whole bunch of closures to tuple is broken
 
51 secs ago, by Luc Danton
@DeadMG I wouldn't expect it to, for a tuple.
 
user142019
@StackedCrooked Haskell programmers have post-50s computers.
 
2 mins ago, by Luc Danton
Also seen through a C++ lens nullary functions are really a in Haskell (i.e. values). So the caller would call as many constructors as they'd need to and the client code would call none.
Read carefully. (Said kindly.)
Also a reminder that Haskell uses non-strict evaluation.
I wouldn't know how it's done in e.g. OCaml where it's strict.
 
12:55 AM
I'm not really interested in solutions that change something radical, like making everything references or something
 
@LucDanton Lazy evaluation was mentioned in our previous discussion too.
 
(I mean IME you use the constructors and pass the values but I can't claim to know idiomatic practices, or how the hard stuff happens.)
 
@StackedCrooked Memory layout is an implementation detail.
 
@DeadMG FTR I'm not selling anything.
 
fair enough
 
12:56 AM
Haskell GC can do crazy things with memory layout, like moving nodes of a linked lists close together.
 
I just don't see how this can not lead to an explosion and insanely large number of closures
 
@CatPlusPlus But that doesn't make it irrelevant.
 
I guess you can use primops and unboxed types if you really want but ugh that's optimisation step not implementation step.
 
@CatPlusPlus That's cool.
 
@StackedCrooked It's irrelevant to me when I'm implementing a thing.
 
12:57 AM
@DeadMG Ah. Much of the point of using a language like so is to reason about the semantics of the program. It's not about commanding the compiler/runtime.
 
Just like exact order of operations is.
 
user142019
> hPutChars handle str -- v. slow, but we don't care
 
user142019
lol
 
user142019
In GHC.IO.Handle.Text.
 
@LucDanton Reasoning about a program that can't do much is of limited value, hm?
 
12:59 AM
@StackedCrooked Haskell has become like the old saying about Lisp programmers: they know the value of everything, but the cost of nothing.
 
That's why I mentioned non-strict evaluation. Everything is a moral equivalent of passing a closure, when seen from the lens of a strict evaluation programmer.
 
Herb said in an old video that C++ means something different for everyone.
 

« first day (973 days earlier)      last day (3967 days later) »