« first day (1540 days earlier)      last day (3401 days later) » 

1:04 PM
VS doesn't want to show me Locals window
 
is doesn't?
 
Xeo
@Puppy Make it static constexpr int!
 
Restart VS?
 
Xeo
gg
 
1:07 PM
can totally imagine windows developers are like cat - won't fix ... because ~effort~
 
Ell
linux users; what init system do you use?
 
Whatever the distro is using, because wrangling with replacing the init system is not my idea of good time
Fuck sysvinit though
I prefer runit to everything else probably
 
Ell
I'm looking at systemd
trying to decide whether it deserves the bad press
 
why do you want to choose your own linux init system
there are many configuration files that you can modify to make the system the way you want it to act
 
1:13 PM
> copy wright
 
> Every "orphanage" I visited in Thailand was a "brothel".
 
Thinking is always the hard part :) Anyways, you didn't specify much (no code, no algorithms) and I just don't recommend Boost Property Tree for "JSON". For fun: here's how "very complex" it would be to print that text using my data structure: see it Live On Colirusehe 48 secs ago
I'm not sure I'd trust the OP's file synch tool with my data
 
^^^ lol, putting both words in quotes makes it confusing
 
ITT Stackcrooked thinking of visiting orphanage in thailand to show support for the children without parents
 
Ell
@sehe that's pretty neat
 
1:37 PM
@Nooble it was more like the serial killer showing at the door the next second
but I guess that works too
 
I don't understand what is the point of having more than one await in a resumable function
Why does it matter if an asynchronous computation blocks?
More concretely, what's the difference between this and this? (only one line changes inside the do loop)
(from Gor Nishanov's CppCon talk)
 
@AndyProwl awaits are yield points
 
I thought awaits were syntactic sugar for future.then() or something
I mean, the caller of tcp_reader() will get a future and either do .get() or chain a continuation through .then(). What is the difference if tcp_reader() blocks after the first await?
 
@AndyProwl second one triggers kernel-level context switch. first one triggers user-level context switch.
 
@StackedCrooked How can you tell?
 
1:49 PM
that's what await does afaik
with "user-level context switch" I mean a coroutine yield.
 
How can you tell that the first await is different from the second one?
Or that it has different effects?
 
there's only one await
oh
 
no, there are two
 
I'm only referring to line 9
 
Dunno how this implementation would look like
But if you have an event loop then any synchronous part blocks the entire loop
 
1:51 PM
But the loop itself runs asynchronously, so why does it matter if the loop blocks?
 
Hence you want to yield at wait points like I/O
Because no other task will be processed until the synchronous part ends
I.e. your async code is no longer async
 
Why not? The call to tcp_reader will return immediately and provide a future
The computation will run asynchronously from the caller
@StackedCrooked Yes, that's the one which puzzles me: since there is already an await before, the function will return a future and it should not matter if the loop blocks - at least in my current (mis)understanding
 
@AndyProwl the second one blocks inside the loop because of the .get() call.
 
@StackedCrooked Indeed it does, but why does it matter? The whole loop runs asynchronously wrt to the caller
 
I don't know the context.
 
1:56 PM
Me neither. I assume the context is that a caller will call tcp_reader() and get a future
 
Ell
I don't really know why you wouldn't make awaits implicit though
 
wait for the result to return before doing anything with the I/O?
while ((bytesRead = await input.ReadAsync(buffer, 0, buffer.Length)) != 0)
{
  //does stuff?
}
 
blocking involves context switching and thread wakeups.
So it's always gonna have more overhead then async/await.
 
Oh, I see. But that's the only difference, isn't it?
 
The code also won't compile because it's returning a value instead of future.
 
1:58 PM
That's ok
the await does the magic
 
that's a lot of magic :)
 
indeed
 
Ell
I don't see the need for await if you have a coroutine scheduler
 
Coroutines need to yield
 
Ell
why don't you yield inside the conn.Read?
maybe I'm misunderstanding
 
2:00 PM
I think that await there is just syntactic sugar for .then()
 
@sehe Not gonna work.
 
Ell
ie, conn.Read yields instead of blocks
 
void operator()(qd_json::array const& v) const              { for(auto& e: v) { std::cout << "\n: "; (*this)(e); } }
 
Like, it gets rewritten to something like this (modulo missing brackets and unnecessary extra semicolons)
 
you iterate mutably over a const object.
 
2:01 PM
@Puppy lolwat. auto deduces to a const type
 
not auto&.
 
Ell
auto doesn't deduce cv does it?
 
yes it does
 
as far as I know, anyway.
 
@AndyProwl Yielding on read allows you to interleave operations on a thread pool e.g. (so you don't lose a worker just because it's waiting)
 
2:02 PM
auto& deduces const if necessary
 
auto & foo = const_something gives you a const reference.
If it didn't it would be terribroken.
 
inb4 const is terribroken
 
The rules for auto are the same as template deduction
 
looks like @Puppy didn't watch the talk
:D
 
template<typename T> void f(T&); can't accept a const object AFAIK.
 
2:03 PM
@CatPlusPlus But is that a regular yield? I mean, clients of tcp_reader() aren't going to call tcp_reader() several times and expect it to resume from the last await point.
Or maybe they do and I understood nothing
@milleniumbug sure it can
 
@AndyProwl If you block, the whole thread is sleeping until the read is done
 
The thread that calls tcp_reader() you mean?
 
If you async yield, the rest of the task is moved somewhere else and this thread is ready to do something else
No, the thread that runs tcp_reader
 
@milleniumbug It can't accept a temporary.
 
2:05 PM
I think I'm starting to get it
 
I mean this implementation could work entirely different dunno
 
@Griwes That's... tremendously inconsistent.
 
Because a temporary is not const and the deduction gives you a non-const object.
<Griwes> { foo(1); } template<typename T> void foo(T &) { BARK; }
<geordi> error: invalid initialization of non-const reference of type 'int&' from an rvalue of type 'int'
<Griwes> { const int i = 1; foo(i); } template<typename T> void foo(T &) { BARK; }
<geordi> foo(const int&)
 
it can deduce const T sometimes but not other times?
 
But turning everything into continuations gives you more options
 
2:06 PM
It is consistent.
 
Should at least
 
@Puppy It's not inconsistent. It can deduce const from a const lvalue, but it won't bind an lvalue reference to something that is not an lvalue
 
1 is an int, not a const int, so you can't pass to a T&.
 
@CatPlusPlus I think I understand, thanks
 
@AndyProwl Lvalue references bind to non-lvalues all the time.
 
2:06 PM
So auto & i = 1; will fail.
 
what I'm saying is
 
But if you do const int i = 1; auto & j = i;, it works fine.
 
if you have f(const int&) that binds in both situations
 
1 is not const; i is const.
So it's 100% consistent.
 
having template deduction fail in a case where it's very clear what the language should do and non-template code behaves in that exact way is pretty pointless.
 
2:07 PM
In what case does it fail?
auto & i = 1; case?
 
yep.
 
1 is not const
It'd be inconsistent if this didn't fail.
 
that does not matter in the slightest.
 
It does.
 
what matters is that if the ref is const T, then it would succeed.
 
2:08 PM
For consistency's sake.
Which was your original argument.
 
so if it can deduce const T, it should.
 
But... temporaries are not fucking const.
 
@Griwes 1 apple != 1 banana
 
Oh, nice. So I thought universal references broke the consistency, but it was broken even earlier.
 
that doesn't matter in the slightest.
 
2:09 PM
It does.
 
we add const implicitly all the time.
 
@Puppy I think this is a different situation. Deducing const in order to bind to a different value category is not the same thing as deducing const because the argument is const.
 
@AndyProwl Yes, it is exactly the same thing.
 
NO
ITT @Puppy is wrong again
4
Also if what you wanted was true, there'd be no way to write a template that only accepts lvalues.
Because suddenly rvalues would also bind to a T& argument and everything would be broken.
 
I am going to lay on bed, read horror until I fall asleep
 
2:10 PM
fine by me.
personally I'd be perfectly happy if T& simply could not deduce const in any case.
 
@Puppy But not by sane people who want that feature.
 
but if it does deduce const it should deduce it when it's required.
not randomly.
 
facepalm
IT DOESN'T DEDUCE IT RANDOMLY
 
yes, it does.
 
IT DEDUCES const WHEN THE ARGUMENT IS const
 
2:11 PM
lol
 
ITT @Puppy cannot into C++
 
which is a random subset of the situations where const is required.
 
2 mins ago, by Griwes
ITT @Puppy is wrong again
I'm done.
 
I think "random" is a bit exaggerated
there is a logic, it's just not the one you think is correct
 
what I'm saying is
 
2:12 PM
It deduces const when the thing being pattern matched is const, not when the programmer wants it to deduce const. If it did that, we wouldn't need the language, because the compilers would already be able to read your fucking mind.
 
this clearly does not require telepathy for the compiler to get it correct.
 
I know what you're saying. It's not unreasonable. But neither is the current logic. It's just different.
 
@AndyProwl It is totally unreasonable.
 
and definitely not "random"
 
it's very random.
 
2:13 PM
@Puppy Again. Your way makes it impossible to write a template that only matches lvalues.
 
@Griwes No, my way is to ban T being allowed to be const at all.
 
Your scheme is 100% unreasonable, because it makes writing code that is sometimes very useful completely impossible.
 
if it was random, the compiler would do something different every time you compile that program
 
but if you must allow T to be const then it should be const when it's required and not only sometimes for lulz.
 
It adds const where the thing being pattern matched is const. 1 is not const. Case closed.
 
2:14 PM
wtf new year's news
 
which is unreasonable and stupid.
 
couple gets drunk, has sex, neighbor drops in and is invited, they wake up, woman gets beating for being too slutty
now the interesting part is that she's 71
can you still have sex at that age
I thought people crumble at 71
 
Ell
1 isn't const? O.o
 
what it really comes down to is that const T& binding to rvalues is a silly decision too.
 
2:15 PM
the type of 1 is int, not int const
The point is that deduction of const currently works based on whether the argument is const, not whether the argument can be bound to a const&. It's just a different logic.
 
a different logic that is bad and wrong.
 
(I was expecting that)
 
It's the only logic that makes it possible to write a template that only accepts lvalues.
It's the exact opposite of being bad and wrong.
 
3 mins ago, by Puppy
what it really comes down to is that const T& binding to rvalues is a silly decision too.
and also that whole T&& -> universal ref thing is pretty dodgy.
fortunately I can give my own language more intuitive useful semantics
 
shivers
 
2:21 PM
indeed
that's the advantage of starting from scratch
 
If your semantics is to let T& bind to 1, then I don't want to ever write in Wide.
 
C++ would be a much better language if we could get rid of backwards compatibility
 
ah, all cleaned up. A nice bit of cabal management too.
 
7 mins ago, by Puppy
@Griwes No, my way is to ban T being allowed to be const at all.
also I would not permit const T& to bind to an rvalue.
 
Makes sense
However, in C++ this design decision was made long ago
 
2:22 PM
yes
 
If we discuss const deduction as it is now, it should be in the proper context of that rule existing
 
const T & binding to rvalues is a Good Thing® :/
 
it's clear that they tried to hack on handling rvalues without actually handling rvalues so totally botched it.
 
yes
 
@Griwes It's a dumb-as-shit thing. That's what rvalue refs are for.
 
2:23 PM
Not really.
 
OTOH having 4 overloads of min() for allowing lvalues and rvalues is not cool either
 
If your function doesn't take sinks, then const T & to grab everything you need (for the sheer easiness of passing those around) is perfectly reasonable.
 
I'd say more generally that the problem is that you can't stamp out related overloads easily.
 
hm no wait, forwarding references
 
my current plan in Wide is that you can simply specify several overloads with a single body.
 
2:24 PM
yeah that's convenient
 
I still want a "catch them all" variant.
const T & is a good "catch them all" variant.
 
but that's forwarding references
you catch both lvalues and rvalues
 
yes, it's called T | T.lvalue | T.rvalue (haven't really decided what I'm gonna do about const).
 
That requires me to call forward.
 
yes. it also works for T only and not for concrete types, which is kind of lame
 
2:26 PM
and in Wide you can do all(T) { return T | T.lvalue | T.rvalue; } f(arg : all(int32)) { }.
at least, that's what I'm planning.
 
I am more and more sure I will never write a line of code in Wide.
 
it's considerably more convenient and controllable.
 
I would be fighting with it more than I fight with C++.
 
@Puppy I don't get it, you return a type?
oh
that's not the function body
 
that is the function body of all.
 
2:27 PM
Returning types is perfectly reasonable.
 
and it's perfectly legal to return a type in Wide.
 
is it a meta-function that computes the return type?
 
I am pretty sure you should also be able to return templates and typeclasses from functions.
 
you can return templates, and you can return typeclasses when I get around to them.
@AndyProwl Argument type in this case.
 
@Puppy ah, right
 
2:29 PM
since the result of all(int32) is a variant of types, then I intend that the compiler will stamp out an overload for each type in the variant, effectively.
 
I'm just waiting for Wide compiling process to turn into undecidable problem
 
well if you have many variants on many arguments, it could become many overloads, that's true.
 
what's the point of hats if you don't know why you earned them
 
There's no point
 
but better that than the programmer just writing all the overloads directly.
@AndyProwl There was a point?
 
2:30 PM
they must have thought it was a good idea if they did it
I mean, there had to be a rationale
 
It's a fun minigame they do every year.
 
they want to attract achievement whores.
 
"let's create this hat, but tell nobody what it means"
 
Speaking of hard problems, I'm implementing SAT
 
We're all achievement whores otherwise we shouldn't be here.
 
2:31 PM
I'm here for the chat
 
@CatPlusPlus as in a solver for the satisfiability problem?
 
I'm here for learning
 
snack overflow is a terrible game
 
and chatting
 
@BenjaminGruenbaum Yeh
 
2:31 PM
whoring days are over
 
@CatPlusPlus It's gonna be a lot easier than C++.
 
in fact I'm so totally inactive on SO that I don't even know how I managed to earn a secret hat
 
@AndyProwl I don't like hats :(
they don't fit well with most avatars
in the end they look bad
 
You have almost a thousand answers, also why are you making a SAT solver there are good ones with very nice heuristics.
 
and yes a slightly wrong angle = still bad
 
2:32 PM
I'd like to read Knuth's implementation but his code is a fucking unreadable nightmare even without that literate shit
@BenjaminGruenbaum Dunno, writing package stuff and there's no library implementation for C#
Well, not good anyway
Also to understand maybe
I'll probably settle for the most naive implementation and worry about it later
 
The most naive implementation is exponential
To be fair the best implementation we know of is also exponential so there's that - it just has a really good polynomial average case.
Knuth's sat solver is not really the best in modern standards to say the least
 
holy shit this looks fun youtube.com/watch?v=rT8fqB9GPBM
 
This is pretty easy to implement en.wikipedia.org/wiki/DPLL_algorithm
 
@AlexM. I'd have a broken neck after 5 meters
 
2:46 PM
Does this make any sense?
 
What's Application
Why not just Task.Run
 
Wpf application
It returns a DispatcherOperation and not a task for some reason.
 
No DispatcherOperation.FromResult() nor interface and ctor is internal.
 
Maybe predates async/await
 
2:53 PM
It is awaitable though.
I wanted something that would work in tests when there is no dispatcher running.
Annoying that ObservableCollection does not handle the ui-thread stuff.
 
Hi,
Can I ask something about debugging/gdb?
 
@dorafmon Before Puppy says "no", please take some time to read the rules :)
 
You may try..
 
3:08 PM
(in short: you can ask, but without thinking that you are entitled to get an answer)
people most often just want to chat here
 
@AndyProwl most don't even want to do that
 
@thecoshman lol, they come here to stay silent?
 
Some people want to watch the lounge burn.
 
"burn motherlounger, burn"
 
@AndyProwl I'm just here for mockery.
 
3:13 PM
@CatPlusPlus that's supposed to come in the next release of WPF last I checked
 
We need a Lounge bot.
 
WPF doesn't run on Mono so can't say I care much for it
 
@milleniumbug I think I've heard that already
 
How about we write a tl;dr to the lounge rules?
 
My tl;dr is common sense.
 
3:17 PM
@Mgetz WPF has some async stuff. Binding has IsAsync. Not very useful ime.
 
But then again, even common sense has to be acquired.
 
tl;dr: go out. NOW.
 
> TL;DR: leave before it's too late
 
tl;dr: no.
 
yeah that would do
 
3:18 PM
@JohanLarsson my understanding is that they are using async await in a very deep refactor of the WPF codebase, which is why it has taken so long
 
Oh, that sounds so great. The WPF codebase can really need a beating.
 
What am I thinking, we already have a Lounge bot.
 
Parts are nice but lots of ew from what I have read on referencesource
 
@JohanLarsson yes it does, the whole goal of WPF was to never allow blocking calls. It fails miserably at that currently.
 
I read a blog somewhere where the guy said WPF is a crappy implementation of great ideas. I agree with that.
 
3:21 PM
@JohanLarsson amen
 
Do you use WPF much?
 
@JohanLarsson I have in the past. But it's been a long time
 
Become a reg lurker in wpf any way. It is not very active so safe lurking.
And it is free :)
 
we'll see
 
And then believe
 
3:35 PM
Is it possible to look at some disassembly at a given address using GDB?
 
maybe
 
I am working on some JIT compiler
And my code crash at some point that is generated by the JIT
I got the adress where the code crash
how can I get the disassembly at that point? I tried disas address but it does not work
 
@dorafmon What is your implementation language?
 
C++
 
I'm sorry
 
3:43 PM
LLVM?
 
yep
 
I know that for debugging symbols you need to generate debugging symbol metadata on the LLVM IR level
but for regular disassembly I don't think anything special is required
however I'm not sure why you'd need to see the disassembly if you're using LLVM IR.
 
user1804599
3:55 PM
@dorafmon you also have to pass the end address
 
user1804599
Disassembling a single byte is silly.
 
user1804599
@Jefffrey What? I know many languages with ::: operators.
 
cringe
 
user1804599
What is your problem?
 

« first day (1540 days earlier)      last day (3401 days later) »