[-] [email protected] 1 points 4 minutes ago

And it feels ever more present to me that publishing things as open-source means maintenance work, which can quickly lead to burnout. People just expect you to provide updates, no matter what your license text says.

David Beazley, big in the python world and one of the OGs of the python ecosystem from back in the 90s, kinda had a moment about this a couple of years ago.

He has or had a few somewhat popular libraries and liked to write things and put them out there. But, IIRC, got fed up of the consumeristic culture that had taken over open source.

I think he put it along the lines of "The kind of open source I'm into is the 'here's a cool thing I made, feel free to use it however you want' kind" ... and didn't have positive things to say about the whole "every open source author is now a brand and vendor" thing.

The result of which, IIRC, was him archiving all of his libraries on GitHub. From a distance, it also seemed like he felt burnt out from a hacking culture in which he no longer felt like he belonged.

[-] [email protected] 1 points 49 minutes ago

I think about this sometimes. The scorecard for the internet. Not sure it’s positive TBH.

In a more sci-fi vein, I wonder if it’s an inflection point for the evolution of society … when mass communication technology develops relative to the educational and political development of the same society.

It feels to me, in the west that is, that we were not culturally ready for mass communication. That we needed at least a few more generations of grappling with society’s problems and framing the role of the individual in the collective. That WWII probably held things back two generations. That we’ve basically squandered an opportunity and may pay the price for centuries down the line.

[-] [email protected] 7 points 17 hours ago

Yea I try to post from mastodon when it makes sense. You’re seeing the mentions as that’s how mastodon links things together. Here on lemmy, the connections are all more structural and so implicit.

This is about as good as lemmy-mastodon interaction can be: when someone posts from mastodon to a lemmy community.

Though now, with automatic hashtag-ing since v 0.19.4, the two can work together better. See https://hachyderm.io/@maegul/112720255264101773

[-] [email protected] 3 points 19 hours ago

Been getting (back) into classic 70s Yes!

Made a playlist of Close to the Edge side A, classics from Fragile (if you know you know) and ending with Ancient Giants under the sun ... comes out to be about album length ... peak prog rock IMO ... and a strangely addictive "album" you can just listen to repeatedly.

3
submitted 22 hours ago by [email protected] to c/neodb

In particular: https://eggplant.place/discover/

Which is running a dev version of neoDB, and so may be unstable, but has English as its main language.

[-] [email protected] 6 points 22 hours ago

One area that I am somewhat knowledgeable about is image/video upscaling

Oh I believe you. I've seen it done on a home machine on old time-lapse photos. It might have been janky for individual photos, but as frames in a movie it easily elevated the footage.

[-] [email protected] 38 points 1 day ago

Yea this. It's a weird time though. All of it is hype and marketing hoping to cover costs by searching for some unseen product down the line ... even the original chatGPT feels like a basic marketing stunt: "If people can chat with it they'll think it's miraculous however useful it actually is".

OTOH, it's easy to forget that genuine progress has happened with this rush of AI that surprised many. Literally the year before AlphaGo beat the world champion no one thought it was going to happen any time soon. And though I haven't checked in, from what I could tell, the progress on protein folding done by DeepMind was real (however hyped it was also). Whether new things are still coming or not I don't know, but it seems more than possible. But of course, it doesn't mean there isn't a big pile of hype that will blow away in the wind.

What I ultimately find disappointing is the way the mainstream has responded to all of this.

  1. The lack of conversation about what we want this to look like in the end. There's way too much of a passive "lets see where the technology and big-corp capitalism take us and hope it doesn't lead to some sort of apocalypse"
  2. The very seamless and reflexive acceptance that an AI chat interface could be an all knowing authority for everything in life ... was somewhat shocking to me. Obviously decades of "Googling" to get the answers to things has laid the groundwork for that, but still, there was IMO an unseemly acceptance of a pretty troubling future that indicated just how easily some dark timeline could arise.
[-] [email protected] 7 points 1 day ago

The number of people I've come across who also dislike the character limit, the number of platforms that don't have it, the number of times people write long microblogging threads and the prior and continued existence of the "blogosphere" count against this defeatist pessimism IMO.

The truly dark take here, IMO, is that we shouldn't underestimate the power of a medium's configuration to shape not just the content and culture on it (that's obvious) but the way its users come to think.

[-] [email protected] 13 points 1 day ago

Yep this.

It’s gotten to the point where a character limit is itself a seriously toxic part of big-social social media, up there with algorithms and shitty moderation choices. But all of the Twitter people don’t see it.

Sure there are threads through reply chains. No one reads the chain. The first post is all most will see. Context collapse and superficiality is inevitable with this simple constraint. The fediverse should move on. Sadly, mastodon is the only platform still dedicated to it and they’re 80% of the fediverse.

If you like short funny quips and shit posts, that’s fine, there’s no character minimum! With long character limits, short quips still abound. Instead, when necessary, you can opt in to longer form text when necessary.

[-] [email protected] 3 points 3 days ago* (last edited 2 days ago)

Edit: oh god, what have I done! Yea, mobile + autocorrect got me good here.

Hopefully corrected version here with original below …


So my hot take since before launch has been that this will be the end of Tim Cook‘s tenure. The more they lean into the product, as it seems they will with the next model, the more likely that seems to me.

Roughly speaking, I get the feeling it’s the first wholly new product pushed by Cook. And a big flop is never good for Apple‘a brand power.

How off do you think I am?


So my hot take since before launch has been that this will be the end of Tim Cook‘s tenure. The note they mean into the product, s as it seems they are with the next model, the more likely that seems to me.

Roughly speaking, I get the feeling it’s the first wholly new product pushed by Cook. And a big flop I’d never good for Apple‘a brand power.

How off do you think I am?

[-] [email protected] 4 points 3 days ago

Ha ... interesting ... they don't feel comparable in the same way to me.

[-] [email protected] 2 points 4 days ago

Hell, I don’t even use bookmarks. I type in the web address for my services every time

Yea, I hear you (I don't use bookmarks either) ... but I don't think this is the average user.

I think the best example is the issues with that come from Lemmy/Mastodon integration. Mastodon posts have a different mentality than Lemmy posts do, not to mention with structure of responses.

This sounds to me like a design issue. In fact, this is kinda my point ... better interaction here, which is the "promise" of the fediverse, may be best addressed with good aggregating clients rather than relying on too platforms to work out their historical differences over the protocol.

[-] [email protected] 2 points 4 days ago

It's funny with the gas leak ... I remember not really minding it at the time ... but I'm not sure I can remember any of it!

23
submitted 5 days ago* (last edited 5 days ago) by [email protected] to c/[email protected]

EDIT: Looked a little deeper/better on GitHub and found this issue, #4865 which is likely the most related issue, and it seems the devs are aware.

It also seems to be a recent v19.5 -ish issue too from some of the comments there


I seem to be encountering what may be a bug with pinning/featuring posts ... interested if anyone's got similar/counter experiences

The issue is that the pinning of a post doesn't get federated correctly.

The conditions, AFAICT are:

  • Post originates from a "federated instance" (IE, an instance other than the community's home instance)
  • The mod action of pinning is also done by a moderator on a "federated instance"
  • Lemmy versions 19.4 or greater (much more tentative, but from a brief perusal, it seems true)

The effect seems to be:

  • The pinning works fine on the "home instance" of the community
  • But federation breaks in two slightly different ways:
    • No pinning occurs
    • If a mod on a "federated instance" tries to pin, after an initially failed federation of "pinning", it will succeed on the federated instance only temporarily

The last dynamic is hopefully a clue to what could be happening (sounds like some queued tasks colliding in an incorrect way)

18
submitted 6 days ago by [email protected] to c/[email protected]

Upvote the film you'd like to watch the most in the comments below!

Nominations are in for July's Fedi Film Club (see nominations post here).

Each one in is a separate comment below, which you can upvote.

And, for clarity, they're also in the list below, in alphabetical order.

If you have any handy tips on the best way to get a hold of any of these, please share! Note though that the high seas in general are likely are well known option.

  • Big Trouble in Little China
  • Dungeons and Dragons: Honour Among Thieves (2023)
  • I’m Thinking of Ending Things (2020)
  • Soylent Green
  • Terminator 2: Judgment Day
  • The Andromeda Strain (1971)
  • The Apartment (1960)
  • The Peanut Butter Falcon (2019)
  • Underwater (2020)
  • Wacko (1982)

And of course, the point of all this is to crowd-source human curated film recommendations. This is definitely a diverse bunch of films, some of which I didn't know about and others I'd never seen. I'll definitely want to watch more than one of these!

11
submitted 1 week ago* (last edited 1 week ago) by [email protected] to c/[email protected]

The about section of the linked page has links and a brief explanation of the story.

In my own words ...

Description of the Turbo-fish syntax

  • Whenever a generic type (see ch 10 of The Book) is involved in calling a function/method or constructing/handling a struct/enum, you may need to specify that concrete type for that generic.
  • This type is provided with the turbo fish syntax: ::<> ... where the type goes between the angle brackets.
  • EG:
let v = Vec::new();

let v2 = Vec::<i32>::new()
  • The elements of v have an undefined type, which rust will infer once an element is pushed into it. But v2 has a defined element type, i32, defined using the turbo fish.

The Story

  • This syntax wasn't always liked, and the double colons (::) thought redundant.
  • But it stuck
  • And was given the name "turbo-fish" by Anna Harren (u/deadstone, Reddit) ... who sadly passed away in 2021.
  • It turns out that the double colons are pretty vital to preventing ambiguity.
  • This is enshrined in the Bastion of the Turbofish which stands as a memorial to Anna Harren ...
  • a test in the language's test suite that ensures that the double-colons syntax isn't removed by directly using the ambiguous syntax that'd arise without it.
  • See if you can understand the test (it took me a while! ... this HN post might help):
let (the, guardian, stands, resolute) = ("the", "Turbofish", "remains", "undefeated");
let _: (bool, bool) = (the<guardian, stands>(resolute));

hint: what are angle brackets normally used for and how are bool types related to that?

7
submitted 1 week ago by [email protected] to c/[email protected]

Nice and handy reference with explanations and examples.

5
submitted 2 weeks ago* (last edited 1 week ago) by [email protected] to c/[email protected]

You've gotta be familiar with Traits to try to work this out.

Just in case you want to try to work it out your self firstGotta say, after hearing that rust is not an OOP/Class-inheritance language, and is strongly and explicitly typed, the Deref trait feels like a helluva drug!

Obviously it's not the same thing, but working this out definitely had me making a couple of double takes.

Somewhat awkwardly, I worked it out through the standard lib docs before reading ch 15 of the book (it's more fun this way!).

And for those who want a quick answer:

  • Read the Deref docs, especially the deref coercion part
  • This allows a variable of a particular type to be implicitly substituted with another variable of a different type.
  • It happens any time a reference is passed in/out of a function, including self in method calls.
    • And obviously requires that Deref be implemented.
  • So sort() isn't implemented on Vec, it's implemented on the slice type ([T]).
  • But Vec implements Deref, substituting [T] for Vec<T> in all function/method calls.
  • Which means Vec gets all of the methods implemented on [T] ... almost like Vec is a subclass of [T]!
  • And yea, OOP people want to abuse this (see, eg, rust-unofficial on anti-patterns)
27
submitted 2 weeks ago by [email protected] to c/[email protected]

Please suggest a film for July's "Fedi Film Club"!

Anything that either you'd like to watch or would recommend to the community.

Please make sure it's more than a year or two old so that it will (hopefully) be available somewhere.

And if possible, provide a quick description for why you'd like to watch or why you suggest it.


68
submitted 2 weeks ago by [email protected] to c/[email protected]

I watched them roughly once every night or two. And I'd previously seen them all.

And I was rather surprised at how I felt about the films afterwards. It seemed really clear that the quality of the films went continuously down after Casino Royal.

I thought Skyfall would stand out as the best followed by Casino Royal. But, in sequence, nah. Despite having clearly positive qualities, it seemed bloated and empty by comparison.

I also thought Quantum of Solace would rank pretty low as I recall thinking little of it at the time it came out. Instead, I thought it paired really well with Casino as a great follow up.

In fact, it felt like the Craig-era was basically Casino + Quantum and "other things". And yea, the "post-Skyfall" films just didn't feel like they were worth the effort. I thought they'd be more passable than they were, but after Casino + Quantum, which, for me, had a real punch and through-line, Spectre + No-Time-to-Die just felt like they were going through the motions and taking up space. At times, they really seemed to be badly flawed. And that's where my impression of Skyfall really hit ... it seemed that was the "what do we do now with this character?" moment and that Skyfall belonged with Spectre etc not the other way round.

Is this common among Bond fans or am I off base here?

20
submitted 2 weeks ago by [email protected] to c/[email protected]

About 10 mins. Focuses on some of the shooting and camera choices in Alien.

Specifically how "dirty shots" were used ("dirty" meaning some unfocused object "dirties" up the shot) and how the 2 camera setup were used.

I think the video was trying to make a point about how Alien was kinda "modern" in this regard. I don't know cinema theory well enough to know ... definitely interesting though!

Either way ... it's some Alien appreciation and this little snippets are definitely good reminders of how awesome the film is.

4
submitted 2 weeks ago by [email protected] to c/[email protected]

Continuing on from Chs 5 & 6 of "The Book" (see "Reading Club" post here), I don't think the Copy and Clone traits were quite given sufficient coverage.

So I thought I'd post my understanding here.

Tl;Dr

Copy Clone
Implicit Explicit (v.clone())
Simple (memcpy) Arbitrary
"cheap"/quick Potentially expensive
Simple types Any type

Derivable Traits

  • These are traits which have a standard implementation that can be freely and easily applied to structs and enums (IE, custom types).
  • The ones available in the standard library are listed in Appendix C of The Book. Other libraries/crates can apparently implement them too (though I don't know of any).
  • They are part of and use the Attributes syntax (see Documentation in the Rust Reference here): #[ATTRIBUTE].
  • To derive a trait we write #[derive(TRAIT1, TRAIT2, ...)] above our type declaration
#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

The Three Step Ladder

  • The two traits, Clone and Copy, are about providing opt-in options for custom types around what "ownership semantics" they obey.
  • "move semantics": are what we know for most types and have learnt about in ch 4. There is no copying, only the moving of ownership from one stack to another or the use of references and the "borrow checker" that verifies safety.
  • "Copy semantics": are what basic types like i32 enjoy. No ownership movements. Instead, these variables get implicitly copied, because they're simple and copying involves the same work involved in passing a memory address around.

The RFC for these traits puts it nicely ...

From RFC 0019 - Opt in built-in traits document on the Copy Trait

Effectively, there is a three step ladder for types:

  • If you do nothing, your type is linear, meaning that it moves from place to place and can never be copied in any way. (We need a better name for that.)
  • If you implement Clone, your type is cloneable, meaning that it moves from place to place, but it can be explicitly cloned. This is suitable for cases where copying is expensive.
  • If you implement Copy, your type is copyable, meaning that it is just copied by default without the need for an explicit clone. This is suitable for small bits of data like ints or points.

What is nice about this change is that when a type is defined, the user makes an explicit choice between these three options.

IE, "move semantics" are the default, "copy semantics" can be adopted, or clone for the more complicated data types or for where it is desired for duplication to be explicit.

  • Note that Clone is a supertrait of Copy, meaning that we have to derive Clone if we want to derive Copy, but can derive Clone on its own.
struct Movable {
	field: i32
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}

Example

Demonstrate how a struct with Copy obeys "copy semantics" and gets copied implicitly instead of "moved"

  • Declare structs, with derived traits, and define a basic function for taking ownership
fn check_if_copied<T: Clone>(x: T) -> T {
    println!("address: {:p} (from inner owning function)", &x);

    x
}

#[derive(Clone)]
struct OnlyClonable {
    field: i32,
}

#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}
  • Instantiate variables of both structs, cl that has Clone and cp that has Copy.
  • cl is moved into check_if_copied and so is no longer live or usable afterward.
  • cp is not moved into check_if_copied and lives beyond the call of check_if_copied.
let cl = OnlyClonable{field: 0};
let cp = Copyable{field: 1};


// OnlyClonable type obeys "move semantics"

check_if_copied(cl);  // cl gets moved in as it's not copyable

// COMPILER ERROR.  Can't do this! As moved into `report_if_copied`!
println!("address: {:p}", &cl);

// Copyable obeys "copy semantics"

check_if_copied(cp);  // cp is implicitly copied here!

// Can! as not moved but copied
println!("address: {:p}", &cp);

Demonstrate the same but with mutation

let mut mcp = Copyable{field: 1};

let mcp2 = check_if_copied(mcp);  // as mcp was implicitly copied, mcp2 is a new object
mcp.field += 100;

// values will be different, one was mutated and has kept the data from before the mutation
println!("mcp field: {}", mcp.field);
println!("mcp2 field: {}", mcp2.field);

prints ...

mcp field: 101
mcp2 field: 1

Application and Limitations

Copy

  • Copy is available only on types whose elements also have Copy.
  • Such elements then need to be the numeric types (i32, f64 etc), bool and char. So custom types that contain only basic data types.
#[derive(Copy, Clone)]
struct Copyable {
    field: i32,
}
  • Any field with a non-copyable type such as String or Vec cannot be made Copyable
// Copy cannot be derived as `f2: String` does not implement Copy
#[derive(Copy, Clone)]
struct NotCopyable2 {
    field: i32,
    f2: String
}
  • But custom types that have the Copy trait as fields work fine, like Copyable from above as a field:
#[derive(Copy, Clone)]
struct Copyable2 {
    field: i32,
    more: Copyable
}
  • Beyond this, Copy is not overloadable and can't be implemented in rust (without using unsafe presumably). It's really just a primitive of the language it seems (see source code for the Copy trait).

Clone

  • Like Copy, Clone relies on the struct's fields also implementing Clone.
  • A number of standard library types have implemented Clone (see list of implementors in the documentation), including the fundamental collections you'll find in chapter 8 of The Book: String, Vec, HashMaps and also arrays.
  • Thus the code below, which involves a more complex Struct with fields that are a String, array and Vec, compiles just fine.
  • With the clone() method, Clonable is now able to be duplicated allowing the original to be usable after being passed in to check_if_copied().
#[derive(Clone)]
struct Clonable {
    name: String,
    values: [f64; 3],
    data: Vec<i32>
}

let clonable = Clonable{
    name: "Sam".to_string(),
    values: [1.0, 2.0, 3.0],
    data: vec![111, 222]
};

// clonable is duplicated with the `.clone()` method
check_if_copied(clonable.clone());

// original still usable as it was never moved
println!("Name; {}", clonable.name);
  • But, unlike Copy, is overloadable, which means you can implemented Clone for your custom types however you want if necessary.
  • This would be jumping ahead a bit to Traits, but we could implement Clone for our struct above ourselves with something like the below:
struct Clonable {
    name: String,
    values: [f64; 3],
    data: Vec<i32>
}

// Just use each field's `.clone()` implementation, much like the default would do
impl Clone for Clonable {
    fn clone(&self) -> Self {
        Self {
            name: self.name.clone(),
            values: self.values.clone(),
            data: self.data.clone()
        }
    }
}
  • Or we could see how Clone is implemented for Option:
impl<T> Clone for Option<T>
where
    T: Clone,
{
    fn clone(&self) -> Self {
        match self {
            Some(x) => Some(x.clone()),
            None => None,
        }
    }
}
  • Basically relies on the implementation of Clone for the inner value inside Some. Note the where clause that limits this to Option variables that contain values that have the Clone trait.

Deep or Shallow Duplication

  • In the case of Copy, duplication should always be "deep".
    • Which isn't saying much due to the simplicity of the types that can implement Copy.
  • In the case of Clone ... it depends!
    • As the implementations of Clone on the fields of a custom struct/enum are relied on, whether the duplication is deep or shallow depends entirely on those implementations.
    • As stated in the RFC quoted above, Clone is for complex data structures whose duplication is not trivial such that compromises around performance and duplication depth may need to be made.
    • A clue can be discerned from the signature of the implementation. For Option, above, the inner value was restricted to also having implemented Clone, as the value's .clone() method was relied on. Therefore, Option's is deep.
    • Similarly, the Clone implementation for Vec has the same restriction on its elements: impl<T, A> Clone for Vec<T, A> where T: Clone, (see source code), indicating that its implementation is at least one level deep.

Overall, this seemed a fundamental part of the language, and I found it weird that The Book didn't address it more specifically. There's nothing really surprising or difficult here, but the relative roles of Clone and Copy, or the "three step ladder" are important to appreciate I think.

17
submitted 2 weeks ago by [email protected] to c/[email protected]

Relevant for @[email protected] 's next stream next week as they're hitting smart pointers.

cross-posted from: https://programming.dev/post/16059115

Found this on Mastodon https://fosstodon.org/@dpom/112681955888465502 , and it is a very nice overview of the containers and their layout.

72
submitted 2 weeks ago by [email protected] to c/[email protected]

The Idea

  • Watch and discuss movies together (kinda like a book club)
  • "Crowd source" recommendations for not-entirely-new films (IE, older than a year or so, let's say)
  • Aim for generally bettering or curating our film "diet"

How it will work (at least at first)

  • 1 film a month
  • First, a post to take nominations/suggestions
    • Post any film you want to watch, or have heard good things about, or recommend to everyone else
  • Second, a post to take votes on the nominations
  • And then we watch and discuss the winner

First round will start next month (July)

Please share any thoughts/feedback, though we'll likely run this at least once first before making any changes, just to feel it out

view more: next ›

maegul

joined 2 years ago
MODERATOR OF