• BartyDeCanter@lemmy.sdf.org
      link
      fedilink
      arrow-up
      33
      arrow-down
      1
      ·
      2 个月前

      Array operations in FORTRAN are much easier for the compiler heavily optimize than it is in c/c++ due to its array model and type system. You can achieve much of the same thing with modern compiler extensions, but it’s difficult and not as portable.

    • tetris11@lemmy.ml
      link
      fedilink
      arrow-up
      14
      ·
      2 个月前

      Its just easy to write super-optimised code snippets in without having to break out into assembly.

        • dewritoninja@pawb.social
          link
          fedilink
          arrow-up
          10
          ·
          2 个月前

          Not only is it very difficult to write in assembly, the resulting code is not portable. Meaning that if you wrote it on x86 assembly it can’t run on ARM chips without emulation and that takes a significant hit on performance defeating the point

        • SqueakyBeaver@lemmy.blahaj.zone
          link
          fedilink
          arrow-up
          7
          ·
          2 个月前

          Yeah, it’s pretty difficult. Think of assembly as just one step above writing 1’s and 0’s, and you’re probably around how difficult it can be

          • recursiveInsurgent@lemm.ee
            link
            fedilink
            English
            arrow-up
            7
            ·
            2 个月前

            I’ve delved into writing assembly only on the level of a student project. I really enjoyed it though. Obviously implementing a python math library would be far more complex but wouldn’t it be worth it for the possible performance gains?

            • Jack Riddle@sh.itjust.works
              link
              fedilink
              arrow-up
              11
              ·
              2 个月前

              I don’t think it would be anymore. Modern compilers are really really good at what they do, and often manually optimizing(writing assembly yourself) makes programs slower. So unless you are very good at assembly, I would just trust the compiler.