« first day (1047 days earlier)      last day (3907 days later) » 

3:00 PM
@EtiennedeMartel I don't know what scam that was, but it looked funny.
 
@CatPlusPlus I heard it was legit.
 
Right.
 
What scam?
 
A Polish woman wants to break a record by having sex with 100,000 people.
I forwarded the link to Cat.
 
user784668
Whaaaat.
 
3:02 PM
It's down now.
 
user784668
Citation needed.
 
Also regardless of scam status, :laffo:
 
Guess it's time to think about the interface. I have group(r) with 'all defaults', so identity projection and regular comparison. At the other end of the spectrum I can add one group_by(pred, proj, r) where everything is user-supplied. I think I should also expect that a custom projection with default comparison is a common use-case.
Not sure if I really need different names for that. Let's try writing the manipulators.
 
Xeo
Any reason the range is last, and not the predicate? Otherwise, you could just have default arguments.
 
Currying, i.e. foo(a, b, c, r) == manipulators::foo(a, b, c)(r).
 
Xeo
3:07 PM
ah
 
Then bar(b..., foo(a..., r)) == pipe(foo(a...), bar(b...))(r).
 
@Xeo Ease of implementation is not too high on the list in that case though. Default arguments and overloads taste the same to me.
@CatPlusPlus Impressive.
 
@CatPlusPlus Interesting!
 
I wonder how header rotating will affect sessions.
 
3:18 PM
Alright, I'm thinking group(r) with all defaults, group(pred, proj, r) with all user-supplied, and group_by(proj, r) for just a user-supplied projection. With matching manipulators.
 
Xeo
It feels like writing all those manipulators would be a shitton of work
 
constexpr auto group()
-> decltype( detail::curry(operators::group {}) )
{ return detail::curry(operators::group {}); }
Ok silly example that doesn't bind anything. Use your imagination.
It's true it's boilerplatey, yeah.
I don't even unit test them tbh. Would make for even more busywork.
 
Xeo
So you're having what now for every algorithm? the algorithm itself, operators, manipulators, result_of, ...?
 
No result_of. I do have tons of operator versions yeah. Manipulators is range-specific.
 
Am I the only one that doesn't like decltype :(?
 
3:24 PM
The things that get result_of versions are those that double as a metacomputation, e.g. tuple_cat.
 
Xeo
What operator do you have for chaining them?
 
compose and pipe. (Same things, reverse order of arguments.)
@R.MartinhoFernandes Are you going to scrap all those namespaces come C++14?
 
@LucDanton No, because I won't change targets.
 
Xeo
@LucDanton Ah, so no actual operators?
 
Oh come to think of it the range stuff does have a naming convention where foo returns foo_range, so that really amounts to the same.
.. and the rest returns foo_type.
@Xeo Right. Still keeping my focus on functionality, not syntax/bikeshedding.
 
Xeo
3:26 PM
I see
 
I'm still not sure how to feel about all those operations implemented as public static member functions.
 
Xeo
Hm... I got one book on my Nexus right now for the 5h train ride later
 
@Luc so you still have priming?
 
yup
 
I am starting to feel like I'm fighting against having it too much :/
 
3:29 PM
I seriously don't understand why xeo & luc can not start a room of their own ... it is not like they ever talk to anyone else other than robot anyways
maybe they can take robot with them?
 
ana is the only range that computes stuff in its constructor IIRC. And I feel that it's more due to the un-naturalness of pure FP vs mutation (cf. generate).
 
@LucDanton What's your generator function like?
 
For ana or generate?
 
(I have used like three or four different styles, and I keep forgetting which one I picked for mine)
@LucDanton ana.
 
Xeo
3:31 PM
@R.MartinhoFernandes Which styles? I can only really think of optional-based right now
 
(s -> Maybe (s, a)) IIRC. With concepts::Nullable and concepts::Tuple.
 
Xeo
Also, I wish there was a C++ compiler on Android
 
@Xeo It appears I have (() -> Maybe a) right now.
 
^ generate
 
unsafePerformIO :v
 
3:33 PM
@LucDanton Oh. Ha, I actually called mine generate too.
 
When I say ana I mean range/primitives/ana.hpp, aka the 'I need to brute-force translate some monad code/range comprehension/SQL/whatever from another language' stuff. And algorithms on paper too I suppose.
 
generate, flat_map and still have no folds.
 
I'm still writing composites more than anything else.
 
I remember I was going to write normalization as a catamorphism, but had to go back and use an anamorphism because the cata version doesn't work in C++.
 
So you went through some highs and some lows? :p
 
3:36 PM
(Functions [a] -> [a] can work as either in Haskell)
 
Damn I've waited so long to say that.
 
hehe
Since that I have felt unmotivated.
It breaks the duality and scares me.
 
What does?
 
@LucDanton Not being able to write normalize as a cata.
 
Ah. I really, really can't imagine you can do better.
Implement stream fusion in your favourite compiler!
 
Xeo
3:43 PM
@R.MartinhoFernandes Why not?
 
@Xeo Because it's eager (IOW cannot consume infinite sequences).
 
I assume producing an unbounded sequence, as usual.
yay, projecting really does work.
 
And if you start trying to work around that you will turn your cata inside out and end up with an ana.
 
Mmmh, so that's ana f . cata g then? Not a hylomorphism at all :(
 
Xeo
So that's what that "high" and "low" was all about?
 
3:46 PM
Ye. It's the only 'exotic' one I remember due to the pun.
 
Xeo
lol
 
Well that and ana and cata are everywhere so you compose them with one another very often.
 
@LucDanton Oh, there's a pun in it.
 
Xeo
@R.MartinhoFernandes Wait, how does fold (in Haskell) deal with infinite sequences in general? Laziness to the rescue again?
 
o_o
@Xeo Right. The language semantics make it magic.
 
3:49 PM
@R.MartinhoFernandes The naive call stack of a hylo goes .. i i l l i i .. :p
 
@LucDanton There are so many operations that can be expressed as hylos (as in the generic ones, not necessarily list-hylos)!
 
Xeo
But as soon as you use the result of the fold, an infinite range will wreak havoc, no? Although I guess that's not necessarily the case if you're creating another range.
 
Maybe I should investigate that. I don't think I feel like implementing the 'dirty' version of group.
 
Xeo
@R.MartinhoFernandes I guess there's another word I need to learn now? :s
 
@Xeo No. Not unless you decide to consume it all (say, length fails, but take 5 works)
 
Xeo
3:50 PM
@R.MartinhoFernandes k
 
@Xeo I considered linking you a nice read on lenses today but it requires a lot of background. I really liked it because it explains what's the deal with the different representations of lenses, but it doesn't touch lenses themselves in the first place too much.
 
Xeo
I tend to think of fold as [a] -> b where b is not [c]
 
@Xeo It's the difference between building your data structure that evaluates lazily and having it builtin everywhere in the language.
 
^ implementing ranges means playing the compiler, it's a refactored for-loop and I have to juggle my quasi-stack. It's boring.
 
@Xeo And ana as a -> [b] where a is not [c]?
@Xeo (exercise: implement map as a fold! And then unfold.)
@LucDanton No need to tell me about it :|
 
3:55 PM
Heh, I've started to enjoy F.fold M.mempty (M.<>) to convert from one 'container' to the other (where F == Data.Foldable and M = Data.Monoid). Or the other way around.
@R.MartinhoFernandes I was concurring :)
 
Man, there's hair all over my desk.
 
Do folks still put types in their variable names in C++, or has intellisense pretty much eliminated the need to do that?
 
It's like I turned into a cat or something.
 
Xeo
robot-turned-cat-turned-robot
 
@RobertHarvey You mean that pszCrap?
 
Xeo
3:57 PM
@RobertHarvey intellisense has got nothing to do with this
 
Hm? Roll over the variable name, get the type. Profit.
 
posted on August 28, 2013 by Ankit Asthana

Optimized Debugging or in other words the ability to debug optimized code has come across as an important feature request in previous surveys. As we start planning for the next version of Visual Studio we would like to better understand the experience that Visual Studio provides today. In addition to this we would also like to gather requirements on what additional debugging information is r

 
Xeo
why care about the type in the first place? :)
 
:/
@R.MartinhoFernandes Guess that answers my question.
 
@RobertHarvey With type inferrence nowadays, I believe the community is shifting towards the complete opposite.
As always, there are still some people holding to their traditions, but thankfully they are less and less each time.
 
3:59 PM
@Feeds You kinda can already debug with optimizations... I've been doing it for years now?
 
Mmmh, maybe I should put manip versions of consumers to put in the last place of a pipeline.
 
@Xeo I'm honestly starting to get a bit worried. I can't touch my hair without ending up with some strands in my hands.
 
Chemo will do that to you.
 
intellisense is a microsoft thing not C++ thing
 
Whatever its called elsewhere. Don't they call it Intellisense in Jetbrains?
 
4:01 PM
if you are talking about text (variable) prediction, then visual studio should have it
 
Isn't it a trademark?
 
Xeo
Alright, time to get going
 
@RobertHarvey Can't. It's a trademark.
 
Xeo
See you (likely) tomorrow
 
@R.MartinhoFernandes Looks like they call it "on-the-fly code analysis" in Jetbrains.
 
4:03 PM
xcode & eclipse have it too
vim ... why vim, you have to be so dumb
no intelligent sense ...
 
"d. Facebook creep all of the participants before joing the group" Netiquette quiz.
 
Well, fuck.
template<typename T> T foo(T&&); instantiated with T = U const&.
> error| returning reference to temporary [-Werror=return-local-addr]
:|
 
hi, I am facing a problem related to algorithm (tower of hanoi)
 
4:14 PM
if smbdy is there having interest in algorithm we can discuss it
 
"ITT I am going to write the most obscure code that no one would ever use in real life to show off my elite C++ skills" ... but hun, no one ever write C++ this way in commercial products
@rspr newblet: have you prayed to the Goddess of hacking and good coding yet?
better show some respect or else you might be cursed to the damn filled with demons of ill logic
 
user1804599
¡Hola!
 
OMG it works.
 
what works
 
praying to the Goddess of hacking and good coding of course
 
user1804599
4:24 PM
it
 
@melak47 I'm doing useful and not cumbersome type-based computation in Haskell.
 
k I have a hylo, let's bench against ana+fold.
 
lol
Do you know quicksort is a hylo?
Towers of Hanoi is a hylo!
Natural addition is a hylo.
 
4:39 PM
range/range.hpp is big enough as it is, I'm going to put the manipulator versions of put and fold in range/consumers.hpp.
 
4:52 PM
Running benchmark	range_hylo...
Running a comparison against reference 'hylomorphism (composition of fold and ana)'
Reference took				 to compute result
              	254ns					23436
Feature 'hylomorphism (unrolled by hand)' took	 to compute result
         	187ns					23436
Results agree:	true
Relative time difference against reference is -0.26378
It's a bit disappointing tbh.
Let's try fold and generate.
 
Do compilers usually do copy-elision with optimizations disabled?
 
@LucDanton What operation are you performing?
 
@R.MartinhoFernandes Summation of integers up to N.
 
@Mysticial I wonder the same thing.. also is copy-elision always an optional thing?
 
@willj Yes, it's always optional. However, implementations are required to be able to determine if the copy elision criteria hold for other purposes (treting returned lvalues as rvalues), so only something purposedly dumb like Hell++ would skip the opportunity for optimisation.
 
5:03 PM
Hell++ detects it and inserts more copies.
2
 
Hey guys. What would be the year when an AI is created with an intelligence that matches that of the human, your predictions?
 
@LucDanton Opportune deoptimisation.
 
user1804599
@DesmondHume With the intelligence of the average human? Twenty years ago.
 
@DesmondHume 2038
 
How exactly does system() work?
 
5:07 PM
@Pawnguy7 It spawns a shell and sends the given command to it.
Don't use it.
 
user1804599
 
user1804599
> The value returned is -1 on error (e.g., fork(2) failed), and the return status of the command otherwise. This latter return status is in the format specified in wait(2). Thus, the exit code of the command will be WEXITSTATUS(status). In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127).
 
I have heard don't use it many times, but I never really heard how it works.
 
It's a convenience API that's not really convenient for anything, including fire-and-forget processes.
 
An alternative error handling strategy for C++ http://zenol.fr/site/2013/08/27/an-alternative-error-handling-strategy-for-cpp/ #cpp
Did you guys see this article? I think it's a terrible idea.
 
5:10 PM
@MooingDuck Did you see the giant Reddit discussion?
 
user1804599
int system(char const *command) {
    int pid = fork();
    if (pid == -1) return -1;
    if (pid == 0) {
        if (execlp("/bin/sh", "/bin/sh", "-c", command) == -1) return -1;
    } else {
        int stat;
        waitpid(pid, &stat, 0);
        return WEXITSTATUS(stat);
    }
}
 
user1804599
@Pawnguy7 Approximately.
 
Here, several people in here have commented :p
http://www.reddit.com/r/programming/comments/1l6kan/error_handling_using_monads_in_c/
 
user1804599
Oh God, recompiling PHP with MySQL support.
 
user1804599
 
@MooingDuck It'd be a good idea if C++ had core language support for monads.
(And possibly be more like Haskell than C++)
 
user1804599
Erlang has best error handling. Error handling is completely separated from logic.
 
I fail to see any benefit of his code over exceptions. Maybe "true" monads would have benefits, but his code doesn't appear to have any
It's harder to read and write, and only has once "exception" type.
 
To summarise system(), like most things in libc it is completely useless and there's literally no reason to use it ever. For anything.
@not-rightfold spawn :v
 
user1804599
@CatPlusPlus why?
 
5:14 PM
Shorter. Why not?
 
user1804599
huh
 
I never liked fork/exec.
It's counterintuitive.
 
user1804599
I can't find a manpage for spawn.
 
@MooingDuck Mostly because it's been crammed into C++ instead of following a natural language feature. It would probably be more appealing if C++ had native support.
 
5:16 PM
@chris at this point I still don't see the benefit over exceptions. It looks sortof like exceptions, but worse. Why would we build something worse into the language?
 
user1804599
@CatPlusPlus Oh nice.
 
I saw spawnlp etc. somewhere once, but maybe that's something old and retired.
Not exactly keeping tabs on POSIX.
 
user1804599
Meh I wrote dirty code today.
 
@chris wait, nevermind that, I'll just go look up maybe monads
 
user1804599
if (lastByte == '\r' && currentByte == '\n') {
    return someStuff(buffer.TakeWhile(c => c != '\r').ToArray());
}
 
5:17 PM
@MooingDuck Well, more from an actual monad point of view. Everyone seems to love them, and I need to go learn more Haskell.
 
user1804599
There must be a better way to get rid of the trailing '\r'.
 
Monads enable programmable flow pipelines.
And that enables exceptions.
And more stuff.
 
Summary of Lounge<C++>: monads are nice, but they must come with syntactic niceness (e.g. do-notation).
 
Laziness is nice, too.
 
Nesting binds and/or Kleisli composition is iffy.
When I truly hate myself I mix those with applicative style :v
 
5:19 PM
@CatPlusPlus Both inside and outside of the language.
 
@StackedCrooked maybe you should cache some of those, and use a hash to look them up faster
 
Don't say we didn't warn you. :v
 
ffs stale reference ruining my day
 
> High risk flaws (potentially leading to system compromise):
> ...
> * Locations accepting HTTP PUT.
:v
 
5:26 PM
It's exactly 42 clock cycles. — Paul R 1 hour ago
 
Is that Intel C++ Android compiler a trial to download or a trial to use?
 
Ah, , where every benchmark is useless and the timings meaningless.
 
Never know when you might use something like that.
 
@CatPlusPlus where did you read that?
 
@chris That question doesn't make sense.
 
5:28 PM
Ah, I thought you were talking about coliru.
 
> For this release only and for a limited time, download the compiler for free. Stay tuned for more information.
> For a limited time, try Intel® C++ Compiler for Android for free
The first suggests you can only download it for free for a while, and the second suggests the same for using it.
 
@CatPlusPlus Why not HTTP DELETE while we are at it?
 
user1804599
COMPAREANDSWAP
 
Eh, I'll assume download.
 
Yeah, using generate instead of ana leads to better codegen. Makes sense.
 
5:32 PM
Are there any docs describing colirus features?
 
@CaptainGiraffe my doctor doesn't know about coliru
 
@StackedCrooked My doctor confuses exp() and ln() so thats all in order.
 
there's the q&a link in the toolbar
 
It compiles code.
What docs do you want?
 
@not-rightfold I am starting to like erlang.
 
5:39 PM
@CatPlusPlus I was looking for feature support
 
@CaptainGiraffe It doesn't support features.
 
@StackedCrooked So... bugs only?
 
It doesn't support bugs.
 
user1804599
@StackedCrooked Are you talking about Java?
 
5:42 PM
@StackedCrooked So it's not really a compiler.
 
@CaptainGiraffe It's just a webservice.
 
It's more of a shell command evaluator with file input.
 
It's Coliru.
 
user1804599
It's shit.
 
5:44 PM
@StackedCrooked There should be a Jingle for it.
 
@not-rightfold What's your IP? I'd like to ban it.
 
Ban Zoidberg.
Heh.
 
What happend to ThePhD?
 
We don't know.
 
@CaptainGiraffe He returned to his planet.
 
user1804599
5:45 PM
@StackedCrooked 66.249.66.1
 
He doesn't call, he doesn't write
 
He's a mute analphabetic.
 
@StackedCrooked He didn't even mumble?
 
@StackedCrooked 68.57.276.14 here
 
192.168.2.384 don't you guys use protection?
 
5:51 PM
Internal network IP.
 
@CatPlusPlus Was it the 384 that gave it away? (sry couldn't help it =)
 
Didn't read that far.
 
Giraffe 1 - Cat 0
 
Xeo
I want wifi on my train travels
 
user1804599
Pfft. My IP is 2a02:2308::216:3eff:fe24:3327.
 
Xeo
5:54 PM
:<
 
@not-rightfold No that is your Mommas dress size.
 
user1804599
My momma doesn't wear dresses.
 
I have no comeback to that that isn't old, hurtful, funny, or even tangentially relating to her pre op state.
 

« first day (1047 days earlier)      last day (3907 days later) »