ChanServ changed the topic of #glasgow to: glasgow debug tool · code https://github.com/GlasgowEmbedded/glasgow · logs https://freenode.irclog.whitequark.org/glasgow · discord https://1bitsquared.com/pages/chat · production https://www.crowdsupply.com/1bitsquared/glasgow · no ETAs at the moment
electronic_eel has quit [Ping timeout: 246 seconds]
electronic_eel has joined #glasgow
<whitequark> TiltMeSenpai: glasgow already uses async/await though?
<d1b2> <TiltMeSenpai> does it? I might have just been looking at pysim
<whitequark> pysim is extremely different from glasgow
<d1b2> <TiltMeSenpai> ok, fair
<d1b2> <TiltMeSenpai> oh wait, no I was talking about nmigen
<whitequark> and the problem with pysim is that you do things like `yield x` to read signals
<whitequark> which you just can't do with async/await
<d1b2> <TiltMeSenpai> sorry, trying to figure out where I was in the convo
<d1b2> <TiltMeSenpai> in python 3.6, they added async iterators, they're yields in async functions that you access with async for..
<whitequark> nope, won't work
<d1b2> <TiltMeSenpai> ok, you know your code better than me
<whitequark> async iterators are a composition of async code and coroutines
<whitequark> what i want is an `await nonfrom` basically
<whitequark> (normal `await` is equivalent to `yield from`)
<d1b2> <TiltMeSenpai> thanks for explaining
<whitequark> pysim at some point will migrate to using async/await
<whitequark> but it's going to be a fairly significant breaking change
<awygle> can you elaborate on "await nonfrom"?
<whitequark> okay, how much do you know about coroutines and async/await in python?
<awygle> ... nothing.
<awygle> ok that's not fair, i know what a coroutine _is_
<awygle> idk what python does, not even whether they're stackless or stackful
<whitequark> okay
<whitequark> so. coroutines. if you use a `yield` or `yield from` construct, that function becomes a coroutine, aka a generator
<awygle> right
<whitequark> `yield` lets you suspend a coroutine, exchanging a value either direction
<whitequark> `yield from x` semantically works the same as `for y in x: yield y`, but it's done on the interpreter level
<whitequark> [well not quite because yield returns a value, but you get the concept]
<whitequark> i think this is classified as "stackless" but you can compose them
<awygle> okay
<whitequark> now, async/await. they started out as the exact same thing. in fact `async` used to be a decorator
<whitequark> `async` is a way to say "this function must be an IO coroutine, even if it doesn't have any yield points"
<whitequark> (by "IO coroutine" here I mean the kind of coroutine used by async/await)
<whitequark> so with just the `yield`/`yield from` syntax, you don't have an easy way to say that. you could do something silly like `if 0: yield`
<whitequark> `await` is the same as `yield from` for IO coroutines
<whitequark> and it used to be just `yield from`
<awygle> okay
<whitequark> there's no equivalent of `yield` for IO coroutines.
<whitequark> so you can have IO coroutines yield to other IO coroutines... but the surface syntax doesn't expose any way to actually request the reactor to do some useful work
<awygle> okay
<awygle> i see what you're saying
<awygle> this is maybe related to my longstanding discomfort with async/await generally and in C# and Rust specifically, but let's not pull that into this discussion lol
<whitequark> also the reason I'm saying "IO coroutines" is that since async/await became a core feature, they baked it in deeper, and now you can have a function that is *both* an IO coroutine and a normal coroutine / generator
<whitequark> the `async for` stuff TiltMeSenpai mentioned earlier
<awygle> so in the "legacy" yield/yieldfrom syntax, you want to be able to yield out of, like, sim modules and stuff
<awygle> and there's no good way to do that in the async/await syntax (at least not at the level we've discussed to this point)
<whitequark> yeah. migen used yield/yield from since it predates async/await
<whitequark> much less async/await in core
<whitequark> rjo suggested that Values and Assign become awaitables
<whitequark> this isn't unreasonable
ExeciN has joined #glasgow
Sellerie has quit [Quit: The Lounge - https://thelounge.chat]
Stormwind_mobile has quit [Ping timeout: 240 seconds]
tomtastic has quit [Quit: ZNC - https://znc.in]
tomtastic has joined #glasgow
Stormwind_mobile has joined #glasgow
ExeciN has quit [Ping timeout: 260 seconds]
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #glasgow
spacekookie has quit [Quit: **aggressive swooshing**]
spacekookie has joined #glasgow
spacekookie has quit [Client Quit]
spacekookie has joined #glasgow
Stormwind_mobile has quit [Ping timeout: 256 seconds]
Stormwind_mobile has joined #glasgow
Sellerie has joined #glasgow
bvernoux has joined #glasgow
spacekookie has quit [Quit: No Ping reply in 60 seconds.]
spacekookie has joined #glasgow
Sellerie has quit [Quit: The Lounge - https://thelounge.chat]
<whitequark> wheee
Sellerie has joined #glasgow
bvernoux has quit [Quit: Leaving]
<gruetzkopf> neat!
<gruetzkopf> (i kinda got it in my head to get yosys and nextpnr working on mips64be (IRIX)
<gruetzkopf> not that that's useful or fast..