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.
Forget the backend! I just want the frontend not to crap itself whenever it can’t fetch the site icon!
Mine had accumulated 420MB of cookie data the other day. Had to clear it before I could log in. I thought the instance was dead.
No kidding. I’m an Ops guy and I’ve hosted hundreds of web applications professionally and for fun over the years but Lemmy has been one of the more frustrating and brittle experiences I’ve had.
I’ve figured out a few of the quirks by now but I definitely spent a whole afternoon troubleshooting why the front end wouldn’t load at all only to discover the real issue was with Pict-rs.
A new front-end is coming too. We need a new front-end to support all the new features we’re adding.
Have you tried any of the web client alternatives (“Web” filter): https://lemmyapps.netlify.app/ ?
Yeah, I run Photon on base domain because I couldn’t count on lemmy-ui.
The Photon developer is assisting with the development of the new front-end :)
That’s good news. Hopefully they’ll get let you change your avatar in that new UI because that’s one of the weirdly missing Photon features.
We have our own engineers working on it with him along with the developer of pangora. It’s a full collaborative effort to make the best we can.
with the developer of pangora
It’s like the Avengers are gathering
an alternative Java-based backend
kill it with fire
Next step, is to remake Lemmy in JavaScript. Pure JavaScript, no typescript, only express, nothing else
rewrite it in perl with a flat file database.
an alternative Java-based backend to Lemmy’s Rust-based one
Going from a modern well-designed language to an old-and-busted, kitschy, memory-hogging, bloated language. This is literally a step backwards.
Rust, Go… hell, even Ruby-on-Rails or whatever Python is offering nowadays would be a better choice.
I’m a long time Java developer who was recently moved to a project written in Go. All I can say is: What. The. Fuck. I swear, the people who designed the syntax must have been trying to make every wrong decision possible on purpose as a joke. The only think I can think of is that they only made design decisions on the syntax while high on shrooms or something.
Like, why in the actual fuck does the capitalization of a function change the scope??? Who thought that was a good idea? It’s not intuitive AT ALL. Just have a public/private keyword.
Nah, Java is alright. All the old complicated “enterprise” community and frameworks gave it a bad reputation. It was designed to be an easier, less bloated C++ (in terms of features/programming paradigms). It’s also executed fairly efficiently. Last time I checked, the same program written in C would typically take 2x the time to complete in Java; whereas it would take 200x the time to complete in Python. Here’s some recent benchmarks: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python3-java.html
I haven’t had a chance to try Rust yet, but want to. Interestingly, Rust scores poorly on source-code complexity: https://benchmarksgame-team.pages.debian.net/benchmarksgame/how-programs-are-measured.html#source-code
Modern Java isn’t that bad, and with new developments like the graalvm and cloud native builds, or what they are called, the footprint of a modern Java app can be comparable to an golang app.
Modern Java kinda has the same image problem as modern PHP. Not saying is all great, but it sure has seen quite the improvements in the last years
they are also working to make developers have less boiler plate. java might be an old language but the development has not stopped but only going better these days.
Or C#, it’s literally “Java, but good”.
The only time I would choose Java for a new project is if I had a hard dependency on something that only works with Java…
Or Kotlin, which is much more “Java but good” as it even runs on the JVM
Yeah, but then you still have an Oracle dependency in your stack 🤮
You can switch to Kotlin Native, which depends on C libraries, or Kotlin JS, which depends on whatever libraries your JS runner has. No matter whatever Oracle has done, they produce a pretty good library, API spec and OpenJDK.
Seems like here the number of developers comfortable in Java is a dependency
I understand that being a problem for Rust, but not for many of the other “better than Java” languages on this list. Like, I dunno…C#?
https://madnight.github.io/githut/#/pull_requests/2023/4
3.4% vs 11.7%
I think C# is probably more popular than it advertises here, but not on GitHub.
What missing features are so important that you decide to recreate the entire backend of Lemmy because you think the devs aren’t fast enough?
Lemmy doesn’t have to have missing features for someone to want to write their own implementation. And in a decentralized system you want multiple implementations to exist. This is a good thing
Java instead of Rust is going to be a big thing for a lot of people who would like to contribute in their spare time. Yeah, Rust is cool, but every CS grad and their mother knows Java.
Back during the migration surge a few months ago, you commonly saw a LOT of comments from folks saying they would love to help eat away at the project’s backlog, but they just didn’t have the time or energy to learn Rust at the moment.
I think rust is a very pragmatic choice, lemmy is decentralized, the security benefits are a necessity when it comes to self hosters donating hardware
Java is also memory safe
Ah yes, that explains the log4j fiasco
That wasn’t a memory safety issue, that was a what the fuck were you thinking design issue. It would have been batshit in any language
Good mod tools
This looks like the major driver of the project, IMO. The Sublinks roadmap is full of feature ideas geared toward better moderation, both at the community and instance level.
It seems to be more language focused than hard to PR against the main repo.
Java is much more widely known than Rust, which means a much larger pool of developers. I never contributed to the original Lemmy server because I couldn’t wrap my head around a full production scale rust project. I’ll very likely contribute to this because I work with production Java code daily. Im sure I’m not the only other dev who has run into this.
Also maybe there’s just too many disagreements with the Lemmy owners, who are a bit extreme for a lot of people.
I have a hard time believing that rewriting the backend from scratch would be faster than getting PRs approved on the main project.
Forks like this with one guy who “knows best” usually die a slow quiet death as they get left behind by the main project.
I think how quickly this project has gotten to near feature parity is a testament to how slow Lemmy development has been. Think about scaled sort (a feature that has been hotly requested since the migration) and how long that took to get merged in. A sort should not by any means be slow to implement.
IMO slow development isn’t necessarily a bad thing.
I like that there was a two month period for apps to adopt the new login mechanism and that they smoke test releases for a fair bit on lemmy.ml before releasing to the world.
That said, a few months ago I wanted to do a light fork of Lemmy to proof out a few very minor things on my mental wishlist but just haven’t had the free time to meddle with Rust.
IMO slow development isn’t necessarily a bad thing.
Quite the opposite, often it’s a benefit as you don’t end up wasting time and changing code for features where you don’t actually know yet whether your current usage demands or supports them. There’s a lot of genefit in not moving fast and not breaking things. Mostly that, well, you don’t constantly break things.
IMO slow development isn’t necessarily a bad thing.
Sure but even just recently there was the example of breaking federation over Christmas. Some of those issues persist through 0.19.3 which came out today
Similarly scaled sort would have made a huge difference for small communities in the period directly after the migration.
Yeah, that was definitely annoying. I would’ve preferred to have some kind of official workaround but I figured something out that got me through until the updates.
I probably lean too hard into forgiveness on this stuff but I know a number of open source devs who have burned out for various reasons this past year and would much rather see slow development than risking a rush towards burnout.
A sort should not by any means be slow to implement.
Sure, if the sort key is something readily available. But for scaled sort they have to compute relative size/activity of the communities the specific user is in. The cost isn’t the sort, it’s computing the metric.
I’m not talking about the literal sorting algorithm. Pretty sure scaled sort is exactly one more operation than hot.
deleted by creator
I’m a Java developer and I would much rather pick up Rust to join an active project than try to rebuild something that already works using a less-marketable language.
Sure, but it’s a lot more work for you to get to a point where you can be an active contributor.
Is it really a lot of work for an experienced dev? I can pick up most new languages in a day or 2 unless it’s a total paradigm shift.
1-2 days is enough to learn the basics, but I doubt you’ll be as nearly as productive as with something you’ve been using for years. Keep in mind that new languages also mean new frameworks, etc, some which take years to actually master, but at least months to get a good handle on them.
Also, from my understanding, Rust is a bit of a paradigm shift.
Yeah but there’s a big difference between having “picked up” a new language and being on the level where you can viably add useful code to a distributed federated deployed platform.
I have 12 years in Java by now, I’m fairly confident with it. Rust, yeah no, not for production code.
Sure, anyone can pick up a new language or two over a weekend. That doesn’t mean they are confident enough to contribute to large scale programs with it. That takes much longer to learn.
I’ve been hearing a lot of good things for a while. Lookin forward to it.
Too bad it’s java
I love Java.
Browsing the code makes me angry at how bloated Java projects are:
package com.sublinks.sublinksapi.community.repositories; import com.sublinks.sublinksapi.community.dto.Community; import com.sublinks.sublinksapi.community.models.CommunitySearchCriteria; import com.sublinks.sublinksapi.post.dto.Post; import com.sublinks.sublinksapi.post.models.PostSearchCriteria; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import java.util.List; public interface CommunitySearchRepository { List<Community> allCommunitiesBySearchCriteria(CommunitySearchCriteria communitySearchCriteria); }
Every file is 8 directories deep, has 20 imports, and one SQL statement embedded in a string literal. 😭
Most IDEs will handle the imports for you and auto collapse them
Ignoring the problem doesn’t make it better
How would you do “better” imports then?
*Vaguely wave arms towards the few dozens languages that do imports right*
I don’t mind Java personally, but let’s not pretend that its import syntax and semantics is at the better side of the spectrum here.
Just look at… Go, Haskell, TypeScript, Rust, even D has a better module system.
And what’s bad about that? As in, how is the verbosity a negative thing exactly? More so because virtually any tool can be configured to default-collapse these things if for your specific workflow you don’t require the information.
At the same time, since everything is verbose, you can get very explicit information if you need it.
Here’s an example:
IMO that’s a lot of code (and a whole dedicated file) just to (magically) hook a global event and increase the subscriber count when a link object is added.
The worst part is that it’s all copy/pasted into a neighbouring file which does the reverse:
It’s not the end of the world or anything, I just think good code should surprise you with its simplicity. This surprises me with its complexity.
I see you woke up and chose violence.
I just self host and avoid Java like the plague due to how annoying it is to manage
3 billion devices can’t be wrong…
Not sure whether this implementation will be lighter on resources than what Lemmy currently uses. Given the overhead of the JVM though, it’s unlikely it will be supported by, say, a single Raspberry Pi
JVM doesn’t have much overhead. Java 1.3 days are long gone.
So while there’s plenty of talk in here (even from the core lemmy devs) about how much it makes sense and how much value there is in starting a new project with a different tech stack that includes Java, compared to simply contributing back to the current project that has momentum … and while that’s an interesting and important conversation …
Realistically, developers will make what they want to with what they want to (to a fault IMO, especially within the broader mission of the fediverse, but that’s besides the point). This project will happen, people will contribute and it may succeed.
So, to focus on the positives and what can be made good about this …
It’s great that there’s some sort of settling on a standard here and trying to be a “drop in replacement”. Continued commitments to consistency and interoperability would be awesome. While collaboration may be naturally limited, there’d still definitely be scope for it …
- ideas and designs, obviously
- Database management and optimisation, which is likely a big one.
- On that … AFAICT, SL is using MySQL? Can’t help but wonder (without knowing the technical justifications here) whether it would make much more sense to stick with the same DB unless there’s a good reason for divergence.
- Front ends and the API, another big one but one where the two projects could conceivably work together.
I’m likely being very naive here, but I can see both projects coming under a single umbrella or compact which provide different backends and maybe DB setups or schemas but otherwise share a good amount in design and mission.
However unlikely that is … trying not to fragment the fediverse too much would be awesome and its pleasant to see some dedication here to that end.
whether it would make much more sense to stick with the same DB unless there’s a good reason for divergence.
SL Dev said they reengineered the database schema and didn’t want to use the Lemmy one. Based on the summer performance issues, I guess it makes sense.
However unlikely that is … trying not to fragment the fediverse too much would be awesome and its pleasant to see some dedication here to that end.
At the end of the day, it’s still Activitypub. The compatibility between Lemmy and Kbin works pretty well, most of the issues we had were federation related, and those existed within Lemmy itself.
Well there’s still the question of using MySQL (?) rather than postgresql, where all manner of expertise about the DB can be useful to share. Not sure what kbin uses, but pgsql is pretty common around the fediverse.
And yea, it is all ActivityPub. I’m just not as faithful in that as others tend to be. It seems to be a fuzzy system that allows idiosyncrasies to creep in. Mastodon and Lemmy don’t get along too well and so sometimes AP just isn’t enough (I’ve just been trying to help someone whose masto instance seems not able to post to lemmy). At this moment, getting along is valuable for the platforms, for the fediverse and for us users.
I guess my username won’t make sense anymore. But it sounds so good that it doesn’t need to make sense.
That’s okay, no one thinks my username makes sense when it absolutely does.
a missed opportunity to name it Jemmy
I’m just here for the joke
EDIT: sentence structure
I like this, I will contribute to this, I think a lot of Java haters in this thread fail to realize just how massive Java is compared to everything else.
Rust might be the latest, hottest, bestest Java killer out there and it might be a completely superior language to Java, doesn’t matter, it’s dwarfed in terms of how many people actually use it for real projects, projects that should run for years and years. Even if Rust is the true Java killer, it’s gonna take a good few more years for it to kill java, measured in decades, there is just way too many projects and critical stuff out there that is running on Java, that means lots of jobs out there for java, still and still more.
This means there are a lot of senior Java programmers out there with lots of years of experience to contribute to this project.
Plus Lemmy itself having alternatives and choices is just a good thing.
Agreed. I mean COBOL is still a thing, and that’s a language that’s been dead for 30+ years.
I am not a fan of Java. However, I think that you are 100% correct. This is a potentially very useful stack to have available and I hope that the two projects track together well.
This project has potential for high velocity development that Lemmy will never be able to match, purely because of the languages. Rust is, factually, slower to develop in than Java, even for experienced devs. Add to that the greater population that is comfortable with Java, and you have a recipe for really pushing interesting things and innovating quickly. Possibly establishing a relationship somewhat like Debian Sid to Debian Stable. It could also be interesting to have some low-level, Rust modules that are shared between the two when Lemmy gets to 1.0 (API stability), if there is something that is more optimally implemented in Rust but that would introduce more coupling.
Rust is as much of a Java killer as C++ is. You could say Rust is the C++ killer, but I really don’t see how Rust would be that comparable to Java, which operates at a higher level instead of memory and pointer management. IMO, Kotlin is the Java killer.
Thank you for your perspective
I can’t find the fucking porn on Lemmy, so maybe this is a good thing.
Lemmynsfw
Don’t thank us.
deleted by creator
There’s a library for JS: https://join-lemmy.org/api/index.html
[This comment has been deleted by an automated system]
Same. When making pythorhead, I had to dig into the rust code to understand things.
There’s a user made OpenAPI spec: https://github.com/MV-GH/lemmy_openapi_spec - You probably mean that one
I’ve had similar issues as you mentioned that the dev did fix - but yea, Typescript has less precision than Rust (the source) or the openapi spec. And the Typescript client is build for Lemmy-JS and not build an example for other language client libraries…
Though the OpenAPI Documents in C# and Java are based on reflection of the source itself, and Rust doesn’t have Reflection like that… So it’s probably difficult for them to add without manually maintaining the OpenAPI specs
Based on all the other threads and cross posts it just seems like this software is being created because Jason Grim doesn’t like the lemmy devs or their politics. I guess that’s as good of a reason to fork as any. I’m happy with the way lemmy is and how its being created so I have been doing monthly donations to them for its development.
It’s not a fork though. It’s a complete rewrite in another programming language. That’s way more effort than a petty project.
The truth is, this might succeed based on developer reach. I love Rust, but I know it won’t have the reach (yet) that Java can, and more developers mean faster progress.
In the end, between this, Lemmy or another project which may be a fork of either, the success will be due to efforts of everyone involve at every stage. This wouldn’t exist without Lemmy, and Lemmy wouldn’t exist with ActivityPub.
I’m not sure I believe “faster” progress really means anything when two communists are creating a hobby software that isn’t really for business or necessarily targeting growth at all costs.
This is not hobby software, this is public good software. They are paid in large part by grants
Competition is good. We need to take the web back
There used to be hookers, and blackjack. In fact just bring back the 80’s