• demesisx@infosec.pub
    link
    fedilink
    English
    arrow-up
    26
    ·
    edit-2
    1 year ago

    As others have said, Haskell and Rust are pretty great. A language that hasn’t been mentioned that I REALLY want to catch on, though, is Unison.

    Honorable mention to my main driver lately: Purescript

      • demesisx@infosec.pub
        link
        fedilink
        English
        arrow-up
        12
        ·
        1 year ago

        Hard to describe in one phrase other than to say:

        NixOS is to Linux as Unison is to Haskell

        Content-addressing used in the context of programming languages in the service of solving the problem of distributed systems and their inability to share code across time and space.

        Haskell has a content-addressed module that was perhaps influenced by Unison.

        Here’s an excellent interview with one of the authors of Unison:

        https://youtu.be/zHzpoVgqgc4

    • sus@programming.dev
      link
      fedilink
      arrow-up
      26
      arrow-down
      2
      ·
      1 year ago

      Garbage collection is still allowed, and technically JIT languages are still compiled so it really isn’t that restrictive

    • paperplane@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      Not that specific tbh, most newer native languages these days are compiled and memory safe (Rust, Swift, Go, Kotlin Native, etc)

  • Lambda@lemmy.ca
    link
    fedilink
    arrow-up
    22
    arrow-down
    3
    ·
    1 year ago

    Ada, hands down. Every time I go to learn Rust I’m disappointed by the lack of safety. I get that it’s miles ahead of C++, but that’s not much. I get that it strikes a much better balance than Ada (it’s not too hard to get it to compile) but it still leaves a lot to be desired in terms of safe interfacing. Plus it’s memory model is more complicated than it needs to be (though Ada’s secondary stack takes some getting used to).

    I wonder if any other Ada devs have experience with rust and can make a better comparison?

    • collapse_already@lemmy.ml
      link
      fedilink
      English
      arrow-up
      6
      arrow-down
      1
      ·
      1 year ago

      I have done quite a bit of C, C++, Ada, and Pascal development. I recently got into Rust. I am still getting used to Rust, but it feels a bit like someone tried to apply Ada to C++. I like the modern development environment, but I am slower writing code than I would be in Ada or C++. The one feature of Ada that I really like and want other languages to adopt is the Rep spec. I write driver code and being able to easily and explicitly identify which symbol corresponds to which bit is really good.

    • refalo@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I would use Ada or Spark in a heartbeat if there was an easy-to-use, mature cross-platform GUI library for it.

    • Cyclohexane@lemmy.ml
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      1 year ago

      Sad I had to scroll to the end to see this.

      Ocaml is brilliant and has the nicest type features. It’s almost like Haskell but more approachable imo.

      • paperplane@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        Coming from Haskell, OCaml always felt a bit strange to me. The double semicolons, the inconsistency in the standard library between curried and uncurried functions etc. Maybe I’m confusing it with Standard ML though, can’t remember.

        • Cyclohexane@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          I know double semicolons are a thing, but I’ve never had to use them. I forget what they’re for, but yeah it’s supposed to be an escape hatch for something that shouldn’t be happening iirc.

          The curried snd uncurried functions… Maybe you are confusing with SML, because everything in ocaml is curried by default. Though admittedly the standard library could be more complete, but I personally am happy to use third party dependencies for less common things.

      • AbelianGrape@beehaw.org
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        1 year ago

        As a Haskell programmer, “OCaml has the nicest type features” hurts just a little bit.

        I sometimes teach a course in OCaml. The students who are very engaged inevitably ask me about Haskell, I encourage them to try it, and then they spend the rest of the semester wondering why the course is taught in OCaml. Bizarre how different that is from when colleagues in industry want to try Haskell.

          • AbelianGrape@beehaw.org
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Largely reasonable?

            Haskell is not good for systems programming which sums up about 60-70% of that post. Laziness is lovely in theory but many industry uses of Haskell use stricthaskell for all or most of their code, so I certainly agree with that part too.

            Their largest complaint about using Haskell for small non-systems programs seems to be the mental overhead induced by laziness. But for me, for small programs where performance isn’t a huge concern (think Advent of code or a script for daily life) laziness reduces my mental overhead. I think that author is just especially concerned about having a deep understanding of their programs’ performance because of their systems background. I worry about performance when it becomes relevant. Debugging Haskell performance issues is certainly harder than strict languages but still totally doable.

            The lack of type classes or other form of ergonomic overloading in OCaml is easily the single “feature” most responsible for the language never taking off.

            • Cyclohexane@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              As someone who is not deep into type theory or functional programming, can you please explain why you mean by “ergonomic overloading”?

              My understanding is that ocaml mitigates the need for type classes through its more advanced module system. So far I have been enjoying the use of OCaml modules, so I’m curious what exactly I’m missing out on, if any.

              Thanks for taking the time to talk with me btw!

              • AbelianGrape@beehaw.org
                link
                fedilink
                arrow-up
                1
                ·
                1 year ago

                You have to be explicit about which module you’re using at all times, even though 99% of the time only one could apply. When the type class resolution is unique, but complicated, there’s no mental overhead for the Haskell programmer but getting all the right modules is a lot of overhead for the OCaml programmer. It also lets us write functions that are polymorphic under a class constraint. In OCaml you have to explicitly take a module argument to do this. If you want to start composing such functions, it gets tedious extremely fast.

                And then even once you’re using a module, you can’t overload a function name. See: + vs +.. Basically modules and type classes solve different problems. You can do some things with modules that you cannot ergonomically do with type classes, for example. create a bit-set representation of sets of integers, and a balanced search tree for sets of other types, and expose that interface uniformly from the same module functor. But Haskell has other ways to achieve that same functionality and more.

                OCaml’s type system cannot replicate the things you can do with Haskell’s higher kinded types, type families, or data kinds at all (except for a fraction of Haskell’s GADTs).

  • skulbuny@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    13
    arrow-down
    1
    ·
    1 year ago

    People don’t understand that JIT languages are still compiled, JIT literally describes when it’s compiled.

    That said, F# and/or OCaml.

  • hessnake@lemmy.world
    link
    fedilink
    arrow-up
    11
    arrow-down
    2
    ·
    1 year ago

    I started learning Go about 3 months ago and it quickly became one of my favorite languages. It feels like C with a bunch of Python niceties thrown in. And performance isn’t super critical in my work so being garbage collected is fine with me.

  • UFO@programming.dev
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    Scala 3 native. If the compiler was faster I’d be even happier. Curious to try Ada