How would I add a new ranking algorithm to Lemmy as a contributor? I’m a developer by trade, but unfamiliar with Rust and the codebase of Lemmy specifically. It doesn’t seem like Lemmy has a concept of ‘ranking plugins’, so whatever I do would have to involve an MR.
Specifically, I’d like to introduce a ranking system that approximates Proportional Approval Voting, specifically using Thiele’s elimination methods, like is used in LiquidFeedback.
I’m pretty sure that with a few tweaks to Thiele’s rules, I can compute a complete ranking of all comments in a thread in O(ClogC + E + VlogC)
, where C
is the number of comments, E
is the total number of likes, and V
is the number of users. This would also support partial approvals, upvotes could decay with age.
I believe this would mitigate the tendency towards echo chambers that Lemmy inherits from Reddit. Lemmy effectively uses Block Approval Voting with decays to rank comments and posts, leading to the same people dominating every conversation.
Adding a new sort type is not a big deal, so dont worry about it. And a new admin setting for this would also require UI changes, so the new sort type is easier overall.
The current sort options calculate the rank for each post only from the data on that post (number of votes, creation time). Your suggested algorithm looks much more complicated than that, as it requires two iterations and needs to access data from multiple posts at once. Im not sure if this can really be implemented in a way thats performant enough for production use. Anyway feel free to open a pull request, then hopefully other contributors can help you to get it working.