I’m looking for a programming language that can help me build a desktop application for Windows, macOS, and Linux that’s not big but not small either. Additionally, I’d like to be able to build a website with the same language. I’ve been considering Ruby, Python, Golang and JavaScript. Python seems to be mainly used for scripting and ai, so I’m not sure if it’s the best fit. JavaScript has a lot of negative opinions surrounding it, while Ruby sounds interesting. Can anyone recommend a language that meets my requirements?

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    7
    arrow-down
    3
    ·
    2 months ago

    You can count Ruby out immediately. Terrible language.

    Also replace JavaScript with Typescript. It’s strictly superior.

    I don’t think Go has any mature GUI libraries.

    For desktop GUI your main options are:

    • Qt, via C++. Probably the best option but if you don’t know C++ that’s a huge barrier.
    • Qt, via Python. Reasonable but Python is quite a shit language. It’s very slow and the tooling/infrastructure is absolutely abysmal. Be prepared to bang your head against the wall trying to e.g. get relative imports to work.
    • Dart/Flutter. This is quite nice but not super mature for desktop apps. Also the Dart ecosystem is very small so libraries you want may not be available.
    • Electron/Typescript. This is quite a good option. Nobody here will recommend this because nerds have a slightly weird hatred of Electron because the minimum download size is like 80MB. But normally it doesn’t really matter. Especially for big apps.

    For the web frontend you basically want Typescript. For the backend you can use literally any language.

    I would recommend Electron for the GUI and Typescript for the web frontend and Electron GUI. It means you can use the same language everywhere and you won’t need to even implement the same program twice.

    If you’re worried about the download size / RAM usage you can look into Tauri which uses your OS’s browser engine. I’ve never used it though.

    • bellsDoSing@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      Regarding tauri: One and a half years ago I looked into it as a potential alternative to using electron.

      Back then I had to decide against it for my use case, because when the goal is that it’s a cross platform app, then one has to make sure that whatever “webview version” is used on all target OS, they all have to support the features one needs re one’s own app codebase. Back then I needed some “offscreen canvas” feature that chromium supported (hence electron), but which webkit2gtk (used on Linux) didn’t at the time.

      https://tauri.app/v1/references/webview-versions/

      So it’s not always easy to give a clear recommendation on using tauri over electron. One really has to get somewhat clear on what kind of “webview requirements” the resp. app will have.

      But I do hope this will (or maybe already is) less of an issue in upcoming years (things are moving fast after all).

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        Ever tried to follow a large Ruby codebase like Gitlab? Absolutely nightmare. Not only does it not have type annotations, so you can’t follow code by clicking, but you can’t even follow it by grepping because Rubyists seem to love generated identifiers. Even the syntax of the language makes grepping worse, e.g. the lack of brackets prevents you from grepping for function calls like foo(.