this post was submitted on 23 Jan 2024
0 points (NaN% liked)

Fediverse

43706 readers
299 users here now

A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, Mbin, 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)

founded 3 years 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.

top 18 comments
sorted by: hot top controversial new old
[–] bdonvr@thelemmy.club 0 points 2 years ago (1 children)

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?

[–] Ghostalmedia@lemmy.world 0 points 2 years ago (2 children)

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.

[–] Amaltheamannen@lemmy.ml 0 points 2 years ago

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

[–] p03locke@lemmy.dbzer0.com 0 points 2 years ago

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.

[–] kawa@reddeet.com 0 points 2 years ago (1 children)

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

[–] loutr@sh.itjust.works 0 points 2 years ago* (last edited 2 years ago) (1 children)

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.

[–] Fudoshin@feddit.uk 0 points 2 years ago

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.

[–] AlexisFR@jlai.lu 0 points 2 years ago* (last edited 2 years ago) (1 children)

Java backend? What year is it?

[–] moon@lemmy.cafe 0 points 2 years ago* (last edited 2 years ago) (1 children)

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.

[–] hansl@lemmy.world 0 points 2 years ago

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.

[–] cupcakezealot@lemmy.blahaj.zone 0 points 2 years ago (3 children)

an alternative Java-based backend

kill it with fire

[–] MashedTech@lemmy.world 0 points 2 years ago

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

[–] p03locke@lemmy.dbzer0.com 0 points 2 years ago* (last edited 2 years ago)

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.

[–] twistypencil@lemmy.world 0 points 2 years ago (1 children)
[–] Corngood@lemmy.ml 0 points 2 years ago (1 children)

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<Community> allCommunitiesBySearchCriteria(CommunitySearchCriteria communitySearchCriteria);

}

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

[–] Carighan@lemmy.world 0 points 2 years ago (1 children)

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.

[–] Corngood@lemmy.ml 0 points 2 years ago

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.