« first day (3674 days earlier)      last day (1498 days later) » 

00:01
You'd write predicates that return whether a value matches a category then def func(value: the_predicate) and a decorator to evaluate the predicate and perform category overload resolution depending on the result
The trickiest part would be the ordering of predicates when a value matches several
Basically @singledispatch but the overload resolution happens with partially ordered predicates instead of types
Maybe raise an AmbiguousResolutionError exception or smth when the partial ordering can't be properly resolved
00:13
Anyway, that's a project for when I'm motivated, which can be maybe in three years
I'm going to sleep for now, night
user14475233
00:30
oh, so you guys like C++?
user14475233
name every single possible line of code
I name my code by lines, for example, I routinely refer to code as "line 12" or "line 19", sometimes I say controversial things like "go to line 129".
We are not here to express our love towards C++. We are here to complain about it.
It's like group therapy.
With a lot of casualties.
 
8 hours later…
08:46
The casualties count never stops growing
 
1 hour later…
09:54
@Morwenn The truth is that we have never tried hard enough to get people back ...
Because it was a desperate cause
They left with no intent to ever coming back
I thought it's more because that we don't care enough.
I mean, we could randomly ping people who have been away for sometime and ramble some less relevant things.
Or even study them and ping them with issues that they care about.
Nah, those who left and don't appear in the user list anymore didn't want to stay there for the most part
What we've failed at is rebuilding an active community from the ashes of the previous one
10:06
can i ask something about github
@Morwenn I agree that attract them back with an active community is better than chasing after individual ones. But it's like a nuclear reaction - you need a critical mass to start with. It's easier to attract more people when you already have a lot of people to start with.
@MadhawaPriyashantha I'm not sure this is the best room and we might send you somewhere else but sure
is it possible to search for a repository with 2 files?i want to find a repo with x.txt and y.txt. googled a lot but still couldn't find a way
found a one thanks anyway
10:26
Oh, I couldn't have answered anyway
 
1 hour later…
11:30
Weird bash problem. Passing "-n" as first param to a function or script seems to be always ignored.
show_args() { echo "$@"; }
show_args -x  # Prints "-x"
show_args -n  # Prints nothing
show_args -n x y z # Prints "x y z"
Is "-n" treated specially?
Doh, the -n is passed as an option to the echo command inside the function.
show_args() { printf -- "$@\n"; } # Works correctly
12:34
That's really odd
 
5 hours later…
 
3 hours later…
20:36
Lack of static typing makes polymorphism in Python an isinstance clustrefuck?
Depends, it's mostly duck typing and polymorphism all over the place
isinstance is an obvious tool to have in your toolbox but not an everyday tool either
Like, you don't overload functions on type (unless you're using @singledispatch), somehow everything is overloaded on the type of self and you use that a lot
If you can't modify the class yourself for polymorphic behaviour, then sure you have to resort to isinstance
I mean, the common problem I'm hitting is implementing Union[item,List[item]]. So you gotta isinstance everywhere
But with real static typing we'd just have two function signatures
Or just only accept std::vector :-)
I miss my C++
You mean item | list[item] :p
I do miss my templates sometimes
^ Honestly, don't know what that is :-)
The pipe is the new syntax for Union
20:42
damn
And now you can use list[T] directly instead of typing.List[T]
Type hinting is definitively becoming more powerful with each new release despite still being merely hints
21:21
One other part not keeping up with type hinting is the import system. Would be cool if when you imported a function you implicitly imported all the types?
I'm not sure I get what you mean
Many libraries decided to split into two parts anyway: normal library without type hints on one hand, stubs/prototypes with types hints on the other hand
This design was proposed so that there wouldn't be any penalty in regular code (because type hints have a cost, even though it's getting better), but IDE could use the stubs to retrieve the hints for autocompletion and type checking
So if you have a signature like def my_function(a : FOO, b : BAR) you might want to import FOO and BAR from another .py file. What I'd like is an automatic import of FOO and BAR when you import my_function.
Ah, yeah
give me it !
:-)
On the other hand Python never implicitly imports anything transitively, it's not specific to type hints
21:29
You say that like its a good thing ;-0
I've got enough experience with C++ to know that it's a god thing x)
I don't believe you, all of your code is so heavily templated its probably one single file
Aug 26 '16 at 20:15, by Mysticial
Each binary takes 2 - 4GB to compile because after preprocessing, the compiler is seeing essentially a single file with about 400k lines of code that are heavily templated.
^ Back when this chat was cool :-)
C'mon, my next commit currently affects 147 files
Do you think we can harvest the heat from CI?
Sure, for global warming
On the other hand I might just go back not not actually commit this change
It seemed innocuous: replacing std::less<> with std::ranges::less, but the latter is more constrained and thus less generic
Which means that I would be losing genericity for almost no advantage there
21:42
and takes up more characters
you should be ashamed
That's true, but it felt more "right" than to use std::less<void> which is "a specialization of a class template but I could as well be non templated at the class level"
lol at that link
I'll probably keep std::less<> as the basis and just special handling of std::ranges::less where needed :x
That's why my personal projects are slow: design decisions take forever
22:10
More of an aesthetic decision
So, std::ranges::less accepts forwarding references and is implemented as return std::forward<T>(t) < std::forward<U>(u);.
Why use forward for operator<...
Forwarding, IIRC, means passing by reference in case of lvalues and using std::move in case of rvalues.
@Mikhail It's not just aesthetic when one requires all the comparison and ordering operators to be present when the other does not
So, does that mean it translates to return std::move(t) < std::move(u) in case of rvalues?
How is that meaningful?
Hm, I suppose it calls the operator<(...) && overload.
No, but with projection support you get comp(proj(a), proj(b)), and if proj returns a new temporary variable you might want to be able to move it
I don't know a single real world case where it might make a difference, but I know better than assuming that no code relies on it
What is projection support?
22:16
Constrained algorithms got support for projections, basically a mean to "view" or "transform" the data prior to comparison
Which is why you can do things like std::ranges::sort(collection, std::greater{}, &Person::name);
Where collection is a collection of Person
> The function-like entities described on this page are niebloids, that is:
are they seriously calling them by Niebler's name
Plus the standard doesn't take advantage of that anywhere, but I have sorting algorithms that take projections but don't support comparison
Well yeah, nobody really coined a better name

« first day (3674 days earlier)      last day (1498 days later) »