Sublinks Aims to Be a Drop-In Replacement for Lemmy

Sean Tilley@lemmy.world to Fediverse@lemmy.world – 358 points –
Sublinks Aims to Be a Drop-In Replacement for Lemmy
wedistribute.org

Seems like an interesting effort. A developer is building an alternative Java-based backend to Lemmy's Rust-based one, with the goal of building in a handful of different features. The dev is looking at using this compatibility to migrate their instance over to the new platform, while allowing the community to use their apps of choice.

310

Too bad it's java

I see you woke up and chose violence.

I just self host and avoid Java like the plague due to how annoying it is to manage

3 billion devices can't be wrong…

One dude writing a Java server app, compared to Google writing an operating system, pretty equal comparison lol

What's annoying about it? Deploying a war to tomcat is one of the easiest things one can do.

If you are a Java shop, and you do tomcat, then cool, maybe you've worked out the mysteries if Java deployment and managing resources (ahem, memory), and upgrades etc over the life cycle of a project. But most people doing deployment don't want a one off Java app as a snowflake in their intra, if they can help it because it requires more buy into the ecosystem than you want

Browsing the code makes me angry at how bloated Java projects are:

package com.sublinks.sublinksapi.community.repositories;

import com.sublinks.sublinksapi.community.dto.Community;
import com.sublinks.sublinksapi.community.models.CommunitySearchCriteria;
import com.sublinks.sublinksapi.post.dto.Post;
import com.sublinks.sublinksapi.post.models.PostSearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;

public interface CommunitySearchRepository {

  List allCommunitiesBySearchCriteria(CommunitySearchCriteria communitySearchCriteria);

}

Every file is 8 directories deep, has 20 imports, and one SQL statement embedded in a string literal. 😭

Most IDEs will handle the imports for you and auto collapse them

Ignoring the problem doesn’t make it better

How would you do "better" imports then?

*Vaguely wave arms towards the few dozens languages that do imports right*

I don’t mind Java personally, but let’s not pretend that its import syntax and semantics is at the better side of the spectrum here.

Just look at… Go, Haskell, TypeScript, Rust, even D has a better module system.

Isn't Go just the equivalent of only doing asterisk-imports in Java, just without (and fair enough, Java has 0 need to do that 😂) repeating the import-keyword?

There are multiple things in Go that make it better.

But just for giving a few thoughts about Java itself;

  • being able to import a package and use it as a namespace would already go a long way
  • being able to import multiple things from a package without listing separate line for each items
  • not having to go from the root of the whole fucking world to import a package would be great
  • having the ability to do relative imports to the module I’m writing would be great

These are like “module 101” things. Like, you’re right that the IDEs nowadays do most of that, but IDEs also get it wrong (“oh you meant a THAT package instead of that other one”) and reading the code without an IDE is still a thing (code reviews for example) which means the longer the import section (both vertically and horizontally) the harder it is to work with. And if you don’t look at all imports carefully you may miss a bug or a vulnerability.

Also, Java is the only language I know of that has such a span on the horizontal. The memes about needing a widescreen monitor for Java is actually not a joke; I never had to scroll horizontally in any other language. To me that’s just insanity.

Also, if you’re gonna make it the whole universe as the root of your package structure, we already have DNS and URI/URLs for that. Let me use that!

And don’t get me started as only-files-as-packages while simultaneously having maybe-you-have-multiple-root for your code… makes discovery of related files to the one you’re working with very hard. Then of course the over reliance on generated code generating imports that might or might not exist yet because you just cloned your project…

And what's bad about that? As in, how is the verbosity a negative thing exactly? More so because virtually any tool can be configured to default-collapse these things if for your specific workflow you don't require the information.

At the same time, since everything is verbose, you can get very explicit information if you need it.

Here's an example:

https://github.com/sublinks/sublinks-api/blob/main/src/main/java/com/sublinks/sublinksapi/community/listeners/CommunityLinkPersonCommunityCreatedListener.java

IMO that's a lot of code (and a whole dedicated file) just to (magically) hook a global event and increase the subscriber count when a link object is added.

The worst part is that it's all copy/pasted into a neighbouring file which does the reverse:

https://github.com/sublinks/sublinks-api/blob/main/src/main/java/com/sublinks/sublinksapi/community/listeners/CommunityLinkPersonCommunityDeletedListener.java

It's not the end of the world or anything, I just think good code should surprise you with its simplicity. This surprises me with its complexity.

Yeah but that's more on the coder. Like you indirectly say, they could just as well have had a single listener for community update events, since they all share the data structure for such events (I would assume, haven't looked around too much).

And to me as a professional java coder, I will say it's just not complex. The scaffolding you mentally discard after a week of working with Java unless you're looking for something related to do the scaffolding - and then it's cool that it's all explicitly there, this has helped me countless times in my career and is one of the big strengths of such verbose languages - and beyond that and some design choices I would not have made that way related to naming and organization, there's not much code there to begin with. In modern Java you might just do this in a lambda supplied in the place where you hook the events, anyways.

I find that Java is overly Verbose, but it’s much better than the alternative of underly verbose.

Java really follows the single class for single functionality principle, so in theory it makes sense to have these located in different classes. It should probably be abstracted to a shared method, but it shouldn’t be in the same file.

At least to me this looks like simplicity, but I’ve been writing Java in some capacity since 2012.

It's not just the visible complexity in this one file. The point of it is to keep a subscriber count in sync, but you have that code I referenced above, plus:

LinkPersonCommunityCreatedEvent LinkPersonCommunityDeletedEvent LinkPersonCommunityCreatedPublisher LinkPersonCommunityDeletedPublisher

And then there are things like LinkPersonCommunityUpdated[Event/Publisher] which don't even seem to be used.

This is all boilerplate IMO.

And all of that only (currently) serves keeping that subscriber count up to date.

And then there's the hidden complexity of how things get wired up with spring.

And after all that it's still fragile because that event is not tied to object creation:

  @Transactional
  public void addLink(Person person, Community community, LinkPersonCommunityType type) {

    final LinkPersonCommunity newLink = LinkPersonCommunity.builder().community(community)
        .person(person).linkType(type).build();
    person.getLinkPersonCommunity().add(newLink);
    community.getLinkPersonCommunity().add(newLink);
    linkPersonCommunityRepository.save(newLink);
    linkPersonCommunityCreatedPublisher.publish(newLink);
  }

And there's some code here:

https://github.com/sublinks/sublinks-api/blob/main/src/main/java/com/sublinks/sublinksapi/api/lemmy/v3/community/controllers/CommunityOwnerController.java#L138C31-L138C50

    final Set linkPersonCommunities = new LinkedHashSet<>();
    linkPersonCommunities.add(LinkPersonCommunity.builder().community(community).person(person)
        .linkType(LinkPersonCommunityType.owner).build());
    linkPersonCommunities.add(LinkPersonCommunity.builder().community(community).person(person)
        .linkType(LinkPersonCommunityType.follower).build());

    communityService.createCommunity(community);

    linkPersonCommunityRepository.saveAllAndFlush(linkPersonCommunities);

that is able to bypass the community link service and create links in the repository directly, which would presumably not trigger than event.

Maybe there's a good reason for that, but it sure looks fragile to me.

how is the verbosity a negative thing exactly

Fun fact, studies have found that the number of bugs in a program is proportional to the number of lines of codes, across languages. More lines of codes, more bugs, even for the same math and edge cases. So a more verbose language tends to have more bugs.

Interesting, but did this include web code and code only one person really ever works on?

Because on the pure backend level, I have observed the reverse over my career. The shorter, the "smarter", the "cooler" the code, the more buggy it is. Not based on the code itself, but based on the developer inevitably leaving the company at some point. Meaning that what matters all of is a sudden is how verbose, how documented and how explicit the code is, because the bugs come from someone else messing with it as they get to take it over. It's a legacy problem in a lot of ways.

Hence me saying that if solo projects are included, they probably tilt this massively as they'll never really run into this problem. Like say, you just scan github or something. Of course most projects in there are solo, of course the more lines the more room for bugs.
But in an environment where you're not solo coding, the issue is not getting the code to run and having it have no programmed bugs, but to be able to have someone else understand what you did and wanted to do in a meaningful amount of time, especially as they have to mutate your code over years and decades. Or maybe it's just that the bugs no longer are what "matters", as fixing code bugs is cheap compared to the endless hours wasted from "clever" code being unmaintainable. 🤷

I have a similar experience, in that anytime I heard someone hating on the verbosity of Java it was never the good devs the ones who can write a code that's readable a few months later.

Its still better than any python project lol

Really? I find python imports to work very similar to cpp in practice.

But you really dont see what the function wants or requires or returns ( except with typehints, but they dont work most of the time and then its not enforced in any way )

Larger, modern python projects always use type hints, for this specific reason.

In the past you had PyDoc, which also scratched that itch.

Barring that, contributing to a python project is very difficult without an IDE that performs type checks for you (which is unreliable).

Correct! As i already contributing to a big ass python project at work. We will rewrite a Big Project from python to c# in under 1 month.

Just you wait until your developers learn about the var keyword - it's going to be Python 2.7 PTSD incidents all over again 😂

Isnt that already default on all variables? Its like a var(in js)?

Nope, was added to dot Net after the fact. Normally you declare each type by hand, e.g.

ArrayList myCoolList = new ArrayList();

vs

var myCoolList = new ArrayList();

The second example is why the keyword was added, but now imagine you have a function call returning an unknown type, and then things will start to get super funky.

E.g.

var myCoolBook = BuildBookData(input);

...one step forward and then the same step back 😂 (disclaimer: I do actually like C#, though)

The good thing about the var keyword is that it’s still statically typed. The IDE can figure out the type for you if you hover over it.

But what happens if you don't use an IDE? That was the original point. Even if it isn't statically typed, a python IDE can also do its best to guess the type of an object.

The point is to have code that's legible without dependence on large, third party tools.

Ahh you mean the implementation of var in other langauges than python, i missunderstood you there! Yeah var is a bit risky to use in that case, same i like c# too! Its pretty reliable and stable.

Yep, I was specifically talking about C#'s implementation.

I worked with some large C# code bases, and you could always see the point in time in which an individual developer would finally get comfortable with var - it's when the code would start getting unreadable. 🤣

2 more...
2 more...
2 more...
2 more...
2 more...
2 more...
2 more...
2 more...
2 more...
2 more...
3 more...

There's nothing wrong with java

There is nothing inherently wrong with Java I would speculate, but it can be a royal pain in the ass to manage if you just need one application to work.

I know the basics of the language, but from what I have seen managing it, I don't like it. Just from being in security, I constantly hit barriers with devs because of versioning issues. There is always some ancient app running on a version of Java that can't be updated, for whatever reason. Version management is always a pain, but with Java? Goddamn.

I admit ignorance about the details of Java and how awesome it is for job security. There is no way in hell I could even debate anyone who has watched a single video on YouTube about Java. However, from what I have seen, it either works great or it fails explosively with billions of randomly allocated threads attempting to suck memory from every other server within 50 miles.

If it's awesome to code with, cool. I am just a little salty from my experiences, as you can tell.

Legacy Java software is a massive pain in the ass. No arguments there. I’ve been migrating an app from Java 11->17 for the last 2 months and it’s a versioning mess. So many libraries deprecated and removed that don’t have easy replacements.

It’s great because things don’t break when they’re running, but the problem is upgrading.

Version management does seem to have become better with the last couple versions

(Confirmation bias, ENGAGE!)

We have a few of those projects coming up as well. Thankfully, I just get to poke at the apps to make sure the issues are resolved.

But yeah, one of my examples of rogue threads is a coding issue, not inherently a language issue. Even log4j issues can't be completely blamed on Java "The Language".

Well, it wears down your keyboard.

If you have a good IDE, and Java has the best IDEs of any language I have used, then auto complete will take care of most of that for you.

Who cares? If it works, it works.

The biggest strength of Java is that many programmers has years or even decades of experience in it.

i know right! same thing with PHP! many progs decades experience hahaha

Same thing with COBOL! So many devs with ... Wait. Are any COBOL devs even alive still?

Same thing with COBOL! So many devs with … Wait. Are any COBOL devs even alive still?

I promise you one thing, those that are still alive are making bank right now.

Usually at banks, where they easily earn 2x+ of what I do working in Java. I happen to know one IRL, and their meetings with the boss are funny because it doesn't really matter what number they put on the table, their boss cannot fire them. They could not replace them and they need 2+ COBOL devs in house.

I happen to know one IRL, and their meetings with the boss are funny because it doesn’t really matter what number they put on the table, their boss cannot fire them. They could not replace them and they need 2+ COBOL devs in house.

I can concur, I've seen the same thing in real life myself. Definitely a blast watching the employee have the power.

PHP has been having a resurgence in popularity because it works.

PHP never went away. Wordpress, Mediawiki, Slack, Facebook, etc etc etc. IMO PHP is likely to have created the most wealth per line of code of all languages, including C (edit: since 2000). It’s completely under the radar.

I care, as someone who self hosts and have been doing so for 22 years. Java has always been the most annoying thing to maintain as a holster, especially on low resourced machines, like my raspi

Java is for enterprise level software that's robust not for self hosting on a pi

I love Java.

As someone who used to be a Java programmer, I can't make any sense of that statement.

Java is the first language I learned. I love how structured it is and how it forces you to work within the paradigm. I might never use it again, but it shaped how I think of programming.

That’s why I like Java too. The fact that it’s so strict means I have to think about projects in a certain way and can’t just wing my way through it like Python.

Right. And then you'll write better code when you do use Python or JavaScript or whatever.

4 more...

I have a hard time believing that rewriting the backend from scratch would be faster than getting PRs approved on the main project.

Forks like this with one guy who "knows best" usually die a slow quiet death as they get left behind by the main project.

I think how quickly this project has gotten to near feature parity is a testament to how slow Lemmy development has been. Think about scaled sort (a feature that has been hotly requested since the migration) and how long that took to get merged in. A sort should not by any means be slow to implement.

A sort should not by any means be slow to implement.

Sure, if the sort key is something readily available. But for scaled sort they have to compute relative size/activity of the communities the specific user is in. The cost isn't the sort, it's computing the metric.

I'm not talking about the literal sorting algorithm. Pretty sure scaled sort is exactly one more operation than hot.

4 more...

[This comment has been deleted by an automated system]

I’m a Java developer and I would much rather pick up Rust to join an active project than try to rebuild something that already works using a less-marketable language.

Sure, but it’s a lot more work for you to get to a point where you can be an active contributor.

Is it really a lot of work for an experienced dev? I can pick up most new languages in a day or 2 unless it's a total paradigm shift.

1-2 days is enough to learn the basics, but I doubt you’ll be as nearly as productive as with something you’ve been using for years. Keep in mind that new languages also mean new frameworks, etc, some which take years to actually master, but at least months to get a good handle on them.

Also, from my understanding, Rust is a bit of a paradigm shift.

Yeah but there's a big difference between having "picked up" a new language and being on the level where you can viably add useful code to a distributed federated deployed platform.

I have 12 years in Java by now, I'm fairly confident with it. Rust, yeah no, not for production code.

Sure, anyone can pick up a new language or two over a weekend. That doesn’t mean they are confident enough to contribute to large scale programs with it. That takes much longer to learn.

Yeah I agree. Rust is an excellent language when you absolutely must be as safe as possible but don't want garbage collection. But there is a level of precision required of developers which makes it slower to development in. Other languages like Java, Python and Go are all quicker to develop in. Java is much easier to refactor IMO

5 more...

Why Java though ? Like really ? It's... Better than any other compiled language ?

Because modern Java is an OK language with a great ecosystem to quickly build web backends. And there are lots of java devs which means more potential contributors.

Exactly. It's also using Spring Boot, Hibernate, and Lombok. It looks just like projects at work. It might be the first fediverse project I contribute regularly to.

+1 same

I tried to contribute to Lemmy, spent a few hours really confused by rust and gave up. I can meaningfully contribute to a Java/Spring project, not a rust one.

Spring Boot, Hibernate, and Lombok

Ah, yes. How about he kitchen sink and another 5000 dependencies to make Java bareable to code in? Actually lets skip Java cos it's an over-engineered cluster-fuck that considers verbosity a virtue.

Hello world in Java = 500 lines of code.

Hello world in Rust = 3 lines of code.

Java is over-engineered corporate bullshit used by banks and Android development. Nobody programs Java for the fun of it.

Hello World is < 10 lines in Java. Just say you don’t know the language and go away.

Java runs the majority of corporate software out there, and it is very good at what it’s built for.

I’ll take Java over Python/Rust any day of the week

8 more...
8 more...
8 more...

Probably because everyone knows it and its more predictable

Predictable in what sense?

If you say the function should only recieve one argument and returns always boolean. It is predictable to only allow the wanted args and forces you to return a boolean.

For example in a less predictable programming language e.g. Python: I can do all above but python does not stop anyone to put more or less arguments to a function, or a developer not adding typehints or not complying to them and return a string instead of a boolean.

But i had it wrong rust is similar to java on that part.

But still it is a lot more popular and easier to start with. So there will be a lot more contributor to sublinks than lemmy ever had.

Well in that sense Rust is even more predictable than Java. In Java you can always get back exception that bubbled up the stack. Rust function would in that case return Result that you need to handle somehow before getting the value.

That i dont understand? How can it be a result that i need to handle? If its not correct than java will throw an error. ( As expected, shit in shit out )

It's a great and probably the best error system I've seen, instead of just throwing errors and having bulky try catch statements and such there's just a result type.

Say you have a function that returns a boolean in which something could error, the function would return a Result and that's it. Calling the function you can choose to do anything you want with that possible Error, including ignoring it or logging or anything you could want.

It's extremely simple.

If I except a boolean, there is an error and get a Result, is Result an object? How do I know if I get a bool or error?

You always get a Result. On that result you can call result.unwrap() (give me the bool or crash) or result.unwrap_or_default() (give me bool or false if there was error) or any other way you can think of. The point is that Rust won't let you get value out of that Result until you somehow didn't handle possible failure. If function does not return Result and returns just value directly, you (as a function caller) are guaranteed to always get a value, you can rely on there not being a failure that the function didn't handle internally.

If function does not return Result and returns just value directly, you (as a function caller) are guaranteed to always get a value, you can rely on there not being a failure that the function didn’t handle internally.

The difference being where you handle the error?

It sounds to me like Java works in kinda the same way. You either use throws Exception and require the caller to handle the exception when it occurs, or you handle it yourself and return whatever makes sense when that happens (or whatever you want to do before you do a return). The main difference being how the error is delivered.

Java has class similar to Result called Optional.

Yeah I suppose ignoring unchecked exceptions, it's pretty similar situation, although the guarantees are a bit stronger in Rust IMO as the fallibility is always in the function signature.

Ergonomically I personally like Result more than exceptions. You can work with it like with any other enum including things like result.ok() which gives you Option. (similar to java Optional I think) There is some syntactic sugar like the ? operator, that will just let you bubble the error up the stack (assuming the return type of the function is also Result) - ie: maybe_do_something()?. But it really is just Enum, so you can do Enum-y things with it:

// similar to try-catch, but you can do this with any Enum
if let Ok(value) = maybe_do_something() {
  println!("Value is {}", value)
}

// Call closure on Ok variant, return 0 if any of the two function fails
let some_number = maybe_number()
  .and_then(|number| process_number_perhaps(number)) // this can also fail
  .unwrap_or(0);

In that sense it's very similar to java's Optional if it could also carry the Exception value and if it was mandatory for any fallible function.

Also (this is besides the point) Result in Rust is just compile-time "zero cost" abstraction. It does not actually compile to any code in the binary. I'm not familiar with Java, but I think at least the unchecked exceptions introduce runtime cost?

That's a kinda terrible way to do it compared to letting it bubble up to the global error handler.

You can also use optional in java if you want a similar pattern but that only makes sense for stuff where it's not guaranteed that you get back the data you want such as db or web fetch

You can bubble up the Error with ?operator. It just has to be explicit (function that wants to use ? must return Result) so that the code up the stack is aware that it will receive Result which might be Err. The function also has defined Error type, so you know exactly which errors you might receive. (So you're not surprised by unexpected exception type from somewhere deep in the call stack. Not sure about Java, but in Python that is quite a pain)

Edit: To provide an example for the mentioned db fetch. Typically your query function would return Result(Option). (So Err if there was error, Ok(None) if there was no error, but query returned no results and Ok(Some(results)) if there were results) This is pretty nice to work with, because you can distinguish between "error" and "no resurts" if you want, but you can also decide to handle these same way with:

query()
  .unwrap_or(None)
  .iter().map(|item| do_thing(item))

So I have the option to handle the error if it's something I can handle and then the error handling isn't standing in my way. There are no try-catch blocks, I just declare what to (not) do with the error. Or I can decide it's better handled up the stack:

query()?
  .iter().map(|item| do_thing(item))

This would be similar to exception bubbling up, but my function has to explicitly return Result and you can see in the code where the "exception" is bubbled up rather than bubbling up due to absence of any handler. In terms predictability I personally find this more predictable.

But like, what kind of error are you gonna handle that's coming from the DB, if it's something like a connection error because the DB is down, then you are shit out of luck you can't handle that anyway, and you probably shouldn't, not from the layer you are calling your DB from, that's a higher level logic, so bubbling Errors there make sense.

and if it's an "error" like findById doesn't always return something, that's what the Optional pattern is for.

what you have described to me seems like a worse version of the checked/unchecked exception system.

1 more...
1 more...
1 more...
1 more...

Here's some examples written on my phone:

match result {
    Ok(bool_name) => whatever,
    Err(error_type) => whatever,
}

if let Ok(bool_name) = result {
    whatever
}

if result.is_ok() {
    whatever
}

let whatever = result.unwrap_or_default();
let whatever = result?;

And there's many other awesome ways to use a Result including turning it into an Option or unwrapping it unsafely. I recommend you just search "Rust book" on your search engine and browse it. Here's the docs to the Result enum.

Ah, so it is like a wrapper enum, ok contains the data type you want and err the error object?

Exactly! The other wrapper enum I named (Option) is the same kind of concept but with Some(value) and None.

1 more...
1 more...
1 more...
1 more...
1 more...
1 more...
1 more...

It's probably got the best library/tooling ecosystem of any language out there. Certainly dwarfs Rust in that regard. Easier to find devs. Reasonably efficient thou not as much as Rust and typically less memory efficient. It's a perfectly good suggestion for a project like Lemmy. I'd reach for Java or Go before Rust for a project like this but you know, that's just me.

You see, Go would've been a better option than Java.

It would have been a good option. As is Java. If you want to do it in Go, go ahead.

9 more...

What missing features are so important that you decide to recreate the entire backend of Lemmy because you think the devs aren't fast enough?

Java instead of Rust is going to be a big thing for a lot of people who would like to contribute in their spare time. Yeah, Rust is cool, but every CS grad and their mother knows Java.

Back during the migration surge a few months ago, you commonly saw a LOT of comments from folks saying they would love to help eat away at the project’s backlog, but they just didn’t have the time or energy to learn Rust at the moment.

Any recent CS grad is obsessed with rust, trust me. It's not hard to learn either with that background.

I'm not saying that rewriting he backend is a good choice, but for me specifically, I'd like Lemmy to be written in Java. Why? I'm a Java software engineer for nearly 7 years now and I'd like to contribute. Yes, I could learn Rust, like I did learn Go, C, C++ and other languages during my cs studies. But I really don't have the free time and motivation to do that after I already worked 8-10 hours at my computer. If I could use my existing Java knowledge to quickly fix some small bugs or whatever, I'd love to do that. But the hurdle to learn a new language (including other paradigms and best practices) just to contribute to this one project is just too high for me.

Yeah, same boat. I'm continuously learning new shit with C# and I'm starting to understand Angular after all these years. I could switch back to Java with few issues.

I would love to learn Rust, but there's no time right now.

Exactly this. It's often about finding the right balance between technically optimal, and socially feasible (lacking the right phrase here).

The nerds brimming with technical expertise often neglect the second point.

Oh - wow! I was about to complain about how https://join-lemmy.org/ is a shining bad example in this regard, talking about server stuff right away and hiding how Lemmy actually looks until page 3, but apparently they changed that and improved it drastically. Cool, good job!

Anyways.

For collaborative projects especially, it is important to strike a balance between tech and social aspects. Making poor tech choices will put people off. But making your project less accessible will also result in less people joining. It's crucial to find a good balance here. For many coming from the tech side, this usually means making far more concessions to the social side than intuitively feels right.

Once you know a few languages and the principles for how a computer works moving to a new one is easy. Don't think of it as being a "Java developer", but a programmer. It's just a tool.

We did not learn languages at uni, but concepts. You use the same data structures and algorithms.

I think you'd be surprised, try picking up rust for some advent of code challenges. If you know Java Streams and C/C++ lower level programming all that you're missing is some pattern matching.

Anyone can quickly learn how to solve some code challenges in a new language.

It’s a completely different story to learn how to write long lived enterprise scale programs that can grow with multiple independent contributors. This takes a lifetime to learn. More people have more experience to do it with Java.

I know Java and I am learning C#, I don't feel like I can just send a few hours and be at the same level as I am with Java. There are a lot of things I do not know or understand yet with C#.

That feeling when you're not a recent CS grad anymore 😭

I never even heard of rust when I graduated in 2016.

1 more...

If I were to guess, it’s not recent grads making those posts. I got the sense those comments were coming from people who had been around for a while. Folks who are now senior enough to be trapped in draining meetings all day, and have to manage a family a night.

The work day and home life can get longer and more exhausting the further the older you get.

1 more...

Yeah, Rust is cool, but every CS grad and their mother knows Java.

Sure, twenty-five years ago, when Sun was pushing their language hard into colleges everywhere.

Now? Sun Microsystems doesn't even exist, and everybody hates the JVM in an ecosystem where VMWare, Docker, and Kubernetes do the whole "virtual machine" model much better.

Now? Sun Microsystems doesn’t even exist

That was a long, long, long time ago.

Java has continued to be very popular after Oracle purchased Sun Microsystems.

Can't say I agree. It feels like an almost even 50/50 split between Java and C# when I look at job postings.

I think rust is a very pragmatic choice, lemmy is decentralized, the security benefits are a necessity when it comes to self hosters donating hardware

Java is also memory safe

After working in java for over a decade, I will never use another garbage-collected language if I can avoid it again. I still have nightmares about debugging memory build-ups and having to trace down where to do manual garbage collection. I remember my shop eventually just paid for 32 GB ram servers, and java filled those up too.

Rust doesn't have these problems because its not a garbage collected language like java or go, and has an ownership-based memory model that's easy to work with.

Is that still a problem in newer java versions? I have to admit I have only written simple things in java.

Garbage collection is by nature imperfect, its impossible for it to always be correct about when and what things to free up in memory. The best option is to not use a garbage collected language.

Wow. It's amazing that anyone ever got anything to work in java. Must have never got used for anything

Ah yes, that explains the log4j fiasco

That wasn't a memory safety issue, that was a what the fuck were you thinking design issue. It would have been batshit in any language

Yeah, Rust is cool, but every CS grad and their mother knows Java.

This is quite an outdated view I would say.

Perhaps, but a lot of devs wanted to contribute to a Java client, and that’s what they were saying.

1 more...

Lemmy doesn't have to have missing features for someone to want to write their own implementation. And in a decentralized system you want multiple implementations to exist. This is a good thing

It seems to be more language focused than hard to PR against the main repo.

Java is much more widely known than Rust, which means a much larger pool of developers. I never contributed to the original Lemmy server because I couldn’t wrap my head around a full production scale rust project. I’ll very likely contribute to this because I work with production Java code daily. Im sure I’m not the only other dev who has run into this.

Also maybe there’s just too many disagreements with the Lemmy owners, who are a bit extreme for a lot of people.

1 more...

Java backend? What year is it?

2024, Java is still the 2nd language on GitHub with 11,7% of the total code hosted, while Rust is number 13 with 1,8%

https://madnight.github.io/githut/#/pull_requests/2023/4

Java has been around for decades longer than Rust, comparing total code numbers doesn't tell the whole story

That's not the whole story, most of the Java code that exists is proprietary, java is undoubtedly #1

You actually think there's more Java code than JavaScript? Basically every website in the world feels the need to use JS nowadays.

obviously I wasn't counting JS because by sheer volume, HTML+CSS+JS will outnumber everything because it's the only combo for the browser.

but if you restrict it as JS for Backend, then obviously it's not even close to Java.

If you can write off JS because "you have to use it because it's the internet" then I can write off Java because "you have to use it for billions of 20 year old legacy applications".

I am not writing it off, I am saying it has no competition in the browser... therefore irrelevant to the discussion at hand.

and btw, even in the link https://madnight.github.io/githut/#/pull_requests/2023/4 Javascript is not first, Python is, over Java.

but once again, you would actually have to look for the backed JS applications, you are not choosing java over JS for the web, at best you would choose JSF and that still uses javascript.

1 more...

Oh definitely, but I took GitHub as it should reflect "hobby projects"

1 more...

Is Big Coffee paying you to shill Java all over this post?

If only... More seriously, I want Lemmy/Kbin/Sublinks to succeed, and the development rhythm of Lemmy made me perplex for a while.

A new option with a more popular language could address this.

Check the back of every dollar for an Oracle database support contract, that’s how they get you!

1 more...

A year in which the number of Java developers and ecosystem dwarfs that of Rust.

I think the people who say this and think Rust is the second coming of Jesus, just don't code. You choose the right language that's needed for the job. Server stuff like this is Java's bread and butter. As amazing as Rust is, it has proven to not be a great choice for Lemmy's development.

I’m curious why you say Rust “ has proven “ to not be a great choice. There is a lack of Rust programmers, but its been the fastest growing community on GitHub for multiple years now, and has proven to be viable at all level of the stack.

Full disclaimer: I code and work in Rust daily on the backend and frontend.

Full disclaimer: I code and work in Rust daily on the backend and frontend.

Would you and your colleagues be interested in contributing to Lemmy's codebase? I'm genuinely asking, I'm still surprised by the low number of contributors for a project that has 40k active monthly users

I barely have time to contribute to fix bugs in the dependencies I use. If I had more time for OSS contributions I might, but I’m not in my 20s anymore and when I’m not at work I’m taking care of my family.

My colleagues and friends are free to do as they please.

I guess that's the same for most of the userbase. Which is probably why switching to a more spread language could increase the number of contributors.

Not to mention a lot of massive companies also use it at every part of the stack, Rust is good at it all and it is beautifully and perfectly suited for tasks like these.

1 more...

Having a frontend rewrite seemed more critical than trying reimplementing the backend in a different language.

Remember, Lemmy had 4 years of development to iron out bugs, and this is essentially promising to make something in months that has a fully compatible backend to support all the third party apps, while adding features on top of what Lemmy has, and with a better front end with better mod tools to boot, with a complete rewrite of everything.

The scope of this project has planned for is already unviable. Suppose that Sublinks does reach feature parity to the current version of Lemmy, congratulations, the backend or mod tools is not something a regular user is going to notice or care about at all, all they will know is that suddenly, there are weird bugs that wasn't there before, and that causes frustration.

And this project is going to get more developer traction because... Java?

I'd like to be proven wrong, but I'm very sceptical about the success of Sublinks, because it look like a project that was started out of tech arrogance to prove a point than out of a real need, I don't work in tech, but the general trajectory of these kind of projects is that "enthusiasm from frustration" can only take you so far before the annoyance of dealing with mundane problems piles up, and the project fizzles out and ends with a whimper.

I have higher hopes. Java is three times more developers than Rust (https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/), and you can see in this thread a number of people saying they could contribute as they know Java and not Rust.

Let's hope for the best.

Java is a corporate language that most devs hate. Rust (Lemmy) is more popular as a hobby language that devs enjoy hacking in for fun.

Hm, Java is hated by devs, but still 2nd language on GitHub with 11,7% of the total code hosted, while Rust is number 13 with 1,8%?

https://madnight.github.io/githut/#/pull_requests/2023/4

How much of that 11.7% is 35-character class names?

I'm only half joking.

It’s by amount of pull requests, so the length of class names and other Java boilerplate doesn’t count.

Stockholm syndrome.

And even more, the Lemmy codebase doesn't really have any important developers besides the two main devs: https://github.com/LemmyNet/lemmy/graphs/contributors.

Even looking at the contributions to something like Mbin, which has been around for much shorter, you already see 6 people with more than 50 commits, while Lemmy has one

https://github.com/MbinOrg/mbin/graphs/contributors

11 more...

"I'm right, and if anyone disagrees, it's because they're brainwashed"

There's literally no possible way to argue against this type of logic.

1 more...
18 more...
18 more...

Java is a corporate language that most devs hate

Citation required, because strangely enough people whom I hear about complaining about Java never seem to be the good developers but the ones I wouldn't hire

18 more...

Just peeking at the source code and it all looks like pretty standard stuff. Looks just like apps I've worked on at several jobs.

Is it sexy? No. But a lot of people have experience with this and could help develop.

Only time will tell if this project pays off though

I'm pretty sure Nutomic was a Java dev before starting work on Lemmy and learning Rust from scratch. That by itself should already speak volumes.

One-Up projects like this rarely ever turn out well, that's from my own experiences. Even though this isn't a popular view, I still think I'm right on this one, we can circle back in say, 6 months, to see if my predictions are right.

I’m pretty sure Nutomic was a Java dev before starting work on Lemmy and learning Rust from scratch.

That is true, I used to be an Android developer and then learned Rust by writing code for Lemmy. Are you by any chance my new stalker?

And if we're comparing the languages, the fact alone that there are no Nullpointerexceptions makes Rust infinitely better than Java for me. I also agree that this sort of copycat project will soon be forgotten. For example have you ever heard of Rustodon?

Are you by any chance my new stalker?

No, it was on that AMA you guys did months ago, and I remember things about people.

Very impressive! The only thing I can remember well are places.

there are no Nullpointerexceptions makes Rust infinitely better than Java for me.

what's wrong with having null pointer exception?

Null is terrible.

A lot of languages have it available as a valid return value for most things, implicitly. This also means you have to do extra checking or something like this will blow up with an exception:

// java example
// can throw exception
String address = person.getAddress().toUpperCase();

// safe
String address = "";
if (person.getAddress() != null) {
    person.getAddress().toUpperCase();
}

There are a ton of solutions out there. Many languages have added null-coalescing and null-conditional operators -- which are a shorthand for things like the above solutions. Some languages have removed the implicit nulls (like Kotlin), requiring them to be explicitly marked in their type. Some languages have a wrapper around nullable values, an Option type. Some languages remove null entirely from the language (I believe Rust falls into this, using an option type in place of).

Not having null isn't particularly common yet, and isn't something languages can just change due to breaking backwards compatibility. However, languages have been adding features over time to make nulls less painful, and most have some subset of the above as options to help.

I do think Option types are fantastic solutions, making you deal with the issue that a none/empty type can exist in a particular place. Java has had them for basically 10 years now (since Java 8).

// optional example

Class Person {
    private String address;
    
    //prefer this if a null could ever be returned
    public Optional getAddress() {
        return Optional.ofNullable(address);
    }
    
    // not this
    public String getAddress() {
        return address;
    }

When consuming, it makes you have to handle the null case, which you can do a variety of ways.

// set a default
String address = person.getAddress().orElse("default value");

// explicitly throw an exception instead of an implicit NullPointerException as before
String address = person.getAddress().orElseThrow(SomeException::new);

// use in a closure only if it exists
person.getAddress().ifPresent(addr -> logger.debug("Address {}", addr));

// first example, map to modify, and returning default if no value
String address = person.getAddress().map(String::toUpperCase).orElse("");

I also was a professional java dev, and also had to use spring boot in most corporate environments.

I don't wanna knock anyone's re-write, because I know how difficult it is to dissuade someone when they're excited about a project. But to me, starting a new project or doing a rewrite, is the best opportunity to learn a newer, better language. We taught ourself Rust by coding lemmy, and I recently learned Kotlin / jetpack compose because I wanted to learn android development. Learning new languages is not an issue for most programmers; we have to learn new frameworks and languages every year or so if we want to keep up.

This is potentially hundreds of hours of wasted time that could be spent on other things. Even if someone absolutely hates Rust and doesn't want to contribute to the massive amount of open issues on Lemmy, there are still a lot of front-ends that could use more contributors.

it it common to announce a 'major rewrite' without having it complete?

i mean, at the moment, theres little to discern it from lemmy at the moment... why make a big public proclamation about it before you even touch the front end?

18 more...

Lemmy had 4 years of development to iron out bugs

Lemmy had 4 years to accrue technical debt and make foot-guns first-class features. A rewrite is probably exactly what it needs.

Have you read the source code? I'm not trying to be a smartass, I'm genuinely curious.

I have and if I'm honest I'm probably a little bit too harsh. I think the bigger issue is honestly the priorities of the dev team. There's good reason that this project is focussing on moderation tooling.

What sort of moderation tools are you missing in Lemmy?

Some things that seem hard to argue with:

  • A mod panel with things like 'add moderator' (maybe this could be attached to the new moderator view?)
  • Targeted reports (choose who receives it; admin/moderator)
  • Moderation actions on jerboa
  • Moderator edits. There's a fine line here and I can understand why you wouldn't want total edit capabilities but it'd be nice to at least be able to do things like mark as nsfw and add content warnings. This sort of feature should also probably target megathreads
  • Private communities (I know local only communities are in the works but there's a whole mess of other criteria that would be useful)

My own personal wishlist:

  • Karma requirements
  • First class wikis
  • Hashtags (I actually think a super simple stopgap solution here is to just have them link to the appropriate search page)
  • Flairs

There's some other stuff that I have seen PRs for and I do understand y'all are working hard. I appreciate the work you've done so far and the communities you've helped build. The Internet is undoubtedly a better place for it.

Dessalines is currently working on mod actions for Jerbia. Someone recently made a PR for moderator edits but it seems there was not enough interest and it was closed by the author. Better reports handling would be nice, but if you read the issue its not really clear how this should work. Private communities are on the roadmap for this year.

Karma is intentionally left out of Lemmy because it has many negative effects. Wikis make more sense as a standalone project, in fact Im working on something. Flairs are also potentially on the roadmap. For hashtags I dont really see the benefit as they would serve a very similar purpose to communities.

With regards to hashtags I think the utility is mostly in searching among similar things within a community. Suppose there's a community that serves a purpose like r/askhistorians, stackexchange, or like what I'm trying to do over at !opencourselectures@slrpnk.net. In each of those cases, it is enormously useful to be able to search the community by subtopic. Obviously, this could be solved in other ways, but hashtags are probably the simplest to understand and implement.

Very excited to see the outcome of your Ibis project, but I think Lemmy native wikis would see significantly more activity. The easiest implementation I can imagine is a slightly altered frontend for communities marked wikis that also handle some well known syntax (like [[link]] popularized by pkm systems) for internal links. That is links to posts by the same name within a community.

Currently, I'm working on a lemmy bot that handles exactly this internal linking, and hashtag functionality, then builds a static site with support for github pages (so the end result is both a linked community and a seperate site), but I'd much rather have this functionality built into lemmy. To be frank, I'd much rather be trying to build this functionality into lemmy and if I wasn't nearly certain it'd get shot down as out-of-scope, I'd probably be doing that.

I know you're not particularly fond of growth based arguments for new features, but I sincerely believe that the thing that made reddit great in those early days was the tendency for communities to compile resources (particularly for niche and hobby communities). This gave the communities a certain depth that is nearly impossible with posts alone. If that were a first-class feature of Lemmy, I think you'd very quickly see Lemmy fill the niche that federated wiki projects and supplementary wiki services have so far failed to.

Then hashtags would have the same use as post tags on Reddit. I think thats a cleaner solution and there are plans to implement it.

Lemmy is already a very complicated project, and adding more functionality will only make it harder to maintain. Also there are lots of people who use wikis without Reddit, Wikipedia is one of the biggest websites in the world after all. So a Fediverse alternative is very much needed. Plus Lemmy and Ibis can federate in the future.

karma requirements and hashtags doesn't seem right since the former will make people to farm karma for the requirements which is one of the reasons why newbies on reddit always dump post until they get a decent karma. lemmy is not a microblogging site, hashtags have better use in platforms like mastadon. post flairs should be implemented though.

hashtags have better use in platforms like mastadon

Says who? Because that's how the old platforms used it? I think we should really be moving past the direct influence of these corporate platforms and on the fediverse that probably means something of a well understood common language (like @user@instance or !group@instance). Hashtags were only ever a thing on twitter because the users just started using them and full text search was sufficient to handle it (this is more or less the position we're in on lemmy). Direct support didn't come till much later.

The ones on the Sublinks roadmap are interesting, for instance the warning system: https://github.com/orgs/sublinks/projects/1/views/7

Create a way to create a warning system for users. For example, a user gets a warning for posting a broken link multiple times. We don't want to ban them for that. Or a admin gives a user a Warning with a reason. Create a rules system for auto actions like banning for some time or forever. Consider adding types of warnings. This should also track bans from communities for admin-level auto actions. The profile page shows strikes similar to Mastodon for Mods/Admins only and the user that owns the profile. Examples, warnings in each community, and bans. Rules will be applied to counts of warning types or total warnings over time. 3 warnings within a month is a ban for a month, for example.

There was also this list from a few months ago: https://discuss.online/post/12787?scrollToComments=true

True a warning system makes sense.

And you think that a rewrite would magically solve all those technical debts?

Magically no, but sometimes a clean slate is easier than a refactor. I'm speaking generally though, I've never looked at Lemmy's code, and I'm not even who you originally replied to.

There are some projects that start because of "tech arrogance" as you describe the current situation. MariaDB, Git, LibreOffice are some of the most famous ones, but I'm sure there are more.

18 more...

an alternative Java-based backend

kill it with fire

Next step, is to remake Lemmy in JavaScript. Pure JavaScript, no typescript, only express, nothing else

an alternative Java-based backend to Lemmy’s Rust-based one

Going from a modern well-designed language to an old-and-busted, kitschy, memory-hogging, bloated language. This is literally a step backwards.

Rust, Go... hell, even Ruby-on-Rails or whatever Python is offering nowadays would be a better choice.

Modern Java isn't that bad, and with new developments like the graalvm and cloud native builds, or what they are called, the footprint of a modern Java app can be comparable to an golang app.

Modern Java kinda has the same image problem as modern PHP. Not saying is all great, but it sure has seen quite the improvements in the last years

they are also working to make developers have less boiler plate. java might be an old language but the development has not stopped but only going better these days.

I'm a long time Java developer who was recently moved to a project written in Go. All I can say is: What. The. Fuck. I swear, the people who designed the syntax must have been trying to make every wrong decision possible on purpose as a joke. The only think I can think of is that they only made design decisions on the syntax while high on shrooms or something.

Like, why in the actual fuck does the capitalization of a function change the scope?????? Who thought that was a good idea? It's not intuitive AT ALL. Just have a public/private keyword.

I did a lot of Java prior to doing Go. I think they're both good. I don't like the Go privacy/scope thing and I genuinely hate it's error handling but it's pretty much 90% good pragmatic choices IMO. That said, I still think Java is a fantastic language and it makes a lot of sense for something like Lemmy

Nah, Java is alright. All the old complicated "enterprise" community and frameworks gave it a bad reputation. It was designed to be an easier, less bloated C++ (in terms of features/programming paradigms). It's also executed fairly efficiently. Last time I checked, the same program written in C would typically take 2x the time to complete in Java; whereas it would take 200x the time to complete in Python. Here's some recent benchmarks: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python3-java.html

I haven't had a chance to try Rust yet, but want to. Interestingly, Rust scores poorly on source-code complexity: https://benchmarksgame-team.pages.debian.net/benchmarksgame/how-programs-are-measured.html#source-code

Or C#, it's literally "Java, but good".

The only time I would choose Java for a new project is if I had a hard dependency on something that only works with Java...

Seems like here the number of developers comfortable in Java is a dependency

I understand that being a problem for Rust, but not for many of the other "better than Java" languages on this list. Like, I dunno....C#?

If I'm being honest though, I just really hate Oracle, and that's enough to give me pause over anything they dip their fingers in.

I think C# is probably more popular than it advertises here, but not on GitHub.

C# is regularly under-represented in OSS, in part because for most of it's existence, the primary implementation (.NET Framework) was not open source or cross platform. It is also very popular in fields where open source is not the norm (game development, bespoke backend infrastructure, embedded apps).

I said it was easy to find C# developers, not that there were more of them on Github.

If the number of possible contributors on github is the big factor here then Python is the obvious choice at 18%.

Or Kotlin, which is much more "Java but good" as it even runs on the JVM

Yeah, but then you still have an Oracle dependency in your stack 🤮

You can switch to Kotlin Native, which depends on C libraries, or Kotlin JS, which depends on whatever libraries your JS runner has. No matter whatever Oracle has done, they produce a pretty good library, API spec and OpenJDK.

a missed opportunity to name it Jemmy

I'm just here for the joke

EDIT: sentence structure

I like this, I will contribute to this, I think a lot of Java haters in this thread fail to realize just how massive Java is compared to everything else.

Rust might be the latest, hottest, bestest Java killer out there and it might be a completely superior language to Java, doesn't matter, it's dwarfed in terms of how many people actually use it for real projects, projects that should run for years and years. Even if Rust is the true Java killer, it's gonna take a good few more years for it to kill java, measured in decades, there is just way too many projects and critical stuff out there that is running on Java, that means lots of jobs out there for java, still and still more.

This means there are a lot of senior Java programmers out there with lots of years of experience to contribute to this project.

Plus Lemmy itself having alternatives and choices is just a good thing.

Agreed. I mean COBOL is still a thing, and that's a language that's been dead for 30+ years.

I am not a fan of Java. However, I think that you are 100% correct. This is a potentially very useful stack to have available and I hope that the two projects track together well.

This project has potential for high velocity development that Lemmy will never be able to match, purely because of the languages. Rust is, factually, slower to develop in than Java, even for experienced devs. Add to that the greater population that is comfortable with Java, and you have a recipe for really pushing interesting things and innovating quickly. Possibly establishing a relationship somewhat like Debian Sid to Debian Stable. It could also be interesting to have some low-level, Rust modules that are shared between the two when Lemmy gets to 1.0 (API stability), if there is something that is more optimally implemented in Rust but that would introduce more coupling.

Languages won't grow if you ditch them for other ones. There's lots of reasons to use rust, outside of the size of the project

I think you will find that the biggest reason to use a language is to get paid for it and there Java is very well positioned

That's the reason for for hire devs yeah, but if you are starting a new project ( especially a community one like lemmy where the profit motive is different) choosing your tech stack is a complex decision

Rust is as much of a Java killer as C++ is. You could say Rust is the C++ killer, but I really don't see how Rust would be that comparable to Java, which operates at a higher level instead of memory and pointer management. IMO, Kotlin is the Java killer.

I've been hearing a lot of good things for a while. Lookin forward to it.

I'm hearing hype from the people making it.... dunno why anyone else would have anything positive or negative to say yet

Forget the backend! I just want the frontend not to crap itself whenever it can't fetch the site icon!

A new front-end is coming too. We need a new front-end to support all the new features we’re adding.

Have you tried any of the web client alternatives ("Web" filter): https://lemmyapps.netlify.app/ ?

Yeah, I run Photon on base domain because I couldn't count on lemmy-ui.

The Photon developer is assisting with the development of the new front-end :)

That's good news. Hopefully they'll get let you change your avatar in that new UI because that's one of the weirdly missing Photon features.

We have our own engineers working on it with him along with the developer of pangora. It's a full collaborative effort to make the best we can.

with the developer of pangora

It's like the Avengers are gathering

Mine had accumulated 420MB of cookie data the other day. Had to clear it before I could log in. I thought the instance was dead.

No kidding. I'm an Ops guy and I've hosted hundreds of web applications professionally and for fun over the years but Lemmy has been one of the more frustrating and brittle experiences I've had.

I've figured out a few of the quirks by now but I definitely spent a whole afternoon troubleshooting why the front end wouldn't load at all only to discover the real issue was with Pict-rs.

I guess my username won't make sense anymore. But it sounds so good that it doesn't need to make sense.

That's okay, no one thinks my username makes sense when it absolutely does.

Idk why that reminded me of a very old Minecraft release where there was a bug where squids can actually fly.

Idk if I misremembered that or if it was an actually real thing.

I can't find the fucking porn on Lemmy, so maybe this is a good thing.

lemm.ee doesn't block it, so it's not a problem with your instance. You don't have to ask how I know

So while there's plenty of talk in here (even from the core lemmy devs) about how much it makes sense and how much value there is in starting a new project with a different tech stack that includes Java, compared to simply contributing back to the current project that has momentum ... and while that's an interesting and important conversation ...

Realistically, developers will make what they want to with what they want to (to a fault IMO, especially within the broader mission of the fediverse, but that's besides the point). This project will happen, people will contribute and it may succeed.

So, to focus on the positives and what can be made good about this ...

It's great that there's some sort of settling on a standard here and trying to be a "drop in replacement". Continued commitments to consistency and interoperability would be awesome. While collaboration may be naturally limited, there'd still definitely be scope for it ...

  • ideas and designs, obviously
  • Database management and optimisation, which is likely a big one.
    • On that ... AFAICT, SL is using MySQL? Can't help but wonder (without knowing the technical justifications here) whether it would make much more sense to stick with the same DB unless there's a good reason for divergence.
  • Front ends and the API, another big one but one where the two projects could conceivably work together.

I'm likely being very naive here, but I can see both projects coming under a single umbrella or compact which provide different backends and maybe DB setups or schemas but otherwise share a good amount in design and mission.

However unlikely that is ... trying not to fragment the fediverse too much would be awesome and its pleasant to see some dedication here to that end.

whether it would make much more sense to stick with the same DB unless there’s a good reason for divergence.

SL Dev said they reengineered the database schema and didn't want to use the Lemmy one. Based on the summer performance issues, I guess it makes sense.

However unlikely that is … trying not to fragment the fediverse too much would be awesome and its pleasant to see some dedication here to that end.

At the end of the day, it's still Activitypub. The compatibility between Lemmy and Kbin works pretty well, most of the issues we had were federation related, and those existed within Lemmy itself.

Well there’s still the question of using MySQL (?) rather than postgresql, where all manner of expertise about the DB can be useful to share. Not sure what kbin uses, but pgsql is pretty common around the fediverse.

And yea, it is all ActivityPub. I’m just not as faithful in that as others tend to be. It seems to be a fuzzy system that allows idiosyncrasies to creep in. Mastodon and Lemmy don’t get along too well and so sometimes AP just isn’t enough (I’ve just been trying to help someone whose masto instance seems not able to post to lemmy). At this moment, getting along is valuable for the platforms, for the fediverse and for us users.

Not sure whether this implementation will be lighter on resources than what Lemmy currently uses. Given the overhead of the JVM though, it's unlikely it will be supported by, say, a single Raspberry Pi

JVM doesn't have much overhead. Java 1.3 days are long gone.