<_whitenotifier-9>
[amaranth-lang/amaranth-lang.github.io] github-merge-queue[bot] e992e60 - Deploying to main from @ amaranth-lang/amaranth@94becb521ab7537f05d6facb1e32ea3e99a94873 🚀
<whitequark[cis]>
<Wanda[cis]> "because it passes a View to ..." <- oh. oops. i guess we should consider removing the flatten, but thats rfc worthy...
<Wanda[cis]>
indeed
<Wanda[cis]>
I'm considering making it do a little modified flatten that stops when it encounters a ValueCastable even if it happens to be iterable
<Wanda[cis]>
not completely sure if it's a good idea
<whitequark[cis]>
is flatten in cat a good idea in first place?
<Wanda[cis]>
not really, no
<whitequark[cis]>
then we should stop having it
<whitequark[cis]>
i would say put a warning into 0.5; not "will be removed" but "considered for removal, tell us if you need it"
<Wanda[cis]>
the question becomes what even is Cat interface
<Wanda[cis]>
I think both Cat(*iterable) or Cat(iterable) are used?
<Wanda[cis]>
like, we definitely want to remove deeper or mixed nesting, but even just having these two can result in weirdness
<Wanda[cis]>
on edge cases
<whitequark[cis]>
oh, you're right
<whitequark[cis]>
this... is actually quite annoying
<whitequark[cis]>
I wish we had a corpus of Amaranth code we could use like crater
<Wanda[cis]>
I looked into the possibility of killing flatten this afternoon already
<Wanda[cis]>
Cat is the tricky one
<whitequark[cis]>
rite
<Wanda[cis]>
the other two uses that are visible in the interface (m.domains += and m.submodules +=) can be solved by just handling two cases (Iterable or ClockDomain/Elaboratable), and it won't change semantics unless someone is insane enough to have an iterable elaboratable, in which case they deserve whatever happens anyway
<Wanda[cis]>
but with Cat, as we have just seen, we can legitimately have an interable ValueCastable
<Wanda[cis]>
(of course, with ArrayLayout specifically it doesn't matter if we Cat the whole array or its flattened pieces, but that doesn't have to be true in general)
<whitequark[cis]>
yeah...
<Wanda[cis]>
(say you are in an unhealthy relationship with IBM and like to index your bitvectors starting from MSB)
<whitequark[cis]>
that is actually against python iterable rules
<Wanda[cis]>
<del>(I am getting spray-bottled for this, aren't I)</del>
<whitequark[cis]>
myhdl does it anyway ofc
<whitequark[cis]>
theres a guide note on that
<Wanda[cis]>
I mean you could imagine an IBMArrayLayout where lower indices go in MSBs, it wouldn't violate python iterable rules since it's self-consistent, it just isn't consistent with array.as_value()
<Wanda[cis]>
<whitequark[cis]> "I wish we had a corpus of..." <- that would be neat, but we don't have anything like Cargo that makes it possible
<Wanda[cis]>
<del>hey if we made everyone use `amarath.cli`...</del>
<whitequark[cis]>
manually collected is fine
<whitequark[cis]>
<Wanda[cis]> "I mean you could imagine an ..." <- ah yeah