this post was submitted on 23 Jan 2024
363 points (96.7% liked)

Fediverse

28339 readers
584 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, KBin, etc).

If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!

Rules

Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration), Search Lemmy

founded 1 year ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] MargotRobbie@lemmy.world 39 points 9 months ago (4 children)

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.

[–] Blaze@discuss.online 17 points 9 months ago (3 children)

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.

[–] Fudoshin 21 points 9 months ago (4 children)

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.

[–] Blaze@discuss.online 8 points 9 months ago (2 children)

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

[–] SomethingBurger@jlai.lu 21 points 9 months ago (1 children)

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

I'm only half joking.

[–] magic_lobster_party@kbin.social 7 points 9 months ago

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

[–] Fudoshin 3 points 9 months ago (3 children)
[–] Blaze@discuss.online 14 points 9 months ago (12 children)

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

[–] jgrim@discuss.online 10 points 9 months ago

We have 13 contributors with Sublinks so far. I expect more will come after the announcement.

load more comments (11 replies)
[–] dandroid@dandroid.app 12 points 9 months ago (1 children)

"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.

load more comments (1 replies)
[–] c0mbatbag3l@lemmy.world 3 points 9 months ago (6 children)
load more comments (6 replies)
[–] kaffiene@lemmy.world 7 points 9 months ago

That's bullshit, frankly

[–] kameecoding@lemmy.world 7 points 9 months ago

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

[–] spiderman@ani.social 2 points 9 months ago (3 children)

As a java dev, I can say that we hate working with java and love working with java at the same time.

load more comments (3 replies)
[–] wesley@yall.theatl.social 10 points 9 months ago* (last edited 9 months ago)

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

[–] MargotRobbie@lemmy.world 4 points 9 months ago (5 children)

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.

[–] nutomic@lemmy.ml 6 points 9 months ago (2 children)

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?

[–] MargotRobbie@lemmy.world 15 points 9 months ago (1 children)

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.

[–] nutomic@lemmy.ml 9 points 9 months ago

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

[–] spiderman@ani.social 1 points 9 months ago (1 children)

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

what's wrong with having null pointer exception?

[–] thtroyer@programming.dev 2 points 9 months ago* (last edited 9 months ago)

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<String> 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("");
[–] dessalines@lemmy.ml 5 points 9 months ago* (last edited 9 months ago)

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.

load more comments (3 replies)
[–] spaduf@slrpnk.net 16 points 9 months ago (2 children)

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.

[–] Sir_Simon_Spamalot@lemmy.world 2 points 9 months ago (1 children)

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

[–] 0ops@lemm.ee 6 points 9 months ago

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.

[–] laughterlaughter@lemmy.world 6 points 9 months ago

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.

[–] anarchy79@lemmy.world 2 points 9 months ago

But does it have blockchain AI integration?