this post was submitted on 23 Jan 2024
329 points (96.6% liked)

Fediverse

36055 readers
226 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)

founded 2 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.

you are viewing a single comment's thread
view the rest of the comments
[–] kawa@reddeet.com 59 points 2 years ago (3 children)

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

[–] Rooki@lemmy.world 13 points 2 years ago (1 children)

Probably because everyone knows it and its more predictable

[–] mea_rah@lemmy.world 14 points 2 years ago (1 children)
[–] Rooki@lemmy.world 5 points 2 years ago (1 children)

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.

[–] mea_rah@lemmy.world 9 points 2 years ago (1 children)

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.

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

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 )

[–] kaffiene@lemmy.world 3 points 2 years ago (1 children)

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.

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

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

[–] kaffiene@lemmy.world 2 points 2 years ago

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

[–] 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.