soooooo I had this like, weird structure in Rust that was a struct that held an Option> and I used a match statement on the From implementation to determine whether it was a 'real' instance of the struct that contained all the real values, or whether i...
-
Xandra Granade 🏳️⚧️replied to Xandra Granade 🏳️⚧️ last edited by
@aud Bonus points if you can somehow avoid `dyn` in writing that type.
-
Asta [AMP]replied to Xandra Granade 🏳️⚧️ last edited by
@[email protected] @[email protected] Okay, SO, a couple paragraphs in and I'm realizing I've actually done some of this before
(one of my biggest issues with a non-CS background is sometimes I'm missing key vocab terms despite understanding the concept)State machines not only encode which transitions are valid, in doing so they also encode which transitions are invalid.
I actually did a whole huge ass graph like this back at Cray where the transition between states had a defined syntax and represented alterations to an underlying matrix. Being able to reword this in the language of state machines would be useful. But also, now I'm sort of starting to understand some @[email protected] 's excitement for parsers because I found it immensely satisfying to work out the proper mathematical rules for transitions and implement them.
I should read more, here... -
Xandra Granade 🏳️⚧️replied to Asta [AMP] last edited by
@aud @yosh @hipsterelectron The downside to having a mixed CS/physics background is being able to bore everyone with useless pedantry, even if that "pedantry" is just a useful set of structures for my brain to think in. But I digress.
-
Asta [AMP]replied to Xandra Granade 🏳️⚧️ last edited by
@[email protected] Yeah, I suspect there's some dyn going on. I considered it.
I was trying to come up with the schema I've used here and all I can think of is de-heritance or out-heritance. I can't decide if I love it or hate it, but I also realized it's absolutely applicable even when you don't know all the possible children you'd want to create.
https://codeberg.org/Astatide/satyr/src/commit/667664b2e6d62bafb574459cce6cc2da65ac5384/src/primitives/activity_streams/extended/mod.rs#L117
It's basically an enum map of all the ActivityStreams types that inherit from Object (with some imperfections and kludges here and there). -
Asta [AMP]replied to Xandra Granade 🏳️⚧️ last edited by
@[email protected] @[email protected] @[email protected] ask me about how chemical symmetry, which forces chemists to learn group theory so they can understand how rotational symmetry and groups (and the operators that define certain rotation operations on the chemicals) can actually impact reactivity, has totally fucked my brain.
Super useful stuff though. It's why I can't ever let myself not be in love with operator overloads. -
Xandra Granade 🏳️⚧️replied to Asta [AMP] last edited by
@aud @yosh @hipsterelectron Oh, the abuses of operator overloading I've committed in the name of fun--- I mean, concise and readable notation.
(People get salty if you use & to mean the tensor product, even if there's no other better options available.)
-
Asta [AMP]replied to Xandra Granade 🏳️⚧️ last edited by [email protected]
@[email protected] @[email protected] @[email protected] I stand by my assessment that implementing operator overloads for the structures of a genetic algorithm to create both a programmatic and representational syntax is super super useful for code readability
(oh, you want to 'mix' two genetic lines A and B?(A + B)/2
aaaand you're done)