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.

        • Derin@lemmy.beru.co
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 months ago

          What’s annoying about it? Deploying a war to tomcat is one of the easiest things one can do.

          • twistypencil@lemmy.world
            link
            fedilink
            English
            arrow-up
            9
            arrow-down
            2
            ·
            7 months ago

            If you are a Java shop, and you do tomcat, then cool, maybe you’ve worked out the mysteries if Java deployment and managing resources (ahem, memory), and upgrades etc over the life cycle of a project. But most people doing deployment don’t want a one off Java app as a snowflake in their intra, if they can help it because it requires more buy into the ecosystem than you want

    • Corngood@lemmy.ml
      link
      fedilink
      English
      arrow-up
      63
      arrow-down
      10
      ·
      7 months ago

      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. 😭

      • MeanEYE@lemmy.world
        link
        fedilink
        English
        arrow-up
        35
        arrow-down
        3
        ·
        7 months ago

        Yup. Welcome to the world of Java where such things are not only silly but encouraged.

            • hansl@lemmy.world
              link
              fedilink
              English
              arrow-up
              10
              arrow-down
              2
              ·
              7 months ago

              *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.

              • Carighan Maconar@lemmy.world
                link
                fedilink
                English
                arrow-up
                4
                ·
                edit-2
                7 months ago

                Isn’t Go just the requivalent of only doing asterisk-imports in Java, just without (and fair enough, Java has 0 need to do that 😂) repeating the import-keyword?

                • hansl@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  4
                  arrow-down
                  1
                  ·
                  7 months ago

                  There are multiple things in Go that make it better.

                  But just for giving a few thoughts about Java itself;

                  • being able to import a package and use it as a namespace would already go a long way
                  • being able to import multiple things from a package without listing separate line for each items
                  • not having to go from the root of the whole fucking world to import a package would be great
                  • having the ability to do relative imports to the module I’m writing would be great

                  These are like “module 101” things. Like, you’re right that the IDEs nowadays do most of that, but IDEs also get it wrong (“oh you meant a THAT package instead of that other one”) and reading the code without an IDE is still a thing (code reviews for example) which means the longer the import section (both vertically and horizontally) the harder it is to work with. And if you don’t look at all imports carefully you may miss a bug or a vulnerability.

                  Also, Java is the only language I know of that has such a span on the horizontal. The memes about needing a widescreen monitor for Java is actually not a joke; I never had to scroll horizontally in any other language. To me that’s just insanity.

                  Also, if you’re gonna make it the whole universe as the root of your package structure, we already have DNS and URI/URLs for that. Let me use that!

                  And don’t get me started as only-files-as-packages while simultaneously having maybe-you-have-multiple-root for your code… makes discovery of related files to the one you’re working with very hard. Then of course the over reliance on generated code generating imports that might or might not exist yet because you just cloned your project…

      • Carighan Maconar@lemmy.world
        link
        fedilink
        English
        arrow-up
        8
        arrow-down
        1
        ·
        7 months ago

        And what’s bad about that? As in, how is the verbosity a negative thing exactly? More so because virtually any tool can be configured to default-collapse these things if for your specific workflow you don’t require the information.

        At the same time, since everything is verbose, you can get very explicit information if you need it.

        • Corngood@lemmy.ml
          link
          fedilink
          English
          arrow-up
          16
          arrow-down
          1
          ·
          7 months ago

          Here’s an example:

          https://github.com/sublinks/sublinks-api/blob/main/src/main/java/com/sublinks/sublinksapi/community/listeners/CommunityLinkPersonCommunityCreatedListener.java

          IMO that’s a lot of code (and a whole dedicated file) just to (magically) hook a global event and increase the subscriber count when a link object is added.

          The worst part is that it’s all copy/pasted into a neighbouring file which does the reverse:

          https://github.com/sublinks/sublinks-api/blob/main/src/main/java/com/sublinks/sublinksapi/community/listeners/CommunityLinkPersonCommunityDeletedListener.java

          It’s not the end of the world or anything, I just think good code should surprise you with its simplicity. This surprises me with its complexity.

        • hansl@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          arrow-down
          1
          ·
          7 months ago

          how is the verbosity a negative thing exactly

          Fun fact, studies have found that the number of bugs in a program is proportional to the number of lines of codes, across languages. More lines of codes, more bugs, even for the same math and edge cases. So a more verbose language tends to have more bugs.

          • Carighan Maconar@lemmy.world
            link
            fedilink
            English
            arrow-up
            7
            ·
            7 months ago

            Interesting, but did this include web code and code only one person really ever works on?

            Because on the pure backend level, I have observed the reverse over my career. The shorter, the “smarter”, the “cooler” the code, the more buggy it is. Not based on the code itself, but based on the developer inevitably leaving the company at some point. Meaning that what matters all of is a sudden is how verbose, how documented and how explicit the code is, because the bugs come from someone else messing with it as they get to take it over. It’s a legacy problem in a lot of ways.

            Hence me saying that if solo projects are included, they probably tilt this massively as they’ll never really run into this problem. Like say, you just scan github or something. Of course most projects in there are solo, of course the more lines the more room for bugs.
            But in an environment where you’re not solo coding, the issue is not getting the code to run and having it have no programmed bugs, but to be able to have someone else understand what you did and wanted to do in a meaningful amount of time, especially as they have to mutate your code over years and decades. Or maybe it’s just that the bugs no longer are what “matters”, as fixing code bugs is cheap compared to the endless hours wasted from “clever” code being unmaintainable. 🤷

            • kameecoding@lemmy.world
              link
              fedilink
              English
              arrow-up
              4
              ·
              7 months ago

              I have a similar experience, in that anytime I heard someone hating on the verbosity of Java it was never the good devs the ones who can write a code that’s readable a few months later.

          • Rooki@lemmy.world
            link
            fedilink
            English
            arrow-up
            5
            arrow-down
            2
            ·
            7 months ago

            But you really dont see what the function wants or requires or returns ( except with typehints, but they dont work most of the time and then its not enforced in any way )

            • Derin@lemmy.beru.co
              link
              fedilink
              English
              arrow-up
              5
              ·
              7 months ago

              Larger, modern python projects always use type hints, for this specific reason.

              In the past you had PyDoc, which also scratched that itch.

              Barring that, contributing to a python project is very difficult without an IDE that performs type checks for you (which is unreliable).

              • Rooki@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                arrow-down
                1
                ·
                7 months ago

                Correct! As i already contributing to a big ass python project at work. We will rewrite a Big Project from python to c# in under 1 month.

                • Derin@lemmy.beru.co
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  7 months ago

                  Just you wait until your developers learn about the var keyword - it’s going to be Python 2.7 PTSD incidents all over again 😂

    • magic_lobster_party@kbin.social
      link
      fedilink
      arrow-up
      20
      arrow-down
      2
      ·
      edit-2
      7 months ago

      Who cares? If it works, it works.

      The biggest strength of Java is that many programmers has years or even decades of experience in it.

          • hansl@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            7 months ago

            PHP never went away. Wordpress, Mediawiki, Slack, Facebook, etc etc etc. IMO PHP is likely to have created the most wealth per line of code of all languages, including C (edit: since 2000). It’s completely under the radar.

        • remotelove@lemmy.ca
          link
          fedilink
          English
          arrow-up
          5
          arrow-down
          3
          ·
          7 months ago

          Same thing with COBOL! So many devs with … Wait. Are any COBOL devs even alive still?

          • Cosmic Cleric@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            1
            ·
            7 months ago

            Same thing with COBOL! So many devs with … Wait. Are any COBOL devs even alive still?

            I promise you one thing, those that are still alive are making bank right now.

            • Carighan Maconar@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              ·
              7 months ago

              Usually at banks, where they easily earn 2x+ of what I do working in Java. I happen to know one IRL, and their meetings with the boss are funny because it doesn’t really matter what number they put on the table, their boss cannot fire them. They could not replace them and they need 2+ COBOL devs in house.

              • Cosmic Cleric@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                arrow-down
                1
                ·
                7 months ago

                I happen to know one IRL, and their meetings with the boss are funny because it doesn’t really matter what number they put on the table, their boss cannot fire them. They could not replace them and they need 2+ COBOL devs in house.

                I can concur, I’ve seen the same thing in real life myself. Definitely a blast watching the employee have the power.

      • twistypencil@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        arrow-down
        2
        ·
        7 months ago

        I care, as someone who self hosts and have been doing so for 22 years. Java has always been the most annoying thing to maintain as a holster, especially on low resourced machines, like my raspi

        • Sentient Loom@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          14
          arrow-down
          3
          ·
          7 months ago

          Java is the first language I learned. I love how structured it is and how it forces you to work within the paradigm. I might never use it again, but it shaped how I think of programming.

          • BURN@lemmy.world
            link
            fedilink
            English
            arrow-up
            0
            arrow-down
            2
            ·
            7 months ago

            That’s why I like Java too. The fact that it’s so strict means I have to think about projects in a certain way and can’t just wing my way through it like Python.

  • deegeese@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    60
    arrow-down
    6
    ·
    7 months ago

    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.

    • spaduf@slrpnk.net
      link
      fedilink
      English
      arrow-up
      37
      arrow-down
      3
      ·
      7 months ago

      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.

        • spaduf@slrpnk.net
          link
          fedilink
          English
          arrow-up
          18
          arrow-down
          2
          ·
          edit-2
          7 months ago

          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.

        • Carighan Maconar@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          arrow-down
          2
          ·
          7 months ago

          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.

      • deegeese@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        6
        arrow-down
        2
        ·
        7 months ago

        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.

        • spaduf@slrpnk.net
          link
          fedilink
          English
          arrow-up
          5
          ·
          edit-2
          7 months ago

          I’m not talking about the literal sorting algorithm. Pretty sure scaled sort is exactly one more operation than hot.

      • deegeese@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        22
        arrow-down
        6
        ·
        7 months ago

        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.

        • sik0fewl@kbin.social
          link
          fedilink
          arrow-up
          10
          ·
          7 months ago

          Sure, but it’s a lot more work for you to get to a point where you can be an active contributor.

          • deegeese@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            4
            arrow-down
            7
            ·
            edit-2
            7 months ago

            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.

            • sik0fewl@kbin.social
              link
              fedilink
              arrow-up
              10
              ·
              7 months ago

              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.

            • magic_lobster_party@kbin.social
              link
              fedilink
              arrow-up
              1
              ·
              7 months ago

              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.

      • kaffiene@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        Yeah I agree. Rust is an excellent language when you absolutely must be as safe as possible but don’t want garbage collection. But there is a level of precision required of developers which makes it slower to development in. Other languages like Java, Python and Go are all quicker to develop in. Java is much easier to refactor IMO

    • MeanEYE@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 months ago

      Depends on amount of technical debt really. Sometimes rewrite is the only way. But in general fixing things can be done. It’s just matter of time, focus and effort.

  • bdonvr@thelemmy.club
    link
    fedilink
    English
    arrow-up
    47
    arrow-down
    2
    ·
    7 months ago

    What missing features are so important that you decide to recreate the entire backend of Lemmy because you think the devs aren’t fast enough?

    • Ghostalmedia@lemmy.world
      link
      fedilink
      English
      arrow-up
      33
      arrow-down
      3
      ·
      7 months ago

      Java instead of Rust is going to be a big thing for a lot of people who would like to contribute in their spare time. Yeah, Rust is cool, but every CS grad and their mother knows Java.

      Back during the migration surge a few months ago, you commonly saw a LOT of comments from folks saying they would love to help eat away at the project’s backlog, but they just didn’t have the time or energy to learn Rust at the moment.

      • Amaltheamannen@lemmy.ml
        link
        fedilink
        English
        arrow-up
        24
        arrow-down
        5
        ·
        7 months ago

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

        • Undaunted@feddit.de
          link
          fedilink
          English
          arrow-up
          10
          arrow-down
          3
          ·
          7 months ago

          I’m not saying that rewriting he backend is a good choice, but for me specifically, I’d like Lemmy to be written in Java. Why? I’m a Java software engineer for nearly 7 years now and I’d like to contribute. Yes, I could learn Rust, like I did learn Go, C, C++ and other languages during my cs studies. But I really don’t have the free time and motivation to do that after I already worked 8-10 hours at my computer. If I could use my existing Java knowledge to quickly fix some small bugs or whatever, I’d love to do that. But the hurdle to learn a new language (including other paradigms and best practices) just to contribute to this one project is just too high for me.

          • Spzi@lemm.ee
            link
            fedilink
            English
            arrow-up
            4
            arrow-down
            1
            ·
            7 months ago

            Exactly this. It’s often about finding the right balance between technically optimal, and socially feasible (lacking the right phrase here).

            The nerds brimming with technical expertise often neglect the second point.

            Oh - wow! I was about to complain about how https://join-lemmy.org/ is a shining bad example in this regard, talking about server stuff right away and hiding how Lemmy actually looks until page 3, but apparently they changed that and improved it drastically. Cool, good job!

            Anyways.

            For collaborative projects especially, it is important to strike a balance between tech and social aspects. Making poor tech choices will put people off. But making your project less accessible will also result in less people joining. It’s crucial to find a good balance here. For many coming from the tech side, this usually means making far more concessions to the social side than intuitively feels right.

          • Amaltheamannen@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            ·
            7 months ago

            Once you know a few languages and the principles for how a computer works moving to a new one is easy. Don’t think of it as being a “Java developer”, but a programmer. It’s just a tool.

            We did not learn languages at uni, but concepts. You use the same data structures and algorithms.

            I think you’d be surprised, try picking up rust for some advent of code challenges. If you know Java Streams and C/C++ lower level programming all that you’re missing is some pattern matching.

            • magic_lobster_party@kbin.social
              link
              fedilink
              arrow-up
              3
              ·
              7 months ago

              Anyone can quickly learn how to solve some code challenges in a new language.

              It’s a completely different story to learn how to write long lived enterprise scale programs that can grow with multiple independent contributors. This takes a lifetime to learn. More people have more experience to do it with Java.

        • Ghostalmedia@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 months ago

          If I were to guess, it’s not recent grads making those posts. I got the sense those comments were coming from people who had been around for a while. Folks who are now senior enough to be trapped in draining meetings all day, and have to manage a family a night.

          The work day and home life can get longer and more exhausting the further the older you get.

        • Dandroid@dandroid.app
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 months ago

          That feeling when you’re not a recent CS grad anymore 😭

          I never even heard of rust when I graduated in 2016.

      • P03 Locke@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        8
        arrow-down
        2
        ·
        7 months ago

        Yeah, Rust is cool, but every CS grad and their mother knows Java.

        Sure, twenty-five years ago, when Sun was pushing their language hard into colleges everywhere.

        Now? Sun Microsystems doesn’t even exist, and everybody hates the JVM in an ecosystem where VMWare, Docker, and Kubernetes do the whole “virtual machine” model much better.

        • uranibaba@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          7 months ago

          Can’t say I agree. It feels like an almost even 50/50 split between Java and C# when I look at job postings.

        • Cosmic Cleric@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          7 months ago

          Now? Sun Microsystems doesn’t even exist

          That was a long, long, long time ago.

          Java has continued to be very popular after Oracle purchased Sun Microsystems.

      • ComradeKhoumrag@infosec.pub
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        5
        ·
        7 months ago

        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

          • Dessalines@lemmy.ml
            link
            fedilink
            English
            arrow-up
            3
            arrow-down
            1
            ·
            7 months ago

            After working in java for over a decade, I will never use another garbage-collected language if I can avoid it again. I still have nightmares about debugging memory build-ups and having to trace down where to do manual garbage collection. I remember my shop eventually just paid for 32 GB ram servers, and java filled those up too.

            Rust doesn’t have these problems because its not a garbage collected language like java or go, and has an ownership-based memory model that’s easy to work with.

              • Dessalines@lemmy.ml
                link
                fedilink
                English
                arrow-up
                2
                arrow-down
                1
                ·
                7 months ago

                Garbage collection is by nature imperfect, its impossible for it to always be correct about when and what things to free up in memory. The best option is to not use a garbage collected language.

                • kaffiene@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  7 months ago

                  Wow. It’s amazing that anyone ever got anything to work in java. Must have never got used for anything

            • kaffiene@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              arrow-down
              1
              ·
              7 months ago

              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

      • SorteKanin@feddit.dk
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        Yeah, Rust is cool, but every CS grad and their mother knows Java.

        This is quite an outdated view I would say.

    • 0x1C3B00DA@kbin.social
      link
      fedilink
      arrow-up
      7
      ·
      7 months ago

      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

      • kersploosh@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        7 months ago

        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.

  • Kawawete@reddeet.com
    link
    fedilink
    English
    arrow-up
    50
    arrow-down
    7
    ·
    7 months ago

    Why Java though ? Like really ? It’s… Better than any other compiled language ?

    • loutr@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      41
      arrow-down
      5
      ·
      edit-2
      7 months ago

      Because modern Java is an OK language with a great ecosystem to quickly build web backends. And there are lots of java devs which means more potential contributors.

      • 0x1C3B00DA@kbin.social
        link
        fedilink
        arrow-up
        14
        ·
        7 months ago

        Exactly. It’s also using Spring Boot, Hibernate, and Lombok. It looks just like projects at work. It might be the first fediverse project I contribute regularly to.

        • BURN@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          7 months ago

          +1 same

          I tried to contribute to Lemmy, spent a few hours really confused by rust and gave up. I can meaningfully contribute to a Java/Spring project, not a rust one.

        • Fudoshin ️🏳️‍🌈@feddit.uk
          link
          fedilink
          English
          arrow-up
          9
          arrow-down
          9
          ·
          7 months ago

          Spring Boot, Hibernate, and Lombok

          Ah, yes. How about he kitchen sink and another 5000 dependencies to make Java bareable to code in? Actually lets skip Java cos it’s an over-engineered cluster-fuck that considers verbosity a virtue.

      • Fudoshin ️🏳️‍🌈@feddit.uk
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        7
        ·
        7 months ago

        Hello world in Java = 500 lines of code.

        Hello world in Rust = 3 lines of code.

        Java is over-engineered corporate bullshit used by banks and Android development. Nobody programs Java for the fun of it.

        • BURN@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          3
          ·
          7 months ago

          Hello World is < 10 lines in Java. Just say you don’t know the language and go away.

          Java runs the majority of corporate software out there, and it is very good at what it’s built for.

          I’ll take Java over Python/Rust any day of the week

    • kaffiene@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 months ago

      It’s probably got the best library/tooling ecosystem of any language out there. Certainly dwarfs Rust in that regard. Easier to find devs. Reasonably efficient thou not as much as Rust and typically less memory efficient. It’s a perfectly good suggestion for a project like Lemmy. I’d reach for Java or Go before Rust for a project like this but you know, that’s just me.

        • Rooki@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          arrow-down
          1
          ·
          7 months ago

          If you say the function should only recieve one argument and returns always boolean. It is predictable to only allow the wanted args and forces you to return a boolean.

          For example in a less predictable programming language e.g. Python: I can do all above but python does not stop anyone to put more or less arguments to a function, or a developer not adding typehints or not complying to them and return a string instead of a boolean.

          But i had it wrong rust is similar to java on that part.

          But still it is a lot more popular and easier to start with. So there will be a lot more contributor to sublinks than lemmy ever had.

          • mea_rah@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            7 months ago

            Well in that sense Rust is even more predictable than Java. In Java you can always get back exception that bubbled up the stack. Rust function would in that case return Result that you need to handle somehow before getting the value.

            • Rooki@lemmy.world
              link
              fedilink
              English
              arrow-up
              0
              arrow-down
              1
              ·
              7 months ago

              That i dont understand? How can it be a result that i need to handle? If its not correct than java will throw an error. ( As expected, shit in shit out )

              • kattenluik@feddit.nl
                link
                fedilink
                English
                arrow-up
                0
                ·
                edit-2
                7 months ago

                It’s a great and probably the best error system I’ve seen, instead of just throwing errors and having bulky try catch statements and such there’s just a result type.

                Say you have a function that returns a boolean in which something could error, the function would return a Result<bool, Error> and that’s it. Calling the function you can choose to do anything you want with that possible Error, including ignoring it or logging or anything you could want.

                It’s extremely simple.

                • uranibaba@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  0
                  ·
                  7 months ago

                  If I except a boolean, there is an error and get a Result, is Result an object? How do I know if I get a bool or error?

      • zalgotext@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        20
        arrow-down
        1
        ·
        7 months ago

        Java has been around for decades longer than Rust, comparing total code numbers doesn’t tell the whole story

      • kameecoding@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        2
        ·
        7 months ago

        That’s not the whole story, most of the Java code that exists is proprietary, java is undoubtedly #1

          • kameecoding@lemmy.world
            link
            fedilink
            English
            arrow-up
            4
            arrow-down
            5
            ·
            7 months ago

            obviously I wasn’t counting JS because by sheer volume, HTML+CSS+JS will outnumber everything because it’s the only combo for the browser.

            but if you restrict it as JS for Backend, then obviously it’s not even close to Java.

            • asdfasdfasdf@lemmy.world
              link
              fedilink
              English
              arrow-up
              3
              arrow-down
              2
              ·
              7 months ago

              If you can write off JS because “you have to use it because it’s the internet” then I can write off Java because “you have to use it for billions of 20 year old legacy applications”.

              • kameecoding@lemmy.world
                link
                fedilink
                English
                arrow-up
                5
                arrow-down
                2
                ·
                edit-2
                7 months ago

                I am not writing it off, I am saying it has no competition in the browser… therefore irrelevant to the discussion at hand.

                and btw, even in the link https://madnight.github.io/githut/#/pull_requests/2023/4 Javascript is not first, Python is, over Java.

                but once again, you would actually have to look for the backed JS applications, you are not choosing java over JS for the web, at best you would choose JSF and that still uses javascript.

        • Blaze@discuss.online
          link
          fedilink
          English
          arrow-up
          5
          ·
          7 months ago

          If only… More seriously, I want Lemmy/Kbin/Sublinks to succeed, and the development rhythm of Lemmy made me perplex for a while.

          A new option with a more popular language could address this.

        • Archer@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          7 months ago

          Check the back of every dollar for an Oracle database support contract, that’s how they get you!

    • cum@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      14
      arrow-down
      10
      ·
      edit-2
      7 months ago

      I think the people who say this and think Rust is the second coming of Jesus, just don’t code. You choose the right language that’s needed for the job. Server stuff like this is Java’s bread and butter. As amazing as Rust is, it has proven to not be a great choice for Lemmy’s development.

      • hansl@lemmy.world
        link
        fedilink
        English
        arrow-up
        14
        arrow-down
        3
        ·
        7 months ago

        I’m curious why you say Rust “ has proven “ to not be a great choice. There is a lack of Rust programmers, but its been the fastest growing community on GitHub for multiple years now, and has proven to be viable at all level of the stack.

        Full disclaimer: I code and work in Rust daily on the backend and frontend.

        • Blaze@discuss.online
          link
          fedilink
          English
          arrow-up
          6
          ·
          7 months ago

          Full disclaimer: I code and work in Rust daily on the backend and frontend.

          Would you and your colleagues be interested in contributing to Lemmy’s codebase? I’m genuinely asking, I’m still surprised by the low number of contributors for a project that has 40k active monthly users

          • hansl@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            7 months ago

            I barely have time to contribute to fix bugs in the dependencies I use. If I had more time for OSS contributions I might, but I’m not in my 20s anymore and when I’m not at work I’m taking care of my family.

            My colleagues and friends are free to do as they please.

            • Blaze@discuss.online
              link
              fedilink
              English
              arrow-up
              3
              ·
              7 months ago

              I guess that’s the same for most of the userbase. Which is probably why switching to a more spread language could increase the number of contributors.

        • kattenluik@feddit.nl
          link
          fedilink
          English
          arrow-up
          5
          arrow-down
          2
          ·
          edit-2
          7 months ago

          Not to mention a lot of massive companies also use it at every part of the stack, Rust is good at it all and it is beautifully and perfectly suited for tasks like these.

      • deur@feddit.nl
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        4
        ·
        7 months ago

        It certainly sounds more likely that you “just don’t code”.

  • lionkoy5555@lemmy.world
    link
    fedilink
    English
    arrow-up
    28
    ·
    edit-2
    7 months ago

    a missed opportunity to name it Jemmy

    I’m just here for the joke

    EDIT: sentence structure

  • hamid@lemmy.world
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    4
    ·
    7 months ago

    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.

    • hansl@lemmy.world
      link
      fedilink
      English
      arrow-up
      24
      arrow-down
      1
      ·
      7 months ago

      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.

  • kameecoding@lemmy.world
    link
    fedilink
    English
    arrow-up
    27
    arrow-down
    6
    ·
    7 months ago

    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.

    • CAVOK@lemmy.world
      link
      fedilink
      English
      arrow-up
      10
      ·
      7 months ago

      Agreed. I mean COBOL is still a thing, and that’s a language that’s been dead for 30+ years.

    • nickwitha_k (he/him)@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      9
      ·
      7 months ago

      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.

    • thedeadwalking4242@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      7 months ago

      Languages won’t grow if you ditch them for other ones. There’s lots of reasons to use rust, outside of the size of the project

      • kameecoding@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        1
        ·
        7 months ago

        I think you will find that the biggest reason to use a language is to get paid for it and there Java is very well positioned

        • thedeadwalking4242@lemmy.world
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 months ago

          That’s the reason for for hire devs yeah, but if you are starting a new project ( especially a community one like lemmy where the profit motive is different) choosing your tech stack is a complex decision

    • Aatube@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      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.

    • P03 Locke@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      11
      arrow-down
      7
      ·
      edit-2
      7 months ago

      an alternative Java-based backend to Lemmy’s Rust-based one

      Going from a modern well-designed language to an old-and-busted, kitschy, memory-hogging, bloated language. This is literally a step backwards.

      Rust, Go… hell, even Ruby-on-Rails or whatever Python is offering nowadays would be a better choice.

      • Dandroid@dandroid.app
        link
        fedilink
        English
        arrow-up
        12
        arrow-down
        2
        ·
        7 months ago

        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.

        • kaffiene@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          7 months ago

          I did a lot of Java prior to doing Go. I think they’re both good. I don’t like the Go privacy/scope thing and I genuinely hate it’s error handling but it’s pretty much 90% good pragmatic choices IMO. That said, I still think Java is a fantastic language and it makes a lot of sense for something like Lemmy

      • 31337@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        1
        ·
        7 months ago

        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

      • kassuro@feddit.de
        link
        fedilink
        English
        arrow-up
        9
        arrow-down
        1
        ·
        7 months ago

        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

        • spiderman@ani.social
          link
          fedilink
          English
          arrow-up
          3
          ·
          7 months ago

          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.

      • beefcat@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 months ago

        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…

    • MashedTech@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      7 months ago

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

    • TimewornTraveler@lemm.ee
      link
      fedilink
      English
      arrow-up
      1
      ·
      7 months ago

      I’m hearing hype from the people making it… dunno why anyone else would have anything positive or negative to say yet

  • Resol van Lemmy@lemmy.world
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    7 months ago

    I guess my username won’t make sense anymore. But it sounds so good that it doesn’t need to make sense.