« first day (1686 days earlier)      last day (3267 days later) » 

5:00 PM
And this was my point forward, when we settled that we weren't talking about C++ in particular (or general limitations of imperative languages, like lack of monads or composition).
 
"lack of monads"
lolwat
 
C++ does not support monads as well as Haskell does for example. You can write monads in both. In one is just simpler.
 
you can formally express the semantics of a program by various "semantic ways"; denotational semantics is compositional and is generally done for function programs, but can also be expressed with imperative stuff - there's a "branch" of denotational semantics called indirect denotational semantics, that lets you specify something like "continuations" - it keeps its compositionality even when exceptions and full stops and stuff is involved
 
@ScarletAmaranth I quite agree--in fact, you usually want the most limited construct capable of doing the job. Just for an obvious comparison, you could do all your flow control with goto, but nearly everybody (especially those who've tried it) prefer to have more limited control flow like while and for loops.
 
Yes, operator>>= I know it exists in C++.
 
5:01 PM
@JerryCoffin yup
 
@Jefffrey wrong associativity though :(
 
Yeah.
 
@AndyProwl I use assignment-variations if I want right :P (&= is favourite)
 
so many exams
fuck
I literally have 7 exams in less than 7 days
lmao
 
@ScarletAmaranth yeah but non-beauty
 
5:03 PM
What Sean Parent doesn't tell you in his "Inheritance Is the Base Class of Evil" talk is how unintuitive it is to to write comparison operators when your container can hold any type and the top-level type doesn't know what type it has.
 
@AlexM. ikr
 
they're all stuffs I didn't pass before
at least some of them are trivial
 
@AndyProwl literally nothing you can do... but macr... I won't go there ^^
 
like this one which consists of building some server + client in C# using sockets or w/e
 
@ScarletAmaranth haha I went there
in a really bad way
 
5:04 PM
> trivial
 
the one about maths tho isn't so trivial
 
@caps Boost.TypeErasure
 
@AndyProwl I'd rather stab myself in an eye with fork ^^
 
I'd be blind
 
@caps That's also a problem with regular class hierarchies.
 
Ell
5:05 PM
@AlexM. That sucks
I had 13 exams last year
 
Binary operations + single dispatch = OOP Suckage (a.k.a. pattern explosion)
 
@Ell I wanna pass them all now
it's the final year
 
@AndyProwl coliru.stacked-crooked.com/a/68c9379fc4d1ef66 (this is as far as I was willing to go)
 
@milleniumbug Is it now?
 
Ell
@AlexM. That sucks
 
5:06 PM
@ScarletAmaranth my crappiest question on SO came from an attempt to implement do notation in C++ using macros
 
@milleniumbug There was a joke-ish thing in one of lightning talks (about multimethods) at C++Now this year: "maybe what we really want is C++ without Classes?".
 
@AndyProwl yeah you basically don't want to do that :D - to be honest, I really just avoid macros basically all the time, even if their use might be justified; I can't debug them, I quite frankly don't understand them very well...
 
@caps Yes. Consider bool operator<(const Base& lhs, const Base& rhs).
 
When you have a container of objects defined as struct object { private: struct concept {}; template<typename T> struct impl : concept { T data; }; };how on earth are you supposed to sort by comparing different types of T?
 
@caps Equality-comparable is clearly not a part of that concept.
 
5:08 PM
@ScarletAmaranth Yeah, I know it was evil
 
Hence... your question is invalid.
 
@Griwes Thus, neither is uniqueness, or sorting.
 
Is there a subreddit where people talk about software they're working on
 
@caps Sure.
 
Ell
Oops my internet made a duplicate message
 
5:09 PM
Want that? Add that to the concept.
It's really that simple.
 
@AndyProwl there is like an entire boost library dedicated to extra macro magic - I still have nightmares after having seen it months ago
 
@caps Either you require this operator to know about derived classes (bad), or you need to write more code to acknowledge overriding (bad), or even more code for "visitor pattern" (bad)
 
And yes, writing all that manually is a PITA. Been there, seen that.
I do really need to look into Boost.TypeErasure one day.
 
@caps Boost.TypeErasure
 
@Ell It's not your internet. It's my internet. Give it back now!
 
Ell
5:10 PM
Boost. type erause. Looks really nest
Man fuck this I'm hoovering
 
Feb 21 '14 at 11:12, by Andy Prowl
@BartekBanachewicz I'd be okay with a hack, I guess. What I'm trying to do is this (just check the end of main())
:D
 
@Ell pirate level
 
(disclaimer: follow the link at your own risk)
 
@AndyProwl I think I'll need an emergency teddy bear for sleeping tonight
 
hahaha
yes that's probably the reaction I expected
 
5:13 PM
how do you debug that shit?
 
lol debug
it was not meant for anything serious, just playing around
 
@caps You can't call operator< on arbitrary types in "your typical OOP language" too.
 
@AndyProwl how do you debug anything with macros :D?
I've never been able to; I just give up all the time
I'd rather go over template-diarrhea (because I know what to look for)
 
They either have to implement ICanBeCompared (in which case you still don't know if you can call a.compare(b) for arbitrary objects a and b.
 
fuck I have a final in logic on Monday and I don't understand linear logic for shit
 
5:16 PM
...or they have to implement ICanBeCompared<T> (in which case you can compare values only with identical types)
 
well, you could extend to ICanBeComparedWith<T, U>
 
my solution is object { friend bool insides_equal(const object& left, const object& right); } where insides_equal calls concept->less() which tries to cast the internals to the same type--if that fails, it calls some virtual functions on concept that are basically like publicly readable properties and compares those, ending with comparing a stringify type function.
 
@ScarletAmaranth When you fail out, that'll go over well in your Women's Study class: "the patriarchal society's linear logic made no sense to me."
 
or just do common_type and PRAY to gods
@JerryCoffin facepalm
 
@ScarletAmaranth I personally try to avoid both, but yes, macros are worse
I accept macro when they contain no executable code
 
5:18 PM
// event loop which is perfect for trial software
void run() {
    write(eval(read()));
    run();
}
 
@AndyProwl I can debug template (meta)programs with (relative) confidence; and it will just be so much sweeter with concepts
 
Yeah concepts should make it more pleasant, but I still don't like templates because of (a) build times and (b) dependencies
and syntactic noise, too
 
I don't think build times can ever be fixed there :-\
 
@StackedCrooked Tail-recursive, so it's fine.
 
I hand-replicated BOOST_FOREACH. I mostly-kind-of grokked it, but man it was naaaaaasty.
 
5:20 PM
@ScarletAmaranth I'm afraid there's not much hope indeed.
 
you need to go over the headers and you need to template all them instantiations out
it's doomed :(
 
@caps Ternary-based type deduction and stuff :)
 
@StackedCrooked Yeah, I thought that was super-cool.
 
you know I've been thinking and it occurred to me
 
@AndyProwl we could do what Haskell does if we had modules; but then you would have to bring some stuff to runtime - and that's not acceptable in C++ community
 
5:21 PM
uni profs have one thing in common
they're crazy passionate about their field of work
 
@caps I agree.
 
At the same time, it's kind of the "bad kind" of "clever."
 
@ScarletAmaranth Okay--I'll admit, that was a low blow. :-)
 
@ScarletAmaranth I'd be perfectly fine with it
 
So many tricks packed into that.
 
5:21 PM
@AlexM. It occurred to you that you were thinking?
 
@milleniumbug I have no idea how you can parse that like that
 
@AndyProwl Concepts + Modules, and then (with a little luck) the only major problem left is the syntactic noise.
 
@JerryCoffin I don't think modules will solve this for templates, unfortunately
 
@AndyProwl I am starting to think even Haskell people are slowly starting to mind... they're already pretty angry at the "type seal / unseal" garbage they drag into runtime; but to be fair, I can't reason about my haskell programs beyond algorithmic complexity; such as reasoning about memory when thunks are involved - lolllololol
 
you'd still have to see the definition
 
5:23 PM
modules won't help unless you're willing to bring garbage to runtime
:-\
 
@AndyProwl Well, they don't solve everything, but they stand a decent chance of fixing quite a bit of the build time problem.
 
@JerryCoffin Not for templates, I'm afraid
for regular code, yes, but templates will still have to be parsed at every instantiation point. That's what I gathered at least. ICBW
 
@AndyProwl Well, we'll see what happens--but I think they'll help (and I'm pretty sure the intent is that they should).
 
Fuck templates, just use PHP as a C++ preprocessor replacement.
 
@AndyProwl that's correct
 
Ven
5:24 PM
@ScarletAmaranth Haskell people want ML modules, ML people want Haskell modules
it's funny to watch
 
backpack pretty much STEALS ML modules
so I am not sure what you mean, @Ven
 
@milleniumbug Now that would be a true thing of beau...nope, even being sarcastic I couldn't get myself to say it.
 
Ven
@ScarletAmaranth lots of people want ML's first-class modules. because they're tired of orphan instances and stuff like that
but if you look at ML mailing lists, A LOT of people want a module system that looks like Haskell's
 
@Ven ye; but ML people don't want any of that Haskell nonsense
I have never seen any evidence of that
 
Ven
@ScarletAmaranth I've seen several ocaml people (blog)posts about that, with a few emails
 
5:26 PM
@Ven interesting
 
cool
I know you guys have lots of 100+ upvoted answers. I don't, though.
 
@MarcoA. I don't too.
 
thanks to whoever upvoted it (if you liked it, obviously)
 
Ven
@MarcoA. my highest is like 26, he
 
@Ven and that's not bad I'd say
26 is a great answer
 
5:29 PM
@Griwes @Jefffrey oh well. Yes, I might have missed the point that you can talk about implicit IO in C++ like about a monad, but that's not relevant when you try to get outside of it. In C++ you can never see the outside (hence the "io magic"); you're bound to a context with predefined exception semantics. In haskell there's no context, but instead there are tools given to create one and use it sanely.
Wait, there's more! Haskell allows you to work with more contexts than one, and exception context can be just one of them. If you don't need it, you don't have to include it.
 
ITT Bartek wants us to be surprised that a single monadic thing is less general than the set of all the monadic things
 
THAT is why I said that "monads" are superior to "exceptions". Exceptions in say C++ are just a particular "monad" instance bound to a language.
 
Please reread some of my messages.
That is exactly what I said not that long ago.
 
@Griwes Jefffrey apparently was surprised by that
 
wow; @BartekBanachewicz why not just say that you understand the point WITHOUT being defensive?
 
5:31 PM
I will have to read something about these "monads" sooner or later..
Lots of people are talking about them
 
:D
 
@MarcoA. oh boy
 
@MarcoA. Same here. I watched a talk about them once but didn't fully grok it.
 
@BartekBanachewicz Then why does Haskell include separate support for exceptions?
 
@Puppy Broken misfeature vOv
 
5:31 PM
:D
 
that's "what" as opposed to "why"
 
like records
@Puppy ask the designers
I've no freaking idea why anyone would add exceptions to a language with monads
 
why would that be a broken misfeature? it's a familiar way of handling control flow with "continuation functions"
 
@Puppy if I had to guess, it's to make the language more practical in daily use
 
5:32 PM
sorry for my ignorance: if I asked you to summarize in one or two sentences why should I read about these monads.. would you tell me to f*** ***?
 
@BartekBanachewicz exactly; how is that a broken misfeature?
 
@MarcoA. they allow you to generalize things that might seem totally different.
@ScarletAmaranth well, real world and practical daily use sometimes oppose clean code and good principles. I believe this is the case.
 
@BartekBanachewicz Since Haskell already includes monadic bind and all the rest of it, how would exceptions make it easier to use?
 
@Puppy it's one implicit thing you don't have to write
you can, say, use head
without monadic extraction/bind
 
@Prismatic Steve Jobs is Thomas Edison of 21st century (fuck roman literals)
 
5:34 PM
also, you can MAGICALLY throw out of f : Int -> Int
look at the type, I throw anyway!
 
> Referential transparency. Functions in the Safe dialect must be deterministic. Moreover, evaluating them should have no side effects, and should not halt the program (except by throwing uncaught exceptions or looping forever).
@ScarletAmaranth this is even more sad.
 
@BartekBanachewicz like what, if I may ask? Functions? Classes?
 
@MarcoA. that's where everyone goes wrong; it doesn't technically matter; they refer to computations - everything that obeys laws is a monad
@BartekBanachewicz that's the only sad thing actually - the raise syntax is fine
 
@MarcoA. Functions and classes are different abstract concepts. Monad is an interface that represents computations or contexts. (or contextful computations)
 
So you wrap function in a function in a function in a function in a function in a function in a function in a function in a function...
 
5:36 PM
@MarcoA. well, you need to understand that the essence of monads is th... fuck off
 
bill burr is hilarious
how have I never heard of him
its happening, I'm falling out of the loop
 
@AndyProwl lol
 
@AndyProwl literally everyone who tries to grasp monads comes up with a bad analogy ^^
 
monads are burritos
 
^ this
 
5:37 PM
dunno start with functors really
 
@BartekBanachewicz Seems like a pretty major distinction between exceptions and monads.
 
agreed
 
exceptions aren't, so monads are better - you can't eat exceptions
 
functors, applicatives, monads
 
@Puppy excuse me?
@ScarletAmaranth I don't get applicatives vOv
 
5:38 PM
an interface that represents computations... uhm... I'm pervertedly thinking of a java-like interface with a few methods
 
well, you can't take a function which takes Int -> Int and then pass it something that gives Int -> Maybe Int.
 
@MarcoA. not so far actually. Monad is a type class in haskell.
 
@BartekBanachewicz they are like a monad that doesn't care about the order of stuff happening (is therefore a bit weaker, but also stronger in this sense)
@MarcoA. almost; also add axioms, and you're golden
 
oh
 
I've never had a case where had an Applicative but not a Monad in my code I think
 
5:39 PM
do you know the Prio applicative?
it's something you can't do with a monad
 
@Puppy that's what >>= does
well, the result will be Maybe Int
 
@ScarletAmaranth something like a set of axioms and methods packaged that I can call like "fullPackageOfAxiomsAndMethods(input_data)" to perform the computation (whatever that is, from pattern matching to anything else) ?
 
@BartekBanachewicz What, it takes (Int -> Int) -> Int and turns it into (Int -> Maybe Int) -> Int?
 
@MarcoA. that's very correct; it's nothing more and nothing less
 
5:41 PM
@Puppy (>>=) :: m a -> (a -> m b) -> m b
 
sounds cool. I don't know Haskell but I had to study prolog
 
notice the strange m b return type which "joins" the stuff together tho
 
Axioms are customary not enforced, same thing happens with interfaces
 
that... is not the same thing.
 
I suppose it helps in understanding these concepts a bit
 
5:42 PM
@Puppy write out the types you want to connect again.
 
What IDE to use for Haskell?
 
@CatPlusPlus well, you're right vOv :P
 
Sublime Text
 
@milleniumbug I use ST.
 
5:42 PM
^ this
 
all right let's get the hell out of here
 
you don't need to debug the code pretty much at all
 
it's a quarter to 8 and everyone left like 3 hours ago
 
@BartekBanachewicz Well I have an existing f which is something like (Int -> Int) -> Int
 
5:43 PM
make sure to get the Haskell ones, e.g. you just created a monad, congrats!
 
@Puppy how do you turn a function into a number again?
 
return f(1) would be a simple way to do it
 
or read from data_1.txt
 
@Puppy okey, well, not particularly useful, but ($ 1) has this signature alright.
 
5:44 PM
@MarcoA. or, you know, "monad is a monoid from the category of endofunctors" ^^
 
@BartekBanachewicz :D
 
Prelude> :t ($ 1)
($ 1) :: Num a => (a -> b) -> b
 
wow this comedian is uncomfortably politically incorrect
 
ok, but it's clear that if you have a g that may fail, then you can't use it here since the signature of the function only takes functions from int to int.
 
@ScarletAmaranth I'm still working on the one I posted :P
 
5:45 PM
@Puppy you need to lift $ into <$> /cc @Griwes :D
 
You compose it with something that defaults
 
@MarcoA. yeah that's more of a running-joke explanation of monads; it states exactly what they are - but in terms of category theory :P
 
@BartekBanachewicz I want autocompletion and "show me the type and documentation on hover" though :(
 
Burritos
@milleniumbug vim
 
Prelude Control.Applicative> :t (<$> 2)
(<$> 2) :: (Num (f a), Functor f) => (a -> b) -> f b
wait that's wrong
 
5:46 PM
@CatPlusPlus Works with Haskell?
 
@ScarletAmaranth it's.. scary to hear at first. Perhaps it gets better with time :P
 
No, for mafia
 
@milleniumbug yeah.
 
@CatPlusPlus Yum yum.
 
@MarcoA. some people say you need to understand category theory to understand monads; I personally think it's irrelevant - kinda maybe like understanding one side of the curry-howard isomorphism is enough for what you use in your field
 
5:47 PM
@MarcoA. in plain english it'd be "it's something that forms parts representing some reasonable computations that can be linked together"
monoids are easy anyway
 
Plain as plain
 
a monoid is just an interface for "zero" and "add"
 
don't forget that m >>= g = join (fmap g m) (@BartekBanachewicz, @Puppy)
 
> Curry–Howard isomorphism is the direct relationship between computer programs and mathematical proofs.
 
Ell
I wish people would have told me that a monad was a concept in the first place
 
5:48 PM
Yeah, isn't that fucking obvious?
 
Ell
or a typeclass
 
Not really?
 
Ell
I somehow missed that
 
it is once you're shown what it does
 
@Puppy well, let's put this in Hayoo :v ... (a -> f a) -> ((a -> a) -> a) -> a. No direct results, i.e. would need to build solution from parts.
 
5:49 PM
@milleniumbug Works with everything.
 
Gödel's incompleteness theorem = Halting problem
@Griwes Yeah, I know it "works", but does it have docs and autocomplete?
 
@milleniumbug I'm pretty sure there are plugins for that.
 
Ell
I prefer turing to church
 
@milleniumbug I use internet docs. Hayoo, Hoogle and Hackage.
there are plugins to get that inside of your editor but... meh.
 
nvm :P
 
5:51 PM
k im out for now
 
recursive schemas are much more elegant than turing machine stuffs
 
I found writing Java code convenient (yeah, convenient. Annoying, but convenient) with NetBeans.
 
@milleniumbug how do you get around NetBean's inability to handle annotations properly?
 
I just press Ctrl+Space and let IDE do everything for me
@ScarletAmaranth Haven't got that far, but what problem does NetBeans have with annotations?
 
@milleniumbug it can't use the classes you end up generating through the annotation processor for some reason; I sometimes have to build first, the build then fails telling me it can't find certain classes, then you do clean and build and it will magically "find" the classes that were generated in first place
it is beyond annoying, because it arbitrarily stops working every now and again and you have to rebuild
 
5:56 PM
@ScarletAmaranth Ouch.
Full rebuilds are always not-nice.
 
@milleniumbug I found haskell a lot different in that regard. I also found NB convenient, but... In Java, a lot of time is spent on physical act of finding functions, classes, outputting code. In Haskell, most of the time you just... think. I don't feel the tools are such a huge part of Haskell dev.
 
yeah :-\
@BartekBanachewicz how do you reason about memory consumption when thunks are involved?
 
Also try out hate because I need user feedback.
I should pay with candy.
@ScarletAmaranth I don't.
 
@BartekBanachewicz :-/
 
@ScarletAmaranth I had a memory problem once, but more efficient OpenGL usage fixed it.
 
5:58 PM
I would like a tool for that quite frankly
 
my mem profiling is just "did my haskell program kill the OS yet"
 
because (maybe I am too stupid but) I can't reason about almost anything when thunks are involved
 
no? all is fine.
@ScarletAmaranth Have you voiced that in the haskell user poll?
 
@BartekBanachewicz yes
 
@BartekBanachewicz I'll try Hate once I start grokking more complicated things than the usual "functional operators" (fold*s, map) and creating my own types.
 
5:59 PM
@ScarletAmaranth good.
 

« first day (1686 days earlier)      last day (3267 days later) »