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
Sublinks
A decentralized, censorship-resistant, and privacy-preserving social network.
- Join Sublinks
- Demo Sublinks
- Documentation
- Matrix Chat
- Report Bug
- Request Feature
- Releases
- Code of Conduct
- Contributing
- Style Guide
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
, andCommunity
.
- 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.
Imagine choosing to write something in java versus rust. Amazing
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
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.
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.
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.
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.
I asked about that earlier today, and this is the explanation
The comment: https://lemmy.ca/comment/7677015
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.
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.
You’re kidding, right?
That is true, if you develop your java application correct, then you have no issues of any kind.
If you just never make any mistakes you’ll live a mistake free life.
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).
“Having a car with no seatbelt is not a problem if you’re a good driver”
LMAO
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.
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.
Okay but if you develop your Rust application correctly, then it’s obviously also correct. It doesn’t matter what language you use then.
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.
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.
Well time will tell. As far as I can see on https://github.com/sublinks/sublinks-api/graphs/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.
Theres more than just the api repo and pull requests are squashed in some of them making it show as less
I mean, the same is true for Lemmy.
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.
When it comes to servers, memory is often the pricy point. And Java is a lot more memory-hungry than Rust.
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.
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.
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.
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.
deleted by creator
Rust is way easier to read than java in many cases. Terrible argument.
There are probably a hundred time more Java developers than rust developers. I think that is the whole point of choosing Java.
Correct.
Rust is terrible to read. Java is easy if you name your functions and variables correct.
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).
Yes like you said, everybody understands their favorite language better than others.
deleted by creator
Writing backends in Java is super common. Rust for backend is almost unheard of (yet).
Or that other language do you propose?
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.
Its more easier than to write it in a language not made for a RestAPI.
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.