@[email protected] It's a hell of a lot easier to climb out of a pit if you don't keep digging till you hit bedrock.
Posts
-
Palestine is one of the reasons I would vote for Kamala Harris. -
test postokay! I think I'm federating again? That... was strange.
-
test posttest post
-
I think maybe tomorrow I will do something silly like maybe stream myself coding, which will involve a lot of swearing and mutteringI think maybe tomorrow I will do something silly like maybe stream myself coding, which will involve a lot of swearing and muttering
But it will also mean I am distracted, and if anyone else wants to watch it they can also be distracted
I’ll post it if I do! -
Enemies in the game dynamically solve the game state for the best outcomes from a series of weights to be able to effectively use their different abilities for different situations They're always surprising me!@[email protected] this is so cool
-
hmmmmmm...@[email protected] thinking about this more (the idea of FLOSS not going far enough), I feel like you can sort of easily prove the reverse (do FOSS/FLOSS go far enough?) by simply pointing out that if “open source” by itself was the only necessary requirement, then Mullenweg wouldn’t be able to burn down Wordpress. It’s not just the source; you have the networks, both interpersonal and software (who maintains the software? Who is in charge? Who gets along with whom? Are they working together for a common goal? Does the code rely on infrastructure, like a plugin server? Who owns that server? What other dependencies exist? Is there necessary knowledge that isn’t written down but shared? Is creating a new server or instance too difficult and so helps create inertia for the existing systems?)
God. I feel like we need more people like @[email protected] in general; the psychology of how these projects remain under control of a few select individuals (for them to burn or earn) despite being freely fork-able is… definitely interesting. -
Objects in JavaScript, just as in many other programming languages, can be compared to objects in real life.@[email protected] "Object", "fizz", "buzz" are amongst my top "banned" terms in programming.
As in if I am ever formally recognized as queen of all (I am queen of all, but you know how it is with nation states and recognizing things) they will be instantly banned from any spec or example problem -
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...@[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) -
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...@[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. -
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...@[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). -
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...@[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... -
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...@[email protected] aha! Yeah, I briefly did that... then realized it messed with my elegant change from earlier and would require rewriting the other functions
It's sort of a balance, isn't it, between getting as much out of the type system as possible and also retaining flexibility. As an unrelated example, in this code, currently anything that extends fromObject
in ActivityStreams (which is like 99% of it) is ... well, anObject
. I'm like... well, I didn't really retain much benefit from the type system in this case, did I.
I see why other crates have done it with traits now, but my brain just still kind of hates it and I think it makes it a lot harder to grok both the code and the ActivityStreams objects themselves.
I hardly think it's a code requirement, but I don't think you could easily learn ActivityStreams from the crates I've seen thus far. I would like for my own code to be able to do that for someone, however, if possible. I guess that's why I'm torturing the type system like this. -
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...@[email protected] thanks. I usually use song lyrics when I'm in a professional setting (or silly movie quotes; pretty sure I wrote a unit test at Cray that used lines from Blade Runner just because I could)...
... but here, it's fuck all the way! Interestingly, I'm still at only 5 instances of the word "fuck" in the codebase. -
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...@[email protected] Not only is this rather unreadable (I want readable code!) because it's just a lot, but maintenance would be a nightmare (not that I expect ActivityPub/ActivityStreams to change)
-
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...@[email protected] The 'goal' here (because my real
Object
has like, 33 fields) would be to not have to write something like:Object::Object { _contextAndType, id, attachment, attributedTo, audience, content, context, contentMap, name, nameMap, endTime, generator, icon, image, inReplyTo, location, preview, published, replies, startTime, summary, summaryMap, tag, updated, url, to, bto, cc, bcc, mediaType, duration, _extra, _extends }
in the match statement, but instead something much more concise -
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...@[email protected] https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=69b24bbfcad69237ac308502691c0eb6
Okay! That's a cut down version of what I'm working on
(normally I never use the termObject
in a program, ever, for a trillion reasons, but this is from the ActivityStreams stuff I'm doing and there areObjects
everywhere) -
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...@[email protected]
sure! Just gimme a second here... -
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...@[email protected] ... also ignore all the unclosed braces. hah.
-
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...@[email protected] hmmm... so hilariously I didn't realize that operator existed
(me earlier: "time to put Rust on my CV!")
But also... I'm not sure it does work here, although I'm still playing around with it. I can definitely use it but it doesn't seem to match what I want (which is basically packing all the internal struct fields into a variable).
https://doc.rust-lang.org/beta/book/ch18-03-pattern-syntax.html
The use case they have there (search for bindings) is definitely useful, although not quite what I'd like in my case.
What I would like is something like this:
(where Object has a field called id). This doesn't seem to work. Neither does:match self { Object::Object { obj } => { if obj.id.is_some() { ds.field("id", &self.id().unwrap()); }
that one is sort of easy; I'm just like... pointing to the struct variant rather than a real thing. But even if I try and add anything such as...match self { obj @ Object::Object => { if obj.id.is_some() { ds.field("id", &self.id().unwrap()); }
The error complaining aboutmatch self { obj @ Object::Object { .. } => { if obj.id.is_some() { ds.field("id", &self.id().unwrap()); }
obj
just pointing to a struct variant goes away, but I still can't access the fields.
I'm guessing I have little choice except to basically unpack all the struct fields.
Still, really cool stuff with the@
operator. -
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...@[email protected] well, actually, I only have to unpack the ones I want, which isn't too bad but in this case I want literally all of them.