• nous@programming.dev
    link
    fedilink
    English
    arrow-up
    91
    ·
    7 months ago

    Rust, it is a pleasure to work with and far more flexible in where/what it can run then a lot of languages. Good oneverything from embedded systems to running on the web. Only really C and C++ can beat it on that, but those are farlesss pleasant to work with. Even if it is not as mature in some area quite yet, it just gets more support for things as time goes on.

    • JustEnoughDucks@feddit.nl
      link
      fedilink
      arrow-up
      3
      ·
      7 months ago

      I have been wanting to get into Rust, but as an Electronics Engineer I essentially only have experience coding on embedded devices along with python scripting for test automation and data processing (fuck MATLAB lol)

      I am not a good at coding by any stretch. Everything I find on rust focuses on rust user-level or OS-level applications. Most of those concepts I don’t follow well enough in any case.

      Do you know of where I can follow tutorials, find more information, and dive into HALs for embedded applications?

      • DrWypeout@programming.dev
        link
        fedilink
        arrow-up
        10
        ·
        7 months ago

        Rust actually has a shockingly good embedded story for some parts. ST-micro is very well covered. Espressif has first party support. Nordic parts are supported by Ferrous Systems who certify rust for ISO 26262 use. Msp430 is workable, but requires a fair bit of knowledge. The story is less good for anything else that’s not a Cortex part. RiscV is definitely getting there though.

        https://doc.rust-lang.org/stable/embedded-book/

        Ferrous systems knurling is actually a pretty incredible set of tools. I’d argue that they’re a better experience than most command-line c environments.

        https://github.com/knurling-rs

        They also have some pretty good walkthroughs for the Nordic and Espressif parts.

      • nous@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        7 months ago

        I would start by learning rust at a user level via the rust book to get you familiar with the language without the extra layers that embedded systems tend to add on top of things. Keep in mind that the embedded space in rust is still maturing, though it is maturing quite quickly. However one of the biggest limitations ATM is the amount of architectures available - if you need to target one not supported then you cannot use rust ATM (though there is quite a few different projects bringing in support for more architectures).

        If you only need to use architectures that rust supports than once you have the basics of rust down take a look at the embedded book, the Discovery book and the Embedonomicon. Then there are various crates for different boards such as ruduino for the arduino uno, or the rp-pico for the raspberry pi pico, or various other crates for specific boards. There are also higher and lower level crates for things - like ones specific to a dev board and ones that are specific to a chipset.

        Lastly, there are embedded frameworks like Embassy that are helpful for more complex applications.

  • rekabis@programming.dev
    link
    fedilink
    arrow-up
    77
    ·
    7 months ago

    DotNet Core as a whole (C# + F# + other languages that are being ported to compile down to a DotNet binary).

    Because it has all the things Java promised us - frictionless, painless, cross-platform programs - but is implementing it far better than Java ever could.

    Honestly, DotNet Core is now at least a half-decade or more ahead of Java in terms of the base platform and C# language functionality/ease-of-use. The only advantage Java has at this point is it’s community ecosystem of third-party features and programs.

    • GissaMittJobb@lemmy.ml
      link
      fedilink
      arrow-up
      15
      ·
      7 months ago

      I remember my first job working with C# - this was the common sentiment: it’s a Java that is better than Java at being Java. I mostly agree with that.

      Try using Kotlin some day, though. I consider that language to be even better than C#, and it additionally gets to leverage the JVM ecosystem.

      Kotlin > C# > Java, in my book

      • Undertaker@feddit.de
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

        You may explained it unprecisley or simply wrong. You can not run it in browser. It is done on web Server side like PHP. In browser you run JavaScript.

    • SokathHisEyesOpen@lemmy.ml
      link
      fedilink
      English
      arrow-up
      6
      ·
      7 months ago

      And those are enormous advantages. It will also get you a lot more jobs. I see Java jobs everywhere. I barely see C job postings at all.

    • interolivary@beehaw.org
      link
      fedilink
      arrow-up
      5
      ·
      7 months ago

      I’ve been meaning to give F# a go but I never seem to get around to it. Seems like an interesting language

  • Piafraus@lemmy.world
    link
    fedilink
    arrow-up
    32
    ·
    7 months ago

    Python. Not even a competition. My love of programming quadrupled the day I switched to python and it’s getting stronger and stronger. I have now 10 years of professional python experience and around the same of C++ with occasional C#. A few projects in Go and Java. They all have ups and downs, but… Not even comparable how much everything is more elegant and simple in python

    • EatATaco@lemm.ee
      link
      fedilink
      English
      arrow-up
      23
      ·
      7 months ago

      I don’t get it. I love python for small quick projects. But anytime things get more complicated, I find myself constantly tripping over myself without the strong typing and errors letting me know I when I’ve changed a property in a class that in falling elsewhere.

      • catfish@lemmy.ml
        link
        fedilink
        arrow-up
        5
        ·
        7 months ago

        Python was always strongly typed. For years there has been optional static typing and - you know - unit tests.

        If you’re having significant issues due to not knowing what types you’re using, the type system may not be your greatest problem…

        • EatATaco@lemm.ee
          link
          fedilink
          English
          arrow-up
          10
          ·
          7 months ago

          Sorry, I meant static typing, not strongly typing. I often cross the two. But this is exactly what I mean, if you want something to be statically typed you have to put in the extra effort, if not you’ve got dynamically typing, which is fine when things are small but I find causes stumbling blocks when things get larger.

          And depending on the scale of the project I’m working on, my unit tests usually take minutes to run, if not hours. If I’m debugging and I change a property, when I compile it instantly catches that I forgot to change it elsewhere. Hell, even when I save it I’ll get a little error warning. Maybe running unit tests all the time is fine if the project is small, but not if it’s large. I’m not going to run unit tests every time I’m starting a new debugging session. Linters kind of make up for this. But then we are back to making sure there are type hints, which, as I’ve been told, is not “pythonic.”

          If people like it, more power to them, I’m not shitting on the language as even I like it. I just can’t use it for larger stuff, and I’ve never worked anywhere that uses it for larger stuff, and I think for good reason.

        • Knusper@feddit.de
          link
          fedilink
          arrow-up
          8
          ·
          7 months ago

          These exist in theory, but as a whole, I’ve never seen them working at even the base level of what you get in other languages.

          Adding type hints to your code is fucking exhausting, because there is no type inference.
          MyPy regularly calls it quits, when any library doesn’t have type hints. PyCharm regularly doesn’t properly auto-complete, because it doesn’t have type information (if it can load your project correctly to begin with).
          Unit tests exist, yes, but you need 100% test coverage to make the language properly check all code paths. Without it, even just calling a library isn’t guaranteed to work. In no fully statically typed language, would I recommend 100% test coverage, unless you have special correctness requirements.

      • Knusper@feddit.de
        link
        fedilink
        arrow-up
        4
        ·
        edit-2
        7 months ago

        Yeah, C libraries can be used in basically any mature language. It’s just too useful to not have.

        And Rust, since it doesn’t need a runtime, can emulate the format of C libraries.
        Rust libraries can also specifically target Python via https://pyo3.rs, but as I understand, this just does the C library format, plus a basic Python wrapper to make it nicer to use.

        • CameronDev@programming.dev
          link
          fedilink
          arrow-up
          4
          ·
          7 months ago

          Sorry, I meant in the context of OPs question (so i guess up to them to set the rules). As in, you pick Python for the rest of your life, does that lock you out of C libraries? Its a bit of a rabbithole though, as many language runtimes would get excluded as well. There arent many languages that actually stand alone.

          • Knusper@feddit.de
            link
            fedilink
            arrow-up
            3
            ·
            7 months ago

            Ah, right, my interpretation is that as long as you don’t need to touch the source code, you’re good.

            But yeah, it’s certainly not as clear cut. My pick would actually be Rust, because you can use it for pretty much everything, including web frontends via WebAssembly.
            However, in that case, you still write HTML+CSS, which technically may or may not be programming languages, and the DOM API is actually only documented in JavaScript. So, I wouldn’t need to write JS, but would still want to read it…

            • CameronDev@programming.dev
              link
              fedilink
              arrow-up
              3
              ·
              7 months ago

              Thats probably the best way to look at it, otherwise it gets very difficult very fast.

              If markup languages are locked out, then rust has other problems, because you then can’t change your cargo.toml file anymore.

              And then there is the build script problem :/

              As a thought excercise this has been interesting, there certainly are a lot of inter-dependencies between languages the deeper you look.

              • Knusper@feddit.de
                link
                fedilink
                arrow-up
                2
                ·
                7 months ago

                Yeah, I found it quite interesting, too. To some degree, I’ve been wondering why it’s so natural for programmers to be programming language polyglots, even if they’re not actively nerds/excited about them.
                And yeah, this discussion made me realize that you basically can’t take a single step in programming without being confronted with multiple languages/syntaxes at once.

  • Troy@lemmy.ca
    link
    fedilink
    arrow-up
    28
    ·
    7 months ago

    Python. I’m in data science. Sure I could write all that code in C or C++, but my time spent coding all that extra boilerplate is better spent on analysis.

  • Gremour@lemmy.world
    link
    fedilink
    arrow-up
    27
    ·
    7 months ago

    I’ve already made this choice. Switched from C++ to Go, and now I never want to touch another language at all. Since I’m not writing kernels or embedded, Go is pretty fast for everything else. Not very popular in gamedev, but that’s just a lack of 3rd party libs, specifically native graphics support.

    As for other languages, I can’t justify unnecessary complexity that is generally welcome by those language communities. Go is straight simple yet powerful, and I admire that.

    • MajorHavoc@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      7 months ago

      I think I’m with you on this one. As another polyglot, I’m hesitant to pick anything, but the language I like working with most, today, is ‘go’.

      I think I would risk it and hope that ‘go’ gains libraries (or I just discovery existing ones) for other things I want to do later.

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

        That boils down to maps. With a few helper functions it’s not a big deal. I can’t remember when I needed to unmarshal JSON into map last time, tho.

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

          I was working on that yesterday. 😂 Building a feature to resolve variables in a serverless config file to custom sources.

    • mindbleach@sh.itjust.works
      link
      fedilink
      arrow-up
      19
      ·
      7 months ago

      Right? C++ feels like cheating. It has every conceivable feature, and you maintain sanity by not using most of them.

  • sudotstar@kbin.social
    link
    fedilink
    arrow-up
    23
    ·
    7 months ago

    I’d probably pick something esoteric and then just stop programming, tbh. I enjoy being a polyglot programmer, and learning many languages and learning from many ecosystems is incredibly interesting to me, far more than hyper-specializing in a single language would be.

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    23
    ·
    7 months ago

    C, can build any other language from that :D

    And if i am gonna be miserable, may as well inflict as many vulnerabities on everyone else while I am at it.

  • Knusper@feddit.de
    link
    fedilink
    arrow-up
    20
    ·
    7 months ago

    Rust:

    • It covers all bases, from embedded to backend to webdev to gamedev.
    • I could create libraries with it, which can be called from other languages.
    • It’s good.
  • KSP Atlas@sopuli.xyz
    link
    fedilink
    arrow-up
    19
    ·
    7 months ago

    Likely either C or C++, both languages have been around for a long time and both are still used in huge projects

  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    18
    ·
    7 months ago

    JavaScript because you can do everything with it and long term all other languages will, most likely, gradually fade away (except for C/C++).

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

      Yeah, if I really took this question seriously, I would say JavaScript. It runs everywhere, it does everything, and it’s honestly pretty fun to work with, when it’s not being awful.

    • frippa@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      In 20 years we’ll be able to run Javascript on microcontrollers, that will be an interesting day.

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

        20 years? Ahahah

        https://github.com/espruino/Espruino

        Espruino is a JavaScript interpreter for microcontrollers. It is designed for devices with as little as 128kB Flash and 8kB RAM.

        Before anyone says that an ESP32 isn’t actually a microcontroller let me just point out that it doesn’t really matter. A few years ago a board with an ATmega 2560, lets say an Arduino, would cost around 30€, today you can get ESP32 boards with WiFi and way better performance for 3€ making the Arduino 2560 mostly useless / not cost effective.

        In just 5 years with all those new RISC and ARM chips will most like triple their performance and take over what is now done by high end AVR and PIC microcontrollers. Costs will go even further into cents and microcontrollers as we know them will become irrelevant. With the extra performance JS will become the most popular language simply because developer time is more expensive than hardware.

      • Dave.@aussie.zone
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        7 months ago

        15 years ago I was running multi-tasking BASIC programs on a controller that had 2MB of storage. We should have been there by now.

        Holy shit, they’re still kicking around:

        https://wilke.de/en/embedded-computer/details/zurueck/computer-module/products/tiny-tiger-multitasking-computer.html

        I used a few for high speed logging of a quadrature rotary encoder to measure the speed of a hydraulic sampling arm. Battery powered , had a 4 line LCD and keypad with a simple menu interface to take samples, as well as a serial export function to get .CSV files via hyperterminal.