« first day (1814 days earlier)      last day (3134 days later) » 

1:00 PM
@BartekBanachewicz That's your limitation
 
example?
 
@Borgleader that's a bad way to fall
 
@Borgleader You outta your mind?
 
it's trivial to write uncurried:: (Int, Int, Int) -> Int in Haskell
 
Because it's Haskell
 
1:00 PM
now write a curried function in your language of choice
 
user1804599
@BartekBanachewicz \x y z -> x + y + z
 
@sehe that's my point uh. Why would not want that behaviour?
 
I would, but I prefer my function overloading, thanks.
 
@BartekBanachewicz That's my point. Curried-by-default only comes free in languages designed as such. If your languages isn't like that, that's /good reason not to have them/
 
user1804599
@BartekBanachewicz (x, y, z) --> x + y + z
 
1:01 PM
@sehe wait so a good reason to not put this in a language is because the language doesn't have them
 
(I prefer a variadic variant being a functor instead of having a typeclass for every arity of a variant know to humanity, for example.)
 
user1804599
@BartekBanachewicz ((x: Int, y: Int, z: Int) => x + y + z).curried
 
STOP SAYING VARIANT ITS A GENERALIZED ALGEBRAIC DATA TYPE
(I'm losing it)
 
@BartekBanachewicz There's a subtle difference between "I see no reason not to want that" and "There is no reason not to have them". Hence: it's your limitation
 
variant
variant, variant, variant
variant!
 
1:02 PM
@BartekBanachewicz Well. Don't pin that ridiculous circular logic on me: it was your argument.
 
I bet your code has a lot of "variants" of arity 1000+ Griwes
 
user1804599
@BartekBanachewicz |x| |y| |z| x + y + z
 
@sehe what
 
user1804599
lol arguing with Griwes about things
3
 
1:03 PM
@sehe when I asked you for a reason you said it's because "the language wasn't degigned as such"
cries
 
@BartekBanachewicz I bet Haskell has a typeclass for, say, 8-nary variant (enter ASTs).
 
3 mins ago, by Bartek Banachewicz
@Griwes maybe not suck, but I don't see a reason to not have them
This directly invokes that circle. I'm happy that you understood that the circularity was what I tried to expose to you
 
1 min ago, by Bartek Banachewicz
STOP SAYING VARIANT ITS A GENERALIZED ALGEBRAIC DATA TYPE
 
user1804599
criwes
 
@BartekBanachewicz "as such" didn't really mean "as one having functions curried by default"
@BartekBanachewicz variant variant variant
 
1:04 PM
10 mins ago, by sehe
Because capslock
 
only noobs say "variant" when they mean "GADT"
let this sink
 
Only noobs shout when they can't voice their opinion.
 
ITT ad hominem
 
I'm out. Family visits
 
@sehe ttyl :)
 
1:04 PM
@Griwes so what does haskell has a type class again for
it has type classes for some n-tuples
 
@BartekBanachewicz an 8-ary sum type
 
@Griwes which one?
 
What'd be the "fmap" called for that? octomap?
 
@Griwes 8-ary*
 
@GregorMcGregor whatever
 
1:06 PM
ITT world revolves around Haskell¹

¹some researchers have suggested it might originally be spelled Bratek
2
 
@Griwes every type in Haskell that has 8 constructors can be viewed as "an 8-ary sum type"
so, which one did you mean?
 
@BartekBanachewicz Okay. Does Haskell have a typeclass for 8-ary functors?
 
what's an "8-ary functor"?
 
it's like bifunctor
 
user1804599
octary
 
1:07 PM
only for 8 things, not 2
 
@Griwes then no, I guess.
look at the signature it would have
 
exactly my point, you need function overloading to have that in a sane way
which kind of clashes with currying by default
 
map8 :: (a -> a1) -> (b -> b1) -> (c -> c1) -> (d -> d1) -> (e -> e1) -> (f -> f1) -> -> (g -> g1) -> (h -> h1) -> f a b c d e f g h -> f a1 b1 c1 d1 e1 f1 g1 h1
@Griwes how would overloading help with this
 
I know.
 
wtf, linq was faster 19 ms ve 45 ms for rust.
 
1:11 PM
I can't seriously imagine this thing being useful TBH
 
@BartekBanachewicz map8 :: overloaded-function -> f a b c d e f g h -> whatever
@BartekBanachewicz lol
that's your limitation vOv
 
@Griwes show an example then
 
@BartekBanachewicz transforming an AST node that's a sum type
 
any idea why this program does not work when enabling optimizations?
 
1:12 PM
@JohannesSchaub-litb I somehow knew you'd bring this here. :D
 
it should print 101 not 100
 
@Griwes so why isn't making [a..f] instances of some class and taking a function taking this class isn't ok
 
@BartekBanachewicz boilerplate
 
since they have to be in this function overload set there's a relation between them
 
1:13 PM
@Griwes it's for science
type theory that is
 
@Griwes and what would whatever be in this case
 
@BartekBanachewicz f decltype(overfloaded-function(a)) ...
 
that doesn't really answer the question I think
 
It's not sensible to spell that out in Haskell.
F<Ts...> becomes F<decltype(std::invoke(function, std::declval<Ts>()))...>
 
if you took a "better" type instead of just a function I think you could do this in Haskell as well
 
1:19 PM
Define ""better" type"?
 
I was really thinking about newtype so far
or, IOW, something that can carry the overloads inside
 
user1804599
@JohanLarsson did you enable optimisations
 
because essentially when you're passing an overloaded function you're passing all of the overloads + type information about every overload
one in runtime, one in compiletime
it's functionally equivalent to the giant list of functions except now it's a list
 
@elyse no
 
user1804599
Enable optimisations.
 
1:21 PM
where? how?
 
user1804599
Do you use Cargo?
 
an existential might be needed to put them all on the list
 
user1804599
@JohanLarsson cargo build --release
 
@elyse here is the code btw
cargo run --release?
 
user1804599
1:22 PM
Maybe, not sure.
 
@Griwes eh, dunno, it seems like it would cause a lot of confusion and problems with readability
 
looks like it works
 
user1804599
@JohanLarsson I think LLVM will compute that at compile-time.
 
I'm not convinced
 
@BartekBanachewicz So we agree that it might be more readable in C++? :P (I'm obviously not talking about the internal implementation of fmap here... :D)
 
user1804599
1:24 PM
Oh, apparently not.
 
user1804599
Well that's terrible.
 
1 ms with release
 
@Griwes perhaps, but it reminds me of Go interfaces. You'd need an overload for every value and you wouldn't have an explicit interface to implement.
 
Because I admit, the actual implementation isn't really readable (unless you are, err, a templates and variadic expansion mage or something).
 
user1804599
@JohanLarsson and without?
 
1:25 PM
@Griwes oh fuck C++ I assumed an actual usable language with overloading
 
lel
 
of course it's gonna in be shit in actual C++
like everything else
 
The interface ends up being clean.
 
It's the guts that are ugly.
 
1:26 PM
@Griwes you mean nonexistent
 
@BartekBanachewicz lolwat?
 
Morning again.
 
@Griwes the "interface" here is the set of possible values on which you want to operate on
you need an overload for every value, but those overloads aren't directly linked to this type
 
consider
 
1:27 PM
This is also possibly changing the arity of the variant, but whatever.
 
fuck didn't I tell you to stop talking in variants
 
(To avoid duplicates and shit.)
 
I am not interested in the slightest in the "variant" concept because it's limited crap for terrible languages
 
@Griwes That’s a loss of information technically.
 
lel
@LucDanton I haven't had a use-case for not doing that yet.
 
1:28 PM
@elyse 45 ms
 
user1804599
Nice.
 
user1804599
And LINQ?
 
I also do it but you can recover full power with tagged<Is, Ts>... which has no duplicate if/when you carefully map in an index-preserving manner over that :v
 
linq 19 ms
 
@LucDanton Adding another implementation that carries index over shouldn't be much harder.
 
user1804599
1:28 PM
Cool.
 
@Griwes see that's the point
this thing has pretty much 0 practical usage
 
I don't know why you're still arguing, but in the meantime, I made myself a coffee and decided that reading slides would be better under my duvet. And that's great :D
 
@BartekBanachewicz lel
It's a sum type.
 
Duvet: 100% practical usage.
 
@Griwes it's ONE type
 
1:29 PM
ITT Bratek says sum types have no practical usages
 
@BartekBanachewicz It's a generic implementation of a sum type.
 
no hold me
 
@Griwes The real reason I don’t provide both is likely that I don’t have a nice, easily rememberable pair of names :D
 
it's one sum type.
there are others. In fact an infinite number of them.
 
1:30 PM
product_with is already a mouthful
 
@BartekBanachewicz It's all sum types. (Except I didn't implement recursive ones yet.)
(Boost.Variant, does, though. vOv)
 
@Griwes can you make this implementation generic on actual variant type?
so that I can use my own variant with it?
or my OWN ALGEBRAIC DATA TYPE
 
You implement your ADT with this thing, mate.
 
@elyse here, using nunit as it works better with console.
 
@Griwes only because C++ is shit and doesn't have actual ADTs
 
1:32 PM
Sure, C++ doesn't have built-in ADTs. This is a library implementation of ADTs.
@BartekBanachewicz yes, whatever
 
lol okay keep working on this thing then
 
let's stick to facts maybe
 
I think it's going great
you should totally continue
thank me later world for saving some innocent codebase hopefully
 
See, here's a thing.
 
no seriously take this away
I don't want to talk about C++
 
1:33 PM
template<typename Args...> using operator| = std::variant<Args...>;
 
You are like, "C++ doesn't have this built in what a looser".
 
template<typename Args...> using operator& = std::tuple<Args...>;
 
can we stop talking about c++
 
Hello!
 
@Morwenn Give me first class types.
 
1:33 PM
I never wanted to talk about C++
 
I need a bit of help
 
Why are we talking about C++
 
@BartekBanachewicz I'm not talking about C++ anymore. But there's this thing, you abandon languages for no reason.
 
looks above with C++
 
@Griwes what
> no reason
 
1:33 PM
@BartekBanachewicz Because that's fun.
 
hahahahhahahhahahahhahahahahahaaha
ohohohoohohoho
 
Saying "C++ is shit because it has no ADTs" is silly, since a working implementation of that takes ~300-400 lines.
 
rotflmao
 
how do I make a txt file be dumped in a character array, spaces and all, instead of stopping at the first space?
 
@Griwes you wish
 
1:34 PM
@Griwes I'm not going to explain it to you why C++ is shitty
 
@BartekBanachewicz I know that it's shitty!
But nothing else gives me enough flexibility to write code in a way that is sensible.
 
@LucDanton ...not counting handling ref-types hides
 
I bet everyone else cooperating with you thinks your code is sensible as well
 
user1804599
1> fun() -> 1 end == fun() -> 1 end.
true
2> fun() -> 1 end == fun() -> 2 end.
false
 
user1804599
1:35 PM
wat.
 
user1804599
I think Erlang solved the halting problem.
 
@LucDanton 304 lines (not counting some generic metaprogramming utilities used)
@BartekBanachewicz I bet everyone else cooperating with you thinks Haskell is the only true language.
 
Are your special members correctly constrained?
 
@LucDanton Elaborate?
 
@Griwes see the thing you misunderstand about me is that I'm using Haskell because "it's cool and mathy" or because "I like new languages" or "esoteric languages"
 
1:36 PM
Does is_copy_constructible etc. report the truth.
 
My sorter_base should probably be sorter_facade now that I thing about it.
 
I'm using Haskell because it's the sanest language to use on the planet, not because it has WOWOWO templates I can write a pong in compiletime
 
@LucDanton I'll need some additional elaboration.
 
that takes the most space on my impl
 
@BartekBanachewicz Haskell is not generic enough. vOv
inb4 ahahahhaha
 
1:37 PM
@Griwes Doesn't matter.
 
@Griwes Well, does it report false_type when the type is not, in fact, copy constructible? And vice versa?
 
I'm creating software with it.
 
@BartekBanachewicz For you, maybe. For me? Yes, it does.
See, here's a thing you don't understand about me.
 
@Mgetz everything NASA releases is in the public domain
 
E.g. I don’t expect should be able to copy a variant<std::unique_ptr<int>>, for obvious reasons
 
1:38 PM
@Griwes Yes, except the difference between us is that I'm writing software, and you're writing circlejerk ADT libraries that no one will ever use.
 
NASA > ESA
 
if you don't get that then I rest my case.
 
@R.MartinhoFernandes not everything, if the work product is that of a contractor it's not in the public domain
 
(ESA CCs stuff)
 
Guys, help :<
 
1:38 PM
I want to see the mythical creature called "perfect code". Neither Haskell nor C++ will get me there, but somehow C++ let's me be closer to my view of that.
 
@AlexMitan what
 
also most people don't know that most all works of the federal government are public domain
 
@Griwes wow you're actually getting that, I'm impressed.
 
@LucDanton Oh! I need to assert on is_copy_constructible in the same way I assert on is_nothrow_move_constructible. One additional line. :D
 
1:39 PM
 
except I called it "circlejerk" and you called it "perfect code" but yeah
 
(Sorry, miss-click.)
 
^ this should be starred by @CatPlusPlus
 
@Abyx repost... again
 
@Griwes Move to concepts and it’s correct, too.
 
1:40 PM
@Griwes ok
 
Until then, it’s not 300-400 lines :(
 
@AlexMitan std::getline in a loop.
 
Then there’s constexpr :D
 
how do I use getline with a thing declared as :
char InStr[20];
?
 
does rust have inheritance?
 
1:41 PM
@AlexMitan you don't. Use std::string
 
@BartekBanachewicz Whatever. See, I'm not trying to tell you your language of choice sucks for you, while you are telling me my language of (forced) choice sucks for me, which is silly.
@LucDanton eh?
 
@BartekBanachewicz Yeah, but strlen for some reason doesn't work with strings for me, and I need that
 
@Griwes I don't see the value in code being "perfect" for the sake of it. I see value in shorter refactor cycles, shorter bug fixes, shorter feature add times, quicker builds. Actual, measurable quantities in software lifecycle.
 
@LucDanton static_assert(all_of<std::is_nothrow_move_constructible<Args>::value..., std::is_copy_constructible<Args>::value..., "whatever");
 
@Griwes true, I owe you an apology.
 
1:42 PM
@Griwes I.e. as in allow move-only types and have is_copy_constructible tell the truth.
@Griwes Doesn’t allow is_copy_constructible to tell the truth.
 
I misunderstood the point you were making and thus your arguments. Sorry for that.
 
@LucDanton That disallows not copy constructible types by design. The same way it disallows noexcept(false) move constructible types.
 
@AlexMitan Don't use strlen. Use std::string::length
 
@BartekBanachewicz Glad we both know where we stand now :P
 
1 min ago, by Luc Danton
@Griwes I.e. as in allow move-only types and have is_copy_constructible tell the truth.
 
1:44 PM
Move-only types are silly.
Regular types for the win.
 
wat
 
(...minus the default_constructible bit of that :P)
 
Linear/affine types have too many tricks up their sleeves to ignore them.
 
so something like..

RawLength = RawString::length?
 
I haven't really seen a need for supporting move-only types yet.
 
1:45 PM
@AlexMitan std::string s = "test"; unsigned len = s.length();
 
Or, haven't really seen one that couldn't be made copy constructible (and that I'd want to put in a variant).
 
@BartekBanachewicz Oh, okay... thank you! Thank you so much! I'm quite a rookie, especially with strings
ifstream infile("input.txt");
string InStr;
InStr<<infile.getline();

I feel like such a dumb. How do I do this?
 
;_;
 
    fn liftFromIds2<T>(&self, f: Fn(&Entry, &Entry) -> T) -> Fn(&Id, &Id) -> Option<T> {
        |a: &Id, b: &Id| {
            let ma = self.data.get(a);
            let mb = self.data.get(b);

            match (ma,mb) {
                (Some(a), Some (b)) => Some(f(&a, &b)),
                _ => None
            }
        }
    }
 
4269
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written...

 
1:49 PM
how do you like that
/cc @ʎǝɹɟɟɟǝſ
now I can define new functions operating on entries as if they were operating on ids
 
I'm not going to buy a book right now, please, how do I use getline with a file?
 
@AlexMitan sure, you can buy paid support in this chatroom instead
 
@BartekBanachewicz Come on, was "getline(infile,InStr);" more difficult to type than that?
 
@AlexMitan It's not about difficulty, it's about the rules.
Want support despite not listening what to do (in this case "read a book")? Pay someone for it.
That's how it works.
 
"Read a book" is a joke of a suggestion when the question is "How do I use this function here?"
 
1:55 PM
No.
It's a suggestion to actually frakking learn a language you are trying to use instead of second guessing it.
 
that’s one way to make friends
 
@Griwes What quantifies "frakking learn a language"? I know I am less good with it than you, but neither of us knows it perfectly. However, you obviously deserve to be here, while I should go buy books before even asking anything. Where between us is the point where one "frakking" knows it?
 
@AlexMitan In case of C++ it means reading a book.
 
Oh my, this k was bigger than I thought, sorry
Is using a string explicitly better in all cases than a char array?
 
user1804599
I'm writing a VM in Rust woo.
 
2:03 PM
A book would give you the answer to that question. And to many other questions that would follow it.
 
@LucDanton Seriously, you and the other couple are like human redirect links to this
 
Who’s the couple?
 
Bartek and Griwes earlier, that's all they found to say too
 
Maybe because it's the best course of action?
Seriously youre not the first person to waltz in here demanding help
and we suggest the same damn thing every time
 
2:11 PM
they really are lovely together aren’t they
 
Bartek and Griwes are like Ike and Ike.
 
@Griwes @BartekBanachewicz sitting in a tree K I S S I N G
 
Which is particularly irritating considering how it's apparently fine to ask the question on the stack associated to this chat, and nobody asks them to read books there or their answers would be deleted or downvoted
 
@Borgleader lol
 
@AlexMitan I actually have different advice to offer though! Read two books.
 
2:15 PM
@AlexMitan Who would have thought it was fine to ask questions on the site made for asking questions
 
Sep 23 at 19:55, by Columbo
By clicking "send" you agree to the terms and conditions.
@AlexMitan "The fact I can't pee in the middle of this restaurant is particularly irritating considering how it's apparently fine to pee in the toiled associated with it!" <- your logic
4
oh lol
> toiled
 
You should have toilet harder in spelling class.
 
I have an explanation, this is my second full day on ibuprofen. :P
 
2:30 PM
Why does it want mut here?
 
@Griwes It's not really the same, but whatever.
 
@ʎǝɹɟɟɟǝſ Of course it's not the same - it's merely analogous.
 
@AlexMitan No. Bye.
@BartekBanachewicz Makes me cry of happiness
Or despair. I haven't decided yet.
 
user3790646
Rejuvenating the Microsoft C/C++ Compiler
"Our compiler is old. There are comments in the source from 1982, which was when Microsoft was just starting its own C compiler project. "
 
@JohanLarsson Off the top of my head, nth advances the iterator.
 
2:35 PM
ah, yeah, guess it makes sense, ty sir
 
@Andrey Repost
 
user3790646
Oh I'm sorry
 
2:58 PM
hello
 
Hi! :)
 
what's up?
 
Raclette was good.
 

« first day (1814 days earlier)      last day (3134 days later) »