TIL about Sublinks, a Java-based alternative to Lemmy's backend

Today I learned about Sublinks (here), an open-source project that aims to be a drop-in replacement for the backend of Lemmy, a federated link aggregator and microblogging platform. Sublinks is designed to be initially API-compatible with Lemmy, allowing existing Lemmy clients, such as Lemmy-UI, to integrate seamlessly.

The project is written in Java, which may introduce some overhead but is chosen for its maintainability and familiarity among a wider pool of developers. The Sublinks team prioritizes a more inclusive and less toxic development environment, and the project has already attracted more developers than Lemmy.

While Sublinks is starting with 1:1 compatibility, future plans include implementing additional features that the Lemmy developers have not pursued. This could lead to a divergence in functionality between the two platforms as Sublinks evolves beyond its initial compatibility phase.


README

GitHub starsGitHub tag (latest SemVer)gradle workflowhttps://github.com/sublinks/sublinks/issuesLICENSE

Sublinks

A decentralized, censorship-resistant, and privacy-preserving social network.

About

Sublinks, crafted using Java Spring Boot, stands as a state-of-the-art link aggregation and microblogging platform, reminiscent yet advanced compared to Lemmy & Kbin. It features a Lemmy compatible API, allowing for seamless integration and migration for existing Lemmy users. Unique to Sublinks are its enhanced moderation tools, tailored to provide a safe and manageable online community space. Embracing the fediverse, it supports the ActivityPub protocol, enabling interoperability with a wide range of social platforms. Sublinks is not just a platform; it’s a community-centric ecosystem, prioritizing user experience, content authenticity, and networked social interaction.

Features

  • Open source, MIT License.
  • Self hostable, easy to deploy.
  • Clean, mobile-friendly interface.
    • Only a minimum of a username and password is required to sign up!
    • User avatar support.
    • Live-updating Comment threads.
    • Full vote scores (+/-) like old Reddit.
    • Themes, including light, dark, and solarized.
    • Emojis with autocomplete support. Start typing :
    • User tagging using @, Community tagging using !.
    • Integrated image uploading in both posts and comments.
    • A post can consist of a title and any combination of self text, a URL, or nothing else.
    • Notifications, on comment replies and when you’re tagged.
      • Notifications can be sent via email.
      • Private messaging support.
    • i18n / internationalization support.
    • RSS / Atom feeds for All, Subscribed, Inbox, User, and Community.
  • Cross-posting support.
    • A similar post search when creating new posts. Great for question / answer communities.
  • Moderation abilities.
    • Public Moderation Logs.
    • Can sticky posts to the top of communities.
    • Both site admins, and community moderators, who can appoint other moderators.
    • Can lock, remove, and restore posts and comments.
    • Can ban and unban users from communities and the site.
    • Can transfer site and communities to others.
  • Can fully erase your data, replacing all posts and comments.
  • NSFW post / community support.
  • High performance.

Contact

Contributing

Support / Donate

Sublinks is free, open-source software, meaning no advertising, monetizing, or venture capital, ever. Your donations directly support full-time development of the project.

Daxtron2,

I think you’re all wrong and we should rewrite it in scratch

01189998819991197253,
@01189998819991197253@infosec.pub avatar

Scratch Jr. What are we, the elites?!

Daxtron2,
01189998819991197253,
@01189998819991197253@infosec.pub avatar

That’s a good one! I’m totally using this!

Daxtron2,

Absolutely not I will press charges

01189998819991197253,
@01189998819991197253@infosec.pub avatar

I legit laughed out loud! Hahaha

delirious_owl,
@delirious_owl@discuss.online avatar

Where do I find an instance to register an account, and what is the best app to use in f-droid?

SorteKanin,
@SorteKanin@feddit.dk avatar

Not sure if genuinely asking but there are no instances currently as it’s still being developed. I believe they will make it so Lemmy apps are compatible? But unsure for how long this will be true.

ChasingEnigma,

demo.sublinks.org

It doesn’t federate and there are no apps yet.

mac,
@mac@programming.dev avatar

All lemmy apps are sublinks apps, it has api compatibility

The demo site also isn’t an instance for accounts, its a demo

nutomic,
@nutomic@lemmy.ml avatar

I actually talked with Jason (one of the Sublinks maintainers) a while ago, asking about the features he was missing from Lemmy. Turns out it was just one or two minor API changes that could be easily implemented, but he never even bothered to open an issue about it. I think they just have fun reimplementing Lemmy, but it would take at least multiple years to catch up with the current features of Lemmy. And by then Lemmy will of course have many more features and improvements. So I wouldnt expect that this ever becomes useful for production.

mac, (edited )
@mac@programming.dev avatar

API pretty much already has parity, should be done way quicker than that

AtmaJnana,

FYI, in case you did not notice: nutomic, the user you’re replying to, is one of the two creators of Lemmy. Make of that what you will.

yuriy,

Fun amount of shade-throwing from a dev, that gives me a lot of confidence in the platform.

nutomic,
@nutomic@lemmy.ml avatar

No schade-throwing, but I know how much effort it took to get Lemmy ready for production. Namely multiple years of fulltime work. Sublinks seems to have only volunteer contributors, so it will likely take even more time.

delirious_owl, (edited )
@delirious_owl@discuss.online avatar

Lemmy is pretty shit on features. You can’t even delete images.

SorteKanin,
@SorteKanin@feddit.dk avatar

There is this issue for it: github.com/LemmyNet/lemmy/issues/4445

nutomic,
@nutomic@lemmy.ml avatar

Not true. And if you miss a feature why dont you help implementing it instead of complaining? Thats what open source is all about.

delirious_owl,
@delirious_owl@discuss.online avatar

It is true. And you work for us. Dont forget that.

AtmaJnana, (edited )

wow. That’s a seriously shitty attitude, even if they did actually work for you, which … they don’t.

kilgore_trout,

They are giving away Free Software free of charge. They could disappear tomorrow and still they are offering their time and expertise for very little money (you should be aware that NLnet grants do not constitute a living wage, even for a single person).

Be more respectful.

baatliwala,

Do you pay him wages?

delirious_owl,
@delirious_owl@discuss.online avatar

NLnet does via grants. But you work for the people who use your software, not the people who pay you

baatliwala,

Are they forcing you to use their software?

expr,

Fuck off.

Rooki,
@Rooki@lemmy.world avatar

Because of that sublinks got created.

mwalimu,
@mwalimu@baraza.africa avatar

And if they develop a good tool, that is also fine. The more the merrier. But I think their resources may have served more people if they were not duplicating effort and rather contributed into existing work. To each their own.

BURN,

I’m going to guess most Sublinks contributors aren’t going to be main branch Lemmy contributors due to the language difference. It’s what’s kept me from working on main branch Lemmy as I’m pretty much useless with Rust

masterspace, (edited )

I mean, isn’t the whole point that they didn’t want to have to learn Rust just to contribute to Lemmy?

Given how few day to day Rust devs there are compared to Java / C# / Typescript, it was only a matter of time before someone wrote a more popular version of the server in a different language.

mwalimu,
@mwalimu@baraza.africa avatar

Still fair point. The grind is in placing the new reimplementation of federated link aggregator in opposition to Lemmy as if they are competing, and sadly to trash Lemmy and its developers.

masterspace,

That’s a fair point about communication and positioning, I just don’t think resources are necessarily wasted if they’re duplicating effort into a more accessible format.

BURN,

Yep, I’m useless when it comes to rust. I can write Java/Spring in my sleep. A big barrier to entry to Lemmy contributions is not being familiar with rust

nutomic,
@nutomic@lemmy.ml avatar

I was a Java developer before starting to contribute to Lemmy. Didnt know anything about Rust, just wrote code and resolved compiler errors until things worked. Rust is definitely not as hard to learn as some people think.

expr,

That is rapidly changing. More and more huge tech companies are spinning up sizable Rust teams. Rust is basically at the place Go was a few years ago. It’s on the verge of becoming mainstream and has a huge community behind it.

I personally view sublinks as pretty pointless and short-sighted. It is frankly not that hard to pick up a new language and contribute to a project for an experienced developer, so I see little reason to try to rewrite it if nothing new is really being offered. If you look at the GitHub of each, sublinks does not have more contributors or anything like that, so the value proposition seems dubious at best.

lvxferre, (edited )
@lvxferre@mander.xyz avatar

I hope that this project survives and thrives. Even if only the first milestone (feature parity) and a tiny bit of the second one (moderation) are reached, it’s already a big improvement for the “Fediverse forums”.

And as mox said ITT it makes it less reliant on any particular dev team. I also wish that MBin was a bit more popular.

I won’t comment on maintainability because I’m neither a programmer nor an assumer.

Blaze, (edited )
@Blaze@reddthat.com avatar

It was intensively discussed a month ago, have a look at this thread if you are interested: lemmy.world/post/11061890 (you can copy paste the link in your search to find it on your instance)

Most of the pro/cons of the initiative have been discussed there

Personally I find it very promising, curious to see what it will look like once they reach feature parity with Lemmy

mox,

Despite disliking Java, I’m glad to see another implementation of the platform we’re all using, as it makes this part of the fediverse less dependent on any particular development team.

Why in the world did you enclose the readme in a code fence, though? It would be so much better to let the markdown do its job. My eyes are burning.

ChasingEnigma,

Why in the world did you enclose the readme in a code fence, though? It would be so much better to let the markdown do its job. My eyes are burning.

I wanted to use a quote to differentiate it a bit from the post but Lemmy-ui only quotes the first line.

mox, (edited )

I see. Code fences are really for computer code, though, not general quoting. They defeat word wrap, markdown, and proportional fonts.

Unformatted text quotes are best done by inserting > at the start of each paragraph.

For something that’s already formatted with markdown, like this, I would probably just put a horizontal rule under whatever I wrote, and paste the markdown beneath that. It’s done with on its own line, if I remember correctly.

nutomic,
@nutomic@lemmy.ml avatar

I agree that its good for redundancy to have another development team for Lemmy. However they will be busy for the next few years redoing all the work we have already done for Lemmy. It would be much more efficient if they simply forked the existing Rust code and implemented their desired features on top. That would also make it easy to merge their changes back into Lemmy.

fruitycoder,

Tbh that was first thought, but tbh if I made a Lemmy clone it would Python, because my rust skills are weak. Though that is probably part of why I wouldn’t try to run my own fork too.

Blaze,
@Blaze@reddthat.com avatar

piefed.social is a Python based alternative

codeberg.org/rimu/pyfedi is the repo

fruitycoder,

Oh sweet!

imaqtpie,
@imaqtpie@sh.itjust.works avatar

Since people in this thread seem to be more knowledgeable about programming languages than me, I’m curious how you all feel about PieFed.

It’s a similar project, describes itself as

a Lemmy/kbin clone written in Python with Flask

Promising? Potential concerns?

SorteKanin,
@SorteKanin@feddit.dk avatar

Python started as a scripting language and I wish people would’ve let it be like that. Using Python for large systems is a nightmare. Especially if you want to juggle random contributions from indviduals that you have to vet carefully because god knows what some small change might break - Python for sure won’t tell you.

imaqtpie,
@imaqtpie@sh.itjust.works avatar

I see. Thank you for the information

spaduf,

I think this is an incredibly outdated take. Python is just about the best general-purpose interpreted language out there right now.

SorteKanin,
@SorteKanin@feddit.dk avatar

Python is just about the best general-purpose interpreted language out there right now.

I agree with you actually - I think Python is better than Ruby and much better than JavaScript.

But dynamically typed interpreted languages is just not what you want when building large systems. As the code base grows, static analysis becomes exponentially more important and Python provides roughly 0 static analysis. A thousand lines of Python is easy to manage. Ten thousand lines of Python is… questionable, but perhaps barely managable, if you’re careful. 100 thousand or even more? It’s impossible to keep track of.

Just as a basic example, if you have a million lines of Python and you make some change somewhere in your code, Python won’t help you in any way to find out where you need to update things to handle that change.

Meanwhile, if you do the same in with a million lines of Rust, the Rust compiler will point to every single place where you need to update your code to make it work again.

I don’t know if you’ve worked with large Python code bases, but I have and it’s not fun.

magic_lobster_party,

The good thing about Python is that it’s widely used. Easier to find people who can contribute in Python than Rust, which Lemmy is using.

Downside is that Python isn’t ideal for large scale systems. Other languages like Java is better at protecting the programmer against common pitfalls that come when building larger applications. Python is more ideal for smaller scripts.

db0,
@db0@lemmy.dbzer0.com avatar

Not at all. if you want protection and strict typing, you can have it just as well with python.

stevecrox,

I wouldn't get massively excited.

Python is a scripting language, its shines when you want to write a stand alone file which takes an input and performs a task. Scripting languages are great to learn as a first language and so python is wonderful for non developers.

The issue you hit is the build management solutions for Python are kind of broken and these help support and encourage good development practice so a lot of Python projects end up a collection of scripts rather than a mature project. You can have good projects but...

In raw benchmarks Java has 90% of the performance of C/C++, but in reality Java is more performant because developers get bogged down in memory management on C/C++ and they get more time to optomise in Java as a result. I'm not sure where Rust will come out to be honest.

Python benchmarks at 50% the performance of Java, in reality I've found code ends up slightly worse because Python is procedural, library support and streaming is poorly supported.

Take library support, Spring really rose to prominese because of 'hibernate' which was a way to abstract talking to different databases through objects, you could switch from PostgreSQL to Oracle through config. Spring data has dumbed this down so I define a plain old Java object and Spring will generate everything I need.

Python expects you to hand craft SQL statements and every database extends SQL slightly differently, so i need to write SQL for every operation and manage/own it. So the win in being able to quickly read/write to a database (since you don't have to learn anything about Spring) is quickly ruined because of the all the boilerplate and error handling you now have to write.

imaqtpie, (edited )
@imaqtpie@sh.itjust.works avatar

Great response 👍

It’s nice to have other projects going on, but it seems like Lemmy is far ahead of everyone else at this point. Which is great because Lemmy is bae

db0,
@db0@lemmy.dbzer0.com avatar

Python expects you to hand craft SQL statements

That is completely untrue and you thinking that completely undermines your authority on speaking for python. One word: sqlalchemy

dwalin,

And dont forget about graalvm if you really want small binaries and lots of performance

Rooki,
@Rooki@lemmy.world avatar

Great explaination why python is not super good for such big project.

ericjmorey,

The biggest thing that PieFed has done is get up and running on public data with new accounts open to the public. This trial by fire will make it fail fast or become much improved. It seems that the main developer is quite experienced and has thought about architecture and improvements that have already been implemented. I think it’s promising for all of these reasons.

My biggest potential concern is that moderation tools have not been implimented yet (unless the were very recently).

As far as Python being difficult in larger systems, this can be mitigated by experience and good practice. But I tend to agree that Python is typically not the ideal choice for a large project.

db0, (edited )
@db0@lemmy.dbzer0.com avatar

I love the idea of piefed. Don’t listen to the python haters below. Most of them don’t know what they’re talking about. Almost all machine learning is done on python for a reason. I’ve designed and run a python service serving thousands per day, from scratch, without issues. Python is perfectly capable of making a service like lemmy and a great choice due to how easy it is to use for development.

I wish I had more free time and I would contribute to it

imaqtpie,
@imaqtpie@sh.itjust.works avatar

Okay, thanks for the alternate perspective. I’m rooting for PieFed for sure, made an account over there the first time I saw it linked and personally felt that everything worked surprisingly well.

AlexWIWA,

Meh. Java feels like a downgrade.

SorteKanin,
@SorteKanin@feddit.dk avatar

In terms of maintainability and efficiency, it probably is.

In terms of number of potential contributors… well time will tell, but currently doesn’t seem any better.

Rooki,
@Rooki@lemmy.world avatar

In terms of maintainability its an upgrade. Can you read the code from the current lemmy as a non rust coder? no. Now look into any file in sublinks can you read that? Probably yes.

Maintainability is gained too with the more possible contributors that have more knowledge about java and can improve more and more the code

SorteKanin,
@SorteKanin@feddit.dk avatar

Now look into any file in sublinks can you read that?

No I can’t - I’m not a Java dev and I find Java to be insanely verbose honestly. I find Rust much more parseable.

But seriously, debating readability of languages is such a subjective thing. What is not subjective is Rust’s reliability and static analysis.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

You don’t need any of that for a web server… There should be minimal state to synchronize between threads (the assignment of a request to a thread) all handled by your web framework. Asynchronous IO can be much more significant which you can do in both Rust and Java equally safely. I haven’t kept up but Java was working on a threading model that allows old school threads to act like fibers or real threads effectively allowing dumb parallelism to scale like crazy for blocking IO with minimal code changes as well.

Java should be just as good if not better (by the nature of being a VM that doesn’t have unsafe blocks) when it comes to the memory safety side of things. Java also optimizes quite well for long running applications like web servers.

It’s really not a bad language and it continues to get better.

SorteKanin,
@SorteKanin@feddit.dk avatar

You don’t need any of that for a web server

I disagree - any software is better with more reliability. Static analysis becomes more and more important as the code base grows.

Java should be just as good if not better (by the nature of being a VM that doesn’t have unsafe blocks) when it comes to the memory safety side of things. Java also optimizes quite well for long running applications like web servers.

(Safe) Rust and Java are both memory safe. I don’t think any is better than the other in this aspect. Many projects use #[forbid(unsafe)] to make sure they only use safe Rust. Unsafe Rust is not necessary in 99.9% of cases, certainly never for a web server like Lemmy.

It’s really not a bad language and it continues to get better.

It’s subjective obviously. I don’t like it personally, some people do. To be fair I think there are worse languages out there - Python for instance. At least Java has static typing, which is nice. We’ll just have to wait and see what happens with the different fediverse forum implementations.

Dark_Arc, (edited )
@Dark_Arc@social.packetloss.gg avatar

any software is better with more reliability. Static analysis becomes more and more important as the code base grows.

You’re saying static analysis and reliability like they’re things Rust objectively has that Java doesn’t.

The only things Rust has at a fundamental level are a borrow checker and value types.

Value types can be nice for performance in certain situations (which aren’t nearly as important for a web server as fibers/coroutines). The borrow checker is nice for threading (which isn’t an issue in a restful web server design as previously stated). That’s about it.

(Safe) Rust and Java are both memory safe. I don’t think any is better than the other in this aspect.

It’s not possible to write (memory) unsafe Java code. All Java code is memory safe. Most rust code is memory safe.

Of course that’s not entirely true because of the possibility for bugs in the Rust compiler or the JVM.

Java and Rust both can call out to C libraries as well which of course… You get what you get.

Python for instance. At least Java has static typing

Python can have static typing these days as well. It’s just optional and controlled by the project.

AlexWIWA, (edited )

Rust is rapidly gaining popularity and it’s popular with the type of people who would use Lemmy. There aren’t contributors because there aren’t many users.

Though like you said, time will tell

Rooki,
@Rooki@lemmy.world avatar

For me i dont see any gains in popularity. Java IS popular right now, not in 10 years. Java is mature enough.

natecox,
@natecox@programming.dev avatar

It’s cool to like Java, I’m not hating on it, but it’s just silly to pretend that Rust isn’t popular today.

Rust is used in fewer corporate environments, no doubt there, the Java inertia is strong… but a glance at any moderately recent dev survey should indicate pretty clearly that Rust is on a lot of devs minds and is well received.

Blaze,
@Blaze@reddthat.com avatar

Then how do you explain there is no major contributor to Lemmy besides the two main devs?

natecox,
@natecox@programming.dev avatar

Well, for one thing federated message boards are incredibly niche to start with, and the pool of people willing to work on one for free in their spare time is bound to be tiny aside from language concerns. I know we all want the fediverse to be the hot thing that everyone uses, but that ain’t reality.

I’m not exactly seeing a massive contributor pool for sublinks here either.

Blaze,
@Blaze@reddthat.com avatar

On this board you already see 5-6 different contributors for the 0.1 version, which is at least twice the number of Lemmy contributors:

github.com/orgs/sublinks/projects/1/views/6

Anyway, let’s see how it evolves, but it seems promising

SorteKanin,
@SorteKanin@feddit.dk avatar

If you compare the contributors on the lemmy backend and the sublinks backend there is really not much of a difference.

Any open source project rides on a very small sample of individual contributors.

natecox,
@natecox@programming.dev avatar

… lemmy has like 100 contributors listed on GitHub. Just looking at the contributors list for the sublinks api vs the Lemmy main project it seems like Lemmy has far, far more contributions.

I think competition is a good thing, I hope sublinks gets like all the users and contributors and a dozen more projects spin up in all the languages of the rainbow—especially given they should all be contributing to one big pool of shared content— but it’s worth at least staying grounded in reality when making claims about the projects.

It’s super, super silly to be reactively defensive of one project or the other here. It really feels like what some people actually want is yet another language pissing contest more than anything else. All the languages are fine.

Blaze,
@Blaze@reddthat.com avatar

All the languages are fine.

Python started as a scripting language and I wish people would’ve let it be like that. Using Python for large systems is a nightmare.

Just surprised as I read both of those comments back to back

natecox,
@natecox@programming.dev avatar

Didn’t realize I didn’t write both of those, eh?

Blaze,
@Blaze@reddthat.com avatar

I realized if afterwards, which is why I deleted my comment. Didn’t the deletion federate? Sometimes it does not.

natecox,
@natecox@programming.dev avatar

Eh, maybe my client just didn’t refresh it; I saw it from my inbox.

Blaze,
@Blaze@reddthat.com avatar

Ah, might be, I know that was a known issue some time ago

SorteKanin, (edited )
@SorteKanin@feddit.dk avatar

At the scale of having a handful of contributors, it’s more likely random variance than due to the language you’ve chosen. The sample size is simply too small.

I can speak for myself - I know Rust very well but I simply don’t have the time to contribute to Lemmy’s code (I’m also spending some time already being an admin for Feddit.dk and I feel that is all I can muster).

Getting contributors to open source projects is never easy, regardless of programming language.

But I mean… there is no problem with competition right. Maybe it’ll turn out that sublinks will have more development with more contributors. But it has yet to be shown, there are also only 1 or 2 developers working on sublinks at the moment, if you check the github contributor stats.

Blaze,
@Blaze@reddthat.com avatar

Having a look at the current project board, seems like they are progressing quite fast: github.com/orgs/sublinks/projects/1/views/6

We’ll see how it evolves, but compared to Lemmy development, this seems at least more structured and more inviting for people to take a ticket and start contributing

SorteKanin, (edited )
@SorteKanin@feddit.dk avatar

It could be - time will tell. But that has nothing to do with Rust vs Java.

Personally, I feel that if your goal was to make a clone of Lemmy with better structured tickets and a roadmap and all that… why don’t you just talk to the Lemmy devs about organizing their issues, creating a road map and contributing as a project manager? That is work and a skill that is often sorely lacking in open source development. That seems much easier and more iterative than trying to rewrite the whole thing in a different application.

AlexWIWA,

Open source needs some project managers to contribute their skills, imo. Contributing to open source made me finally understand how necessary PMs actually are. When left to our own devices, devs are… chaotic.

AlexWIWA,

Because people only contribute to projects they care about, can get clout from, or use and want to fix something that’s bugging them. Lemmy is just too niche right now.

If in five years there’s still just the two devs then you may gloat and tell me I was wrong and I will accept the shame

Rooki,
@Rooki@lemmy.world avatar

https://lemmy.world/pictrs/image/297727ef-cfc7-461a-95f1-d7b2617de91f.png

Popular? Objective C is still popular and more demanded than Rust.

natecox,
@natecox@programming.dev avatar

Yep. The job market isn’t as strong for rust, which is what that chart is showing you. Corporate acceptance != popularity.

Rust is #6 on the Stack Overflow developer survey in popularity. survey.stackoverflow.co/2023

Again, I don’t know why the community is insisting on making this a dick measuring contest for languages. People love rust. People love Java. I know people who still love Perl. I know one guy who really seems to look fondly on his Fortran days. they’re all fine.

Just be happy that someone is excited enough to write some code to make the fediverse a little more diverse and maybe cool.

Rooki,
@Rooki@lemmy.world avatar

Correct. But those accusations that java was a bad choice i just cant have it. This isnt “I love Rust” or “I love XYZ Programming language” it was “F*ck you for using java”.

SorteKanin,
@SorteKanin@feddit.dk avatar

Isn’t it more like the other way around? Lemmy was written in Rust, then this clone is in Java - isn’t that more like “damn you for using Rust”?

magic_lobster_party,

This thread chain started with:

Meh. Java feels like a downgrade.

Sublinks using Java is not about Rust hate. They just thought it was the better choice for them.

Blaze,
@Blaze@reddthat.com avatar

Just be happy that someone is excited enough to write some code to make the fediverse a little more diverse and maybe cool.

Sounds like the most positive approach.

The thread from a month ago was really negative towards Java, it was surprisingly aggressive

natecox,
@natecox@programming.dev avatar

I remember. It is a very annoying and negative trait that the dev community can’t seem to shake, the insistence on making hating certain tech (or even just like coding styles in general) part of their whole identity.

I remember thinking Clojure was stupid and people who used it were stupid because all of my peers told me so and made fun of the parenthesis relentlessly. Then I grew up a little, read a Clojure book, and fell in love with it. Plus learning to code in a brand new way made me a better dev overall.

daddyjones,
@daddyjones@lemmy.world avatar

I disagree - Java seems like the ideal choice for this. I might be in the minority in that view, though. Java seems to get a lot of hate.

AlexWIWA,

I’d love to hear your reasoning. I don’t meet many java devs, so my opinion has definitely been formed in an echo chamber.

magic_lobster_party,

There’s no shortage of developers with lots of experience in writing Java backends. People know what to do and what to avoid. The pool of available contributors should be larger.

Backends in Rust is relatively uncommon.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

See my (imo unjustly down voted comments social.packetloss.gg/comment/1352608)

AlexWIWA,

Thank you :)

daddyjones,
@daddyjones@lemmy.world avatar

I’ve been a Java dev for roughly 20 years and still find it a very comfortable way to write code. Most of the complaints I hear about it (e.g. verbose) are wildly overstated or just plain wrong (e.g. slow).

Of course, a lot of it comes down to the developer - anyone can write bad code in any language.

AlexWIWA,

True. In college I once wrote C++ code that was slow

SorteKanin,
@SorteKanin@feddit.dk avatar

Java seems to get a lot of hate

Well, lots of people don’t like it. Actually according to StackOverflow’s 2022 survey, more people who have used Java don’t want to keep using it than those who do want to keep using it (54% vs 46% roughly). So yea, you are in the minority in that way.

Meanwhile Rust is well-liked by most people who use it (roughly 87%).

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

Lots of people are taught a decades old version of Java as their only experience with the language in college.

SorteKanin,
@SorteKanin@feddit.dk avatar

That could be part of the explanation, but I don’t think it upweighs the ~40% difference between Java love and Rust love. That is quite a large gap.

BURN,

People who seek out rust are likely people who want to use rust. Java is still a huge player in enterprise dev, where a significant portion of active developers are. So not everyone using Java wants to use Java, but nearly everyone using rust wants to use rust.

SorteKanin,
@SorteKanin@feddit.dk avatar

I do think the developer experience with Rust is better in general though, so even if Rust was used elsewhere, it would still be liked more than Java, I would guess.

But we won’t know who’s right for another 10 years maybe :P

Dark_Arc, (edited )
@Dark_Arc@social.packetloss.gg avatar

I’d give it a few more years before announcing the death of all other languages in favor of Rust.

Everything is tradeoffs and Rust is still quite new compared to Java, C++, or Python (all languages that continue to evolve). Stack overflow didn’t exist to run popularity contests when they were getting off the ground.

The new big thing always becomes a bit … too big and gets applied to areas it really doesn’t help with.

AlexWIWA,

My hottest take is that PHP isn’t that bad, it’s just that the PHP most people have worked with was written by a teenager in a week and somehow grew into a whole company that they now have to maintain.

I loved cakephp.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

😬 if you say so lol

masterspace,

I was taught Java in High School, then had one course on it in uni, then in my professional life ended up learning C#, Python, and Typescript and building servers with them before now coming back to Java 17 / Spring Boot thinking “oh this will be pretty similar to C# from what I remember”, and instead I’ve found myself cursing out Java / Spring Boot many many times.

Java’s insistence on everything being object oriented is a huge hindrance to it as a language. It forces it to be ridiculously verbose in so many cases. Not every concept in code is a Noun, there are lots of times where it makes more conceptual sense to think of them as Verbs, but as a language Java still doesn’t fully support that.

Give me a nice easy to follow functional Express.js chain any day, over jumping around a million magically connected ______ProviderBuilderProvider classes.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

You can write functions… A static function is not particularly different from a free function written in a namespace. You can even use a static import to allow yourself to call it without qualification.

______ProviderBuilderProvider

No idea what this is in reference to. I have a feeling your issue is more with the frameworks you’ve worked with than Java itself.

masterspace, (edited )

You can write functions… A static function is not particularly different from a free function written in a namespace. You can even use a static import to allow yourself to call it without qualification.

I’m referring to functional programming concepts like anonymous functions and functions as parameters. Java finally added support for this with Lambda expression in Java 8, but because it took them so long, most libraries and frameworks that wanted to support backwards compatibility didn’t use them and still forced everything into classes and objects, meaning that most Java code bases you find are purely object oriented.

______ProviderBuilderProvider

idea what this is in reference to. I have a feeling your issue is more with the frameworks you’ve worked with than Java itself.

It’s in reference to the fact that unlike basically every other modern programming language, Java doesn’t let you do stuff like have default parameters for functions, instead forcing you to overload them:

In Javascript / C# you just have:


<span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">DoSomething</span><span style="color:#323232;">(int  howManyTimes </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">10</span><span style="color:#323232;">){
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">//something
</span><span style="color:#323232;">}
</span>

In Java you have:


<span style="color:#323232;">function DoSomething() {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> howManyTimes </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">10</span><span style="color:#323232;">;
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">//something
</span><span style="color:#323232;">}
</span><span style="color:#323232;">function DoSomething(</span><span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> howManyTimes) {
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">//something
</span><span style="color:#323232;">}
</span>

Which then leads you to recommendations of using the Builder Pattern, and now you’ve got the function / class you care about rewritten three times, plus a whole a builder class and a bunch of building specific functions, all of which are basically just a whole bunch of unnecessary verbose bullshit to approximate default parameters that are expressed more clearly with 2 additional characters in other languages.

Dark_Arc, (edited )
@Dark_Arc@social.packetloss.gg avatar

Sounds like you’re working with some bad libraries and writing some bad code IMO.

Java 8 was released over a decade ago. Lambdas in Java are in great shape. Java’s streaming API makes heavy use of them.

Builders should not be used all that much, certainly not in place of default arguments.

The correct way to write that is simply:


<span style="font-weight:bold;color:#a71d5d;">void </span><span style="color:#323232;">doSomething() {
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> howManyTimes </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">10</span><span style="color:#323232;">;
</span><span style="color:#323232;">    doSomething(howManyTimes);
</span><span style="color:#323232;">}
</span><span style="font-weight:bold;color:#a71d5d;">void </span><span style="color:#323232;">doSomething(</span><span style="font-weight:bold;color:#a71d5d;">int</span><span style="color:#323232;"> howManyTimes) {
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">//something
</span><span style="color:#323232;">}
</span>

Is it more lines that a default argument? Sure. It’s not that bad though. It also resolves some ABI complexity issues that come into play with default arguments. If you use default arguments in C++ anything calling that code needs to be rebuilt if the default argument is updated. In Java because it’s part of the definition of the function not the call site the default is updated by replacing the library. I don’t know how C# handles this, perhaps they create the overload implicitly. It’s not a problem for JavaScript or Python because they’re interpreted.

Bonus points, you can use an interface to provide a default overload like that even if you’re dealing with something that’s abstract.

I’m also mildly concerned by how you’re using JavaScript like function declarations in your examples with C# like naming scheme to demonstrate why Java is bad.

As your own link the builder pattern is an alternative to the factory pattern. Neither of which Java or any other language requires you to use. Note there is not a single “Builder” in the entire sublinks Java codebase.

Late edit: Also going to add in rust-unofficial.github.io/…/builder.html

masterspace,

Sounds like you’re working with some bad libraries and writing some bad code IMO.

Yes, the Java language encourages it, as do popular frameworks like Spring / Boot.

Is it more lines that a default argument? Sure. It’s not that bad though.

Yes it is. You’re adding and entire new function block for every single optional parameter. Add three more optional params and you’ve got a page of text to express a single line in other languages.

Bonus points, you can use an interface to provide a default overload like that even if you’re dealing with something that’s abstract.

That’s great, you can in C# and Typescript too but you don’t have to.

I’m also mildly concerned by how you’re using JavaScript like function declarations in your examples with C# like naming scheme to demonstrate why Java is bad.

Lmao, I’m mildly concerned that you don’t understand the concept of pseudo code.

Note there is not a single “Builder” in the entire sublinks Java codebase.

That’s awesome, it will be the first Java project I’ve encountered where that’s the case.

Dark_Arc,
@Dark_Arc@social.packetloss.gg avatar

the Java language encourages it

It really doesn’t. Perhaps your teachers and workplace do out of some dated design ideals though.

Like everything else it was a fad and it’s got its time and place.

Yes it is. You’re adding and entire new function block for every single optional parameter. Add three more optional params and you’ve got a page of text to express a single line in other languages.

See my (late) edit (sorry things jump into my head sometimes … and forum software is inferior to chat software in adding that in a sensible way) about what the unobvious consequences of default arguments can be in some languages. Also, do you really write default arguments that often?

If you’re writing functions with tons of arguments that are all defaulted that should also be a red flag there’s probably a refactor that needs done to bundle that data.

Granted, the indirection that can cause in a language without value types (like Java) can be a burden in some very performance critical situations … but those are few and far between in practice.

Lmao, I’m mildly concerned that you don’t understand the concept of pseudo code.

Touche.

That’s awesome, it will be the first Java project I’ve encountered where that’s the case.

There are plenty of them out there… Maybe your code base too if you can figure out why you’re using so many of them. There’s really nothing profoundly unique about Java that predisposes it to needing large numbers of builders.

delirious_owl,
@delirious_owl@discuss.online avatar

I used to think that until I realized Maven requires PGP signatures on all packages. So the supply chain is wayy more secure than rust or python or basically every other language.

Lemmy is a disaster from a security perspective

mwalimu,
@mwalimu@baraza.africa avatar

Something feels off with this post. It comes off as “we are better than Lemmy” as if there is any competition and awards to be won. To say Lemmy’s development is “toxic” and this project is “more inclusive and less toxic” without backing it up with evidence is unfair.

SorteKanin,
@SorteKanin@feddit.dk avatar

Also, even though the main motivation seems to be more contributors, there seems to only be two active contributors anyway. So not any better than Lemmy.

crossmr,

There is a reason the original sub on reddit had the rules it did, it was to avoid posts like this.

acockworkorange,

It’s also an ad. Fuck this noise.

loki, (edited )

It seems like they’re trying to appeal to admin/users who despise where the developers of Lemmy come from and make them move away from Lemmy to their codebase.

Their “United States of Amewrica” on their github seems all too intentional.

But options are always good because the fediverse is all about options. If Lemmy gets too controversial, instance admins can hopefully move over to sublinks without losing functionality.

acockworkorange,

I’m not disputing any of that. I’m disputing the advertisement on a TIL community.

ChasingEnigma, (edited )

I agree, but the post is pretty much a copy/paste from the comment where I learned about the project, so blame @ptz

nutomic,
@nutomic@lemmy.ml avatar

I see that comment but somehow cant fetch it from lemmy.ml. Would you mind asking what exactly they mean by “toxic development community”? Its honestly the first time I heard something like this about Lemmy.

SorteKanin,
@SorteKanin@feddit.dk avatar

You don’t see it on lemmy.ml because dubvee.org has defederated from lemmy.ml.

ChasingEnigma,

I don’t want this to become a rant thread, but the devs have frequently told contributors “No one is forcing you to develop for Lemmy”. That’s but one example.

@ptz on dubvee.org/comment/1671815

nutomic,
@nutomic@lemmy.ml avatar

Hmm not sure whats the context of that quote.

SorteKanin,
@SorteKanin@feddit.dk avatar

what exactly they mean by “toxic development community”?

I’m not sure exactly what they mean by it either, but I do think Lemmy could do more to be welcoming to more outside contributors. It would probably also be a better use of your time - to scale Lemmy development, it would be better to spend time recruiting and training contributors rather than just spend all your own time coding. You (the main two devs) know the code better than anyone else. It would be great use of your time to spread that knowledge to more contributors.

Sublinks for instance also uses the GitHub projects as a kind of publicly viewable backlog of issues and a roadmap. I think especially a roadmap is something a lot of users would like for Lemmy as well. It would be good use of your time to produce a roadmap of some kind. Doesn’t have to be on GitHub obviously, but just any kind of roadmap.

nutomic,
@nutomic@lemmy.ml avatar

Sure being more welcoming to outside contributors sounds good. Do you have any concrete suggestions how to recruit and train them? We do have some community contributors, but they seem very limited by the amount of time they have for Lemmy after their fulltime job.

Once the new round of NLnet funding is finalized we will publish those milestones. However Im not sure if a backlog like the one you linked is really helpful, it would take a significant amount of time to manage for little benefit. After all every open issue on the Lemmy Github is up for grabs for anyone to implement it.

SorteKanin,
@SorteKanin@feddit.dk avatar

Once the new round of NLnet funding is finalized we will publish those milestones.

That sounds great :)

Im not sure if a backlog like the one you linked is really helpful

I think the GitHub issue tracker that you’re already using is plenty as a backlog. The more important part was the road map.

Do you have any concrete suggestions how to recruit and train them?

It’s a good question. I would recommend taking a look at the Bevy game engine project. They’ve had a success story with lots of contributors and they also use Rust. Obviously they have it easy because game development is something a lot of people are passionate about while online forums aren’t as hot… But still, I think they’ve done some really good stuff and it seems like a really well-managed open source project.

One of the bevy project managers did a talk at RustConf 2022 that I’d recommend watching: youtu.be/u3PJaiSpbmc?si=AtdmdalfFidWOJYq

nutomic,
@nutomic@lemmy.ml avatar

Yes Bevy has a big advantage because its a library, so everyone who uses it is a developer and is able to fix minor issues. In case of Lemmy only a small fraction of users are developers, and even less know Rust. I watched the video, but its not easy to take concrete suggestions and apply them to Lemmy. Maybe the community reviews for PRs would be a good idea to get people familiar with the codebase. It also mentions using a project board so we should consider that. Though Im not sure how to select issues for each milestone because again, everything is up for grabs.

AtmaJnana,

even less know Rust.

Hmm. If only there were a way the developers who already know another popular language could contribute to help the community. I suppose someone could make a Lemmy -compatible server in another, more popular language. Nah, that’s crazy talk.

nutomic,
@nutomic@lemmy.ml avatar

Or these people could learn Rust and contribute to the existing project. That would save years of duplicated effort. I personally knew zero Rust before starting to contribute to Lemmy, its really not that hard to learn.

ChasingEnigma, (edited )

Here are some suggestions for how to encourage more outside contributions:

  • Create an ARCHITECTURE.md document explaining the overall architecture and different components of Lemmy. This would help new contributors quickly familiarize themselves with the codebase.
  • Publish a public roadmap with milestones and release plans. This gets people excited about the project’s direction and motivates them to contribute.
  • Nightly builds enable contributors to test upcoming changes, offer feedback, stay actively involved in the project’s progress, iterate quickly on improvements, and foster a culture of continuous improvement.
  • Implement a bounty system for critical or challenging issues to incentivize contributions. Some people who don’t want to contribute with a monthly subscription may prefer this kind of contribution.
  • Create project swag (stickers, t-shirts, etc.) and distribute it to active contributors as a token of appreciation.
  • Institute a “Lemmy contributor mentorship or apprenticeship” program where experienced developers formally take up 1-2 promising new contributors under their wing. This would be modeled after the Sith/Jedi master-apprentice relationship where knowledge and skills are passed down. Later when the apprentice has managed to develop a few issues by themselves they can take some apprentices.
    The concept of more experienced contributors working with newcomers to develop features in a FOSS (Free and Open Source Software) project is commonly referred to as “mentorship” or “pair programming.” In pair programming, two programmers work together at one workstation, with one writing code while the other reviews each line of code as it is typed in. The roles can switch frequently, and this method is known to enhance knowledge sharing, code quality, and team bonding. Beyond pair programming, establish a structured mentorship program where experienced contributors can mentor newcomers on a one-on-one basis.
  • Live or recorded screencasts solving issues, similar to mentorships but instead of one-on-one it allows more people to feel engaged in the development process, and provide feedback in the case of live streams.
  • Host discussions about issues on Lemmy itself, as suggested in the blog post below. The voting and threads with nested comments make it easier to have productive conversations compared to GitHub. The community is here so you’ll get more contributions right away in the form of ideas and feedback.
    Update from Lemmy after the Reddit blackoutspoiler> At the moment we are urgently working to solve major issues, such as optimizing slow database queries, ripping out the inefficient websocket API, and fixing a major security vulnerability (big thanks to deadcade). In addition we suddenly have to manage dozens of pull requests. To give us time to work on these priorities, it would be very beneficial if users could refrain from interacting with issue trackers when possible. Before opening an issue, make sure that it hasn’t been reported before. And when writing comments, make sure that they actually contribute to solving the issue at hand. Generally it is better to move discussions to Lemmy if possible. We are very thankful to everyone who contributes by writing code, hosting instances, moderating communities, and answering questions. > > At the same time, we are seeing lots of requests to implement major new features, such as migration between instances, or combining similar communities. As described above, we are completely overloaded with work, and definitely won’t have time to implement these in the near future. If there is a feature you want to see implemented, you will likely need to work on it yourself, or find someone who can.

Of course you have more experience working on a big project so take this with a grain of salt.

nutomic,
@nutomic@lemmy.ml avatar

Thanks for the suggestions!

Create an ARCHITECTURE.md document explaining the overall architecture and different components of Lemmy. This would help new contributors quickly familiarize themselves with the codebase.

The documentation has some info about the architecture as well as how to start contributing. Is there anything particular missing, or do people not find these docs?

Publish a public roadmap with milestones and release plans. This gets people excited about the project’s direction and motivates them to contribute.

As mentioned in the other comment, we will have a public roadmap once the NLnet milestones are finalized. Other than that the issues are up for grabs for anyone, so Im not sure what sense it would make to give them priorities.

Nightly builds enable contributors to test upcoming changes, offer feedback, stay actively involved in the project’s progress, iterate quickly on improvements, and foster a culture of continuous improvement.

These are available as :dev Docker images, and deployed to test servers at enterprise.lemmy.ml etc. Maybe this should be documented somewhere to let people know?

Implement a bounty system for critical or challenging issues to incentivize contributions. Some people who don’t want to contribute with a monthly subscription may prefer this kind of contribution.

Bounty systems dont work well in my experience. Usually the reward is too low to pay an actual dev salary, and then its still a hassle to get the money into your bank account. Plus there is no gurantee to get paid for your work, its always possible that someone else submits a solution just before you finish yours.

Create project swag (stickers, t-shirts, etc.) and distribute it to active contributors as a token of appreciation.

Good idea, though we dont really have the funds to pay for that. It was also suggested to sell swag to earn money for Lemmy, but havent gotten around to that yet. Do you by chance any good company to produce and sell this?

Institute a “Lemmy contributor mentorship or apprenticeship” program where experienced developers formally take up 1-2 promising new contributors under their wing.

Well if anyone opens a pull request we give feedback as part of the review process. And if anyone has questions we also answer them in the issue tracker or on Matrix. But in practice there seems to be little demand in this regard.

Live or recorded screencasts solving issues, similar to mentorships but instead of one-on-one it allows more people to feel engaged in the development process, and provide feedback in the case of live streams.

That seems to get more into entertainment, not what we want to do.

Host discussions about issues on Lemmy itself, as suggested in the blog post below. The voting and threads with nested comments make it easier to have productive conversations compared to GitHub. The community is here so you’ll get more contributions right away in the form of ideas and feedback.

We do have biweekly dev updates which are somewhat related. But discussing individual issues here would likely duplicate discussions from Github issues.

SorteKanin,
@SorteKanin@feddit.dk avatar

The documentation has some info about the architecture as well as how to start contributing. Is there anything particular missing, or do people not find these docs?

That is a very short description. It doesn’t really go into details of critical modules, how things are built and setup, what important libraries are used etc. I would expect such docs to be longer and more detailed to make it easier to get an introduction to the code. I would expect each repository to have its own detailed ARCHITECTURE.md - the Lemmy backend is much too large to describe in just a few sentences.

And yea producing and maintaining that kind of documentation isn’t “glorious” work and probably not particularly fun either - but I do think it’s a good way to spend your time, and the people donating do want you to spend your time on the highest impact possible obviously.

Well if anyone opens a pull request we give feedback as part of the review process. And if anyone has questions we also answer them in the issue tracker or on Matrix. But in practice there seems to be little demand in this regard.

I don’t think just waiting for contributors to pop up is going to work. You’re right, there is little demand - or more likely, people don’t know where to start or what to do. My suggestion would be to actively advertise a mentorship that people can sign up for and then choose someone from the lot of applicants. Actually dedicate hours to train and mentor the new contributor to be familiar with the code base. Being passive in this case won’t attract anyone - you need to be proactive. (that is my 2 cents at least)

SorteKanin,
@SorteKanin@feddit.dk avatar

Would you mind asking what exactly they mean by “toxic development community”? Its honestly the first time I heard something like this about Lemmy.

Okay so I wasn’t sure before but I think this issue might be a good example: github.com/LemmyNet/lemmy/issues/4433

Yours and dessalines comments all come across as defensive or dismissive. The comments make it sound like you are more interested in dismissing the bug than actually acknowledging it.

This is definitely not a way to approach a bug report. You need to be much more understanding of bug reports (especially ones as serious as this one) and display a willingness to fix things, and follow through with it.

I don’t think Lemmy will work out in the long term if this kind of attitude continues.

ChasingEnigma,

Love the milestones it’s what I think Lemmy is missing most that makes me excited about other projects.

Fal,
@Fal@yiffit.net avatar

Imagine choosing to write something in java versus rust. Amazing

Ptsf,

deleted_by_author

  • Loading...
  • Rooki,
    @Rooki@lemmy.world avatar

    Its more easier than to write it in a language not made for a RestAPI.

    SorteKanin, (edited )
    @SorteKanin@feddit.dk avatar

    There are plenty of very nice Rust web frameworks, like axum and actix-web (which lemmy uses). They are very ergonomic. Rust is perfectly fine for REST APIs. It’s not like Java was made expressly for the purpose of REST APIs either.

    magic_lobster_party,

    Writing backends in Java is super common. Rust for backend is almost unheard of (yet).

    Or that other language do you propose?

    Ptsf,

    Common is the enemy of correct. As for other languages, feel free to use anything memory safe! At least, that’s what I’ll be doing when exposing my overpowered calculator to 7+ billion humans.

    otter,

    I asked about that earlier today, and this is the explanation

    It’s in Java, so there’s that overhead. But mostly, it’s less about “efficiency at all costs” and more about maintainability, being easier to contribute to / review, and having a less toxic development community. It’s got more developers working on it than Lemmy, and it’s in a language more people are familiar with (Java). It’s roadmap is also not constrained by the viewpoints of a small group of fairly, uh, controversial figures.

    After the 1:1 compatibility phase is over, they’re both free to and planning to implement more features that the Lemmy devs either won’t or can’t be arsed to do.

    The comment: lemmy.ca/comment/7677015

    Fal,
    @Fal@yiffit.net avatar

    Rust is way easier to read than java in many cases. Terrible argument.

    Bjornir,

    There are probably a hundred time more Java developers than rust developers. I think that is the whole point of choosing Java.

    Rooki,
    @Rooki@lemmy.world avatar

    Correct.

    Rooki,
    @Rooki@lemmy.world avatar

    Rust is terrible to read. Java is easy if you name your functions and variables correct.

    SorteKanin,
    @SorteKanin@feddit.dk avatar

    This is a very subjective take. I think Rust is much easier to read than Java. It’s really just a matter of what you’re used to (and that can easily change by just learning the other language).

    Rooki,
    @Rooki@lemmy.world avatar

    Yes like you said, everybody understands their favorite language better than others.

    SorteKanin, (edited )
    @SorteKanin@feddit.dk avatar

    I can understand the argument about more developers knowing Java (right now) and the controversy of the current main lemmy devs.

    However for maintainability, I really don’t see it. Java has the billion dollar mistake with null references, forces you into an object oriented programming style and uses exception-based error handling, which is far inferior to errors as sum types like in Rust.

    Often when Rust compiles, it works. This is a big strength when maintaining a large system. You can’t say the same about Java.

    Lastly, Java doesn’t seem… Future-proof if you can call it that. It’s certainly an older language and it’s not likely to keep getting bigger. Rust is still growing a lot and is being adopted extremely heavily by the largest technology companies. It’s not unreasonable to think that there will at some point be more Rust devs than Java devs. Though that day could still be a long way off, to be fair.

    Carighan,
    @Carighan@lemmy.world avatar

    However for maintainability, I really don’t see it. Java has the billion dollar mistake with null references, forces you into an object oriented programming style and uses exception-based error handling, which is far inferior to errors as sum types like in Rust.

    None of these are a problem to experienced Java developers however, of which there is a huge ocean. Compared to a relatively tiny handful of Rust developers that also can get very highly paid industry jobs that keep them busy, so there’s even less of them available for hobby projects.

    I can totally see it. Makes perfect sense in fact, you want people to help with development, you cast the widest net possible.

    Fal,
    @Fal@yiffit.net avatar

    None of these are a problem to experienced Java developers however

    You’re kidding, right?

    Rooki,
    @Rooki@lemmy.world avatar

    That is true, if you develop your java application correct, then you have no issues of any kind.

    SorteKanin, (edited )
    @SorteKanin@feddit.dk avatar

    if you develop your java application correct, then you have no issues of any kind.

    No issues of any kind? That’s absurd. The idea that you can “just” write “correct” code in any language and then you won’t have “any issues of any kind” is not any developer’s experience ever. Humans are just not reliable enough for that.

    Rooki,
    @Rooki@lemmy.world avatar

    Yeah because of that i said IF you develop your java application correct…

    If that is correct, than you have no issues of any kind. That statement is correct. But like you said, no one is perfect, but rust would be a more difficult language than java and less documented. For a stable, predictable and reliable software your programming language needs maturity, stability and a community to support it. Most of it rust doesnt have.

    SorteKanin, (edited )
    @SorteKanin@feddit.dk avatar

    Okay but if you develop your Rust application correctly, then it’s obviously also correct. It doesn’t matter what language you use then.

    rust would be a more difficult language than java and less documented

    That is just like, your opinion, man. I disagree. I’d rather not have null references and exception-handling if I was going for stability. Rust also has very nice documentation.

    your programming language needs maturity, stability and a community to support it. Most of it rust doesnt have.

    Okay, Rust is not as old as Java. This is true. But at this point, you cannot say that Rust is immature, unstable or doesn’t have a community.

    The community online is huge, bigger than most other communities. If you want a number, see for instance the number of active users on /r/rust versus /r/java. I checked it now and it was 1096 versus 195. Nobody is hyped about Java any more, it’s an old language that many people don’t like. Check also for instance how many people like Java or Rust in the StackOverflow developer survey. ~87% of Rust users love using Rust while only ~46% of Java users love using Java - that means that there are more Java devs that would rather not use Java than Java devs who want to use Java!

    Rust has very strong backwards-compatibility guarantees (just like Java). It’s very stable and things mostly “just work” if it compiles (unlike Java).

    I would call Rust much more reliable than Java, and I think most people who have tried both would agree. Exception-based error handling just makes it notoriously difficult to cover all error cases.

    Anyways m8, unless this somehow sways you I think we need to just agree to disagree. I would encourage you to actually try the language and see for yourself and see what I mean though.

    The_wild_card, (edited )

    That is just like, your opinion, man. I disagree.

    The dude ?

    natecox,
    @natecox@programming.dev avatar

    If you just never make any mistakes you’ll live a mistake free life.

    magic_lobster_party,

    It’s more that you can avoid many mistakes by programming defensively and having good discipline. For example, you can avoid many memory allocation if you follow RAII and use smart pointers.

    Null references can be avoided by avoiding using null (and prefer using optional where it makes sense).

    asdfasdfasdf,

    “Having a car with no seatbelt is not a problem if you’re a good driver”

    LMAO

    SorteKanin,
    @SorteKanin@feddit.dk avatar

    Well time will tell. As far as I can see on github.com/sublinks/sublinks-api/…/contributors it really doesn’t look like more than two active developers right now… So not any better than Lemmy.

    Also, when it comes to hosting stuff as volunteers, server costs are actually quite important, as its basically 100% of the expenses. So Rust’s efficiency is actually a more significant advantage than you may think.

    mac,
    @mac@programming.dev avatar

    Theres more than just the api repo and pull requests are squashed in some of them making it show as less

    SorteKanin,
    @SorteKanin@feddit.dk avatar

    I mean, the same is true for Lemmy.

    Rooki,
    @Rooki@lemmy.world avatar

    Java is already mature enough and i dont think the current smaller-medium instances experience that lemmy is on 100% cpu allways, so we can expect that it is a bit less optimal, but not before 5% cpu and after it 100% cpu, lemmy is a mess in performance, 0.18 instances gets ddosed by dead 0.19 instances, that retry always failed federation. So lemmy itself is the danger here.

    SorteKanin,
    @SorteKanin@feddit.dk avatar

    When it comes to servers, memory is often the pricy point. And Java is a lot more memory-hungry than Rust.

    Rooki,
    @Rooki@lemmy.world avatar

    Good, then find some guys to develop lemmy faster, reliably and bigger. With lemmys pace of features, it will be taken over by faster developing platforms, where they can have more and more features ready and deployed where the lemmy devs still wait until they get enough donation to implement any crucial feature.

    Sublinks decision was based on: How fast and reliably can they build a lemmy backend replacement, java is the only possible option there. There are many devs, Language is mature, reliable and not a hipster language like rust.

    Of course if they did that in rust they would be same level, but then would be the question why not contributing to lemmy directly.

    If performance and memore is so dramatically NASA rocket computer limited, than why not use assembly. Its the fastest, memory efficient and speaks directly to the computer.

    SorteKanin,
    @SorteKanin@feddit.dk avatar

    it will be taken over by faster developing platforms

    Well, we’ve yet to see that. But I mean if it does then… great? I just don’t believe it will right now. I don’t think just switching the programming language will have such a large effect as you expect.

    hipster language like rust

    You really can’t call something hipster when it is being adopted by the largest technology companies in the world and is even being used in the Linux kernel. That’s not what hipster means.

    If performance and memore is so dramatically NASA rocket computer limited, than why not use assembly. Its the fastest, memory efficient and speaks directly to the computer.

    I didn’t say it was “NASA rocket computer limited”, I just said memory matters for price. And it does. This reads to me like you are frustrated and it comes across as a bit snarky and sarcastic. If we are actually to talk about programming language pros and cons, then at least let’s talk about it genuinely.

    stevecrox,

    Every programming languages has communities built around them.

    Its becoming clear Rust solves a lot of C/C++ type problems and the embedded communities are definitely shifting over.

    Apache is the primary community for Java, a quick look at their project list shows it's entirely web servers, data engineering and clustered projects for distributed computing.

    Personally if you asked me to solve this problem I would use Spring Boot with various Spring libraries for talking to the caddy, user control, etc... Looking at the project, its exactly what they have done

    asdfasdfasdf, (edited )

    Rust is a general purpose language which is excellent for API servers and many other things. I’d say it’s definitely a direct competitor to Java. The only difference is in the ecosystem of libraries.

    Rust’s type system is really just about enforcing correctness, which is very important in a general sense. Memory safety is just a subset of correctness.

    You can see this is in practice since there are a TON of devs like myself coming to Rust from JavaScript.

    magic_lobster_party,

    As you said, the difference is in the ecosystem of libraries. This is where Java has the edge. It has a more mature ecosystem when it comes to web server backends. This includes the number of frameworks, programmers and information sources.

    Unless Rust clearly solves common problems people currently have with Java backends, Java will remain the dominant alternative. I believe this is unlikely, because Rust is mainly designed to overcome common memory problems people have with low level C systems without the overhead of garbage collectors.

    asdfasdfasdf, (edited )

    Rust is mainly designed to overcome common memory problems people have with low level C systems without the overhead of garbage collectors

    So you didn’t read my comment then.

    A concrete example of what my comment means is opening files. When you open a file handle, you can read from it, write to it, but then you should close it. After you close it you shouldn’t be ready to or write from it again. If you do, bad things can happen.

    Rust is the only language where you cannot. It’s a compile time error. This has nothing to do with low level systems programming. Using file handles is very high level.

    Same goes for thread safety. Web servers often can benefit from multithreading. Java does not enforce thread safety at compile time. If you send some data across threads and you don’t already understand what is thread safe and what isn’t, you’ll end up with data races, which is a form of memory safety violation. This is not possible in Rust, but it is in Java.

    Rust also isn’t subject to “the billion dollar mistake” since it doesn’t have the concept of null references. It also doesn’t support exceptions, which are the exact same issue as null references. These are also general programming problems and not specific to low level systems.

    Regarding frameworks, I’ve used Spring before and, although Rust doesn’t do some things Java frameworks do, IMO that’s a very good thing, and the web frameworks I’ve used in Rust have been a far better experience than what I saw from Spring.

    expr,

    Rust does a lot more than that. It has a far more powerful, flexible, and higher-level type system than Java all while being much more performant.

    Every single time I’ve heard people cite Java’s ecosystem, I’ve yet to see them using anything that Rust doesn’t have a better alternative to. Java’s ecosystem is massive, but most of the time, you don’t actually need it. Unless you are doing a lot of third party integrations that have Java sdks or something, there’s not a lot it buys you. If you’re just making typical web applications with a database, Rust has you completely covered and will do a better job of it to boot.

    Rooki, (edited )
    @Rooki@lemmy.world avatar

    It will have its own UI too, but sublinks will aim to support the lemmy apps.

    You can track the progress here: github.com/orgs/sublinks/projects/1/views/1

  • All
  • Subscribed
  • Moderated
  • Favorites
  • til@lemmy.world
  • DreamBathrooms
  • thenastyranch
  • mdbf
  • Durango
  • Youngstown
  • slotface
  • hgfsjryuu7
  • vwfavf
  • rosin
  • kavyap
  • osvaldo12
  • PowerRangers
  • InstantRegret
  • magazineikmin
  • normalnudes
  • khanakhh
  • GTA5RPClips
  • ethstaker
  • cubers
  • ngwrru68w68
  • tacticalgear
  • everett
  • tester
  • Leos
  • cisconetworking
  • modclub
  • anitta
  • provamag3
  • All magazines