Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. LLVM

LLVM

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
50 Posts 19 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lena@gregtech.euL This user is from outside of this forum
    lena@gregtech.euL This user is from outside of this forum
    [email protected]
    wrote last edited by
    #1
    This post did not contain any content.
    D E L tatterdemalion@programming.devT 4 Replies Last reply
    147
    • lena@gregtech.euL [email protected]
      This post did not contain any content.
      D This user is from outside of this forum
      D This user is from outside of this forum
      [email protected]
      wrote last edited by
      #2

      Great optimisation, awwwful compile times.

      lena@gregtech.euL D 2 Replies Last reply
      18
      • D [email protected]

        Great optimisation, awwwful compile times.

        lena@gregtech.euL This user is from outside of this forum
        lena@gregtech.euL This user is from outside of this forum
        [email protected]
        wrote last edited by
        #3

        Yeah, I think Go's compiler is so fast partially because it doesn't use LLVM

        D firelizzard@programming.devF 2 Replies Last reply
        9
        • D [email protected]

          Great optimisation, awwwful compile times.

          D This user is from outside of this forum
          D This user is from outside of this forum
          [email protected]
          wrote last edited by
          #4

          New kid on the block, roc, has it right by splitting application code from "platform"/framework code, precompiling and optimising the platform, then using their fast surgical linker to sew the app code to the platform code.

          Platforms are things like cli program, web server that kind of thing. Platforms provide an interface of domain specific IO primitives and handle all IO and memory management, and they also specify what functions app code must supply to complete the program.

          It's pretty cool, and they're getting efficiency in the area of systems programming languages like C and Rust, but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by. They pay a lot of attention to preventing cache misses and branch prediction failures, which is his they get away with reference counting and still being fast.

          A note of caution: I might sound like I know about it, but I know almost nothing.

          C S 2 Replies Last reply
          15
          • lena@gregtech.euL [email protected]

            Yeah, I think Go's compiler is so fast partially because it doesn't use LLVM

            D This user is from outside of this forum
            D This user is from outside of this forum
            [email protected]
            wrote last edited by
            #5

            That would work!

            1 Reply Last reply
            1
            • D [email protected]

              New kid on the block, roc, has it right by splitting application code from "platform"/framework code, precompiling and optimising the platform, then using their fast surgical linker to sew the app code to the platform code.

              Platforms are things like cli program, web server that kind of thing. Platforms provide an interface of domain specific IO primitives and handle all IO and memory management, and they also specify what functions app code must supply to complete the program.

              It's pretty cool, and they're getting efficiency in the area of systems programming languages like C and Rust, but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by. They pay a lot of attention to preventing cache misses and branch prediction failures, which is his they get away with reference counting and still being fast.

              A note of caution: I might sound like I know about it, but I know almost nothing.

              C This user is from outside of this forum
              C This user is from outside of this forum
              [email protected]
              wrote last edited by [email protected]
              #6

              That sounds pretty great. My impression is that relatively little code actually runs that often.

              but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by.

              That part sounds implausible, though. What kind of memory management are they doing?

              D 1 Reply Last reply
              5
              • lena@gregtech.euL [email protected]
                This post did not contain any content.
                E This user is from outside of this forum
                E This user is from outside of this forum
                [email protected]
                wrote last edited by
                #7

                That's like... It's purpose. Compilers always have a frontend and a backend. Even when the compiler is entirely made from scratch (like Java or go), it is split between front and backend, that's just how they are made.

                So it makes sense to invest in just a few highly advanced backends (llvm, gcc, msvc) and then just build frontends for those. Most projects choose llvm because, unlike the others, it was purpose built to be a common ground, but it's not a rule. For example, there is an in-developement rust frontend for GCC.

                K 1 Reply Last reply
                37
                • C [email protected]

                  That sounds pretty great. My impression is that relatively little code actually runs that often.

                  but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by.

                  That part sounds implausible, though. What kind of memory management are they doing?

                  D This user is from outside of this forum
                  D This user is from outside of this forum
                  [email protected]
                  wrote last edited by [email protected]
                  #8

                  Reference counting.

                  They pay a lot of attention to preventing cache misses and branch prediction failures, which is how they get away with reference counting and still being fast.

                  C F 2 Replies Last reply
                  5
                  • D [email protected]

                    New kid on the block, roc, has it right by splitting application code from "platform"/framework code, precompiling and optimising the platform, then using their fast surgical linker to sew the app code to the platform code.

                    Platforms are things like cli program, web server that kind of thing. Platforms provide an interface of domain specific IO primitives and handle all IO and memory management, and they also specify what functions app code must supply to complete the program.

                    It's pretty cool, and they're getting efficiency in the area of systems programming languages like C and Rust, but with none of the footguns of manual memory management, no garbage collection pauses, but yet also no evil stepparent style borrow checker to be beaten by. They pay a lot of attention to preventing cache misses and branch prediction failures, which is his they get away with reference counting and still being fast.

                    A note of caution: I might sound like I know about it, but I know almost nothing.

                    S This user is from outside of this forum
                    S This user is from outside of this forum
                    [email protected]
                    wrote last edited by
                    #9

                    [email protected]

                    1 Reply Last reply
                    1
                    • D [email protected]

                      Reference counting.

                      They pay a lot of attention to preventing cache misses and branch prediction failures, which is how they get away with reference counting and still being fast.

                      C This user is from outside of this forum
                      C This user is from outside of this forum
                      [email protected]
                      wrote last edited by
                      #10

                      Oh, you just mean it's a kind of garbage collection that's lighter on pauses. Sorry, I've had the "my pre-Rust pet language already does what Rust does" conversation on here too many times.

                      B D firelizzard@programming.devF 3 Replies Last reply
                      6
                      • C [email protected]

                        Oh, you just mean it's a kind of garbage collection that's lighter on pauses. Sorry, I've had the "my pre-Rust pet language already does what Rust does" conversation on here too many times.

                        B This user is from outside of this forum
                        B This user is from outside of this forum
                        [email protected]
                        wrote last edited by
                        #11

                        To be fair, the drop/dealloc "pause" is very different from what people usually mean when they say "garbage collection pause", i.e. stop-the-world (...or at least a slice of the world).

                        C 1 Reply Last reply
                        3
                        • lena@gregtech.euL [email protected]
                          This post did not contain any content.
                          L This user is from outside of this forum
                          L This user is from outside of this forum
                          [email protected]
                          wrote last edited by [email protected]
                          #12

                          GCC is adding cool new languages too!

                          They just recently added COBOL and Modula-2. Algol 68 is coming in GCC 16.

                          P D 2 Replies Last reply
                          30
                          • E [email protected]

                            That's like... It's purpose. Compilers always have a frontend and a backend. Even when the compiler is entirely made from scratch (like Java or go), it is split between front and backend, that's just how they are made.

                            So it makes sense to invest in just a few highly advanced backends (llvm, gcc, msvc) and then just build frontends for those. Most projects choose llvm because, unlike the others, it was purpose built to be a common ground, but it's not a rule. For example, there is an in-developement rust frontend for GCC.

                            K This user is from outside of this forum
                            K This user is from outside of this forum
                            [email protected]
                            wrote last edited by
                            #13

                            that’s just how they are made.

                            Can confirm, even the little training compiler we made at Uni for a subset of Java (Javali) had a backend and frontend.

                            I can't imagine trying to spit out machine code while parsing the input without an intermediary AST stage. It was complicated enough with the proper split.

                            buboscandiacus@mander.xyzB L 2 Replies Last reply
                            6
                            • K [email protected]

                              that’s just how they are made.

                              Can confirm, even the little training compiler we made at Uni for a subset of Java (Javali) had a backend and frontend.

                              I can't imagine trying to spit out machine code while parsing the input without an intermediary AST stage. It was complicated enough with the proper split.

                              buboscandiacus@mander.xyzB This user is from outside of this forum
                              buboscandiacus@mander.xyzB This user is from outside of this forum
                              [email protected]
                              wrote last edited by
                              #14

                              I can imagine;

                              1 Reply Last reply
                              5
                              • C [email protected]

                                Oh, you just mean it's a kind of garbage collection that's lighter on pauses. Sorry, I've had the "my pre-Rust pet language already does what Rust does" conversation on here too many times.

                                D This user is from outside of this forum
                                D This user is from outside of this forum
                                [email protected]
                                wrote last edited by [email protected]
                                #15

                                It's a post rust language.

                                By your definition any automatic memory management is garbage collection, including rust!

                                Did you think rust doesn't free up memory for you? That would be the biggest memory leak in history! No! Rust does reference counting, it just makes sure that that number is always one! What did you think the borrow checker was for?

                                In roc, because the platform is in charge of memory management, it can optimise, so that a web server can allocate an arena for each client, a game loop can calculate what it needs in advance etc etc.

                                But like I say, they do a lot of work on avoiding cache misses and branch mispredictions, which are their own source of "stop the world while I page in from main memory" or "stop the pipeline while I build a new one". If it was doing traditional garbage collection, that would be an utterly pointless microoptimisation.

                                Rust isn't a religion. Don't treat it like one.

                                When it was very new a bunch of C programmers shit on its ideas and said C was the only real systems programming language, but rust, which was pretty much Linear ML dressed up in C style syntax came from hyper weird functional programming language to trusted systems programming language. Why? Because it does memory management sooooo much better than C and is just about as fast. Guess what roc is doing? Memory management soooooo much better than C, and sooooo much less niggly and hard to get right than the borrow checker and is just about as fast.

                                Plenty of beginners program in rust by just throwing clone at every error the borrow checker sends them, or even unsafe! Bye bye advantages of rust, because it was hard to please. Roc calculates from your code whether it needs to clone (eg once for a reference to an unmodified value, each time for an initial value for the points in a new data structure), and like rust, frees memory when it's not being used.

                                Rust does manual cloning. Roc does calculated cloning. Rust wins over C for memory safety by calculating when to free rather than using manual free, totally eliminating a whole class of bugs. Roc could win over rust by calculating when to clone, eliminating a whole class of unnecessary allocation and deallocation. Don't be so sure that no one could do better than rust. And the devXP in rust is really poor.

                                C C 2 Replies Last reply
                                1
                                • lena@gregtech.euL [email protected]
                                  This post did not contain any content.
                                  tatterdemalion@programming.devT This user is from outside of this forum
                                  tatterdemalion@programming.devT This user is from outside of this forum
                                  [email protected]
                                  wrote last edited by
                                  #16

                                  Isn't Zig working on their own backend?

                                  Also, pretty excited about the cranelift project.

                                  vpol@feddit.ukV 1 Reply Last reply
                                  7
                                  • L [email protected]

                                    GCC is adding cool new languages too!

                                    They just recently added COBOL and Modula-2. Algol 68 is coming in GCC 16.

                                    P This user is from outside of this forum
                                    P This user is from outside of this forum
                                    [email protected]
                                    wrote last edited by
                                    #17

                                    cool new languages

                                    COBOL

                                    skullgrid@lemmy.worldS L 2 Replies Last reply
                                    39
                                    • D [email protected]

                                      Reference counting.

                                      They pay a lot of attention to preventing cache misses and branch prediction failures, which is how they get away with reference counting and still being fast.

                                      F This user is from outside of this forum
                                      F This user is from outside of this forum
                                      [email protected]
                                      wrote last edited by
                                      #18

                                      I wish more languages used ref counting. Yes, it has problems with memory cycles, but it's also predictable and fast. Works really well with immutable data.

                                      D 1 Reply Last reply
                                      1
                                      • F [email protected]

                                        I wish more languages used ref counting. Yes, it has problems with memory cycles, but it's also predictable and fast. Works really well with immutable data.

                                        D This user is from outside of this forum
                                        D This user is from outside of this forum
                                        [email protected]
                                        wrote last edited by
                                        #19

                                        Roc uses immutable data by default. It performs opportunistic in-place mutation when the reference count will stay 1 (eg this code would satisfy the borrow checker without cloning or copying if it were rust - static code analysis).

                                        F 1 Reply Last reply
                                        1
                                        • D [email protected]

                                          It's a post rust language.

                                          By your definition any automatic memory management is garbage collection, including rust!

                                          Did you think rust doesn't free up memory for you? That would be the biggest memory leak in history! No! Rust does reference counting, it just makes sure that that number is always one! What did you think the borrow checker was for?

                                          In roc, because the platform is in charge of memory management, it can optimise, so that a web server can allocate an arena for each client, a game loop can calculate what it needs in advance etc etc.

                                          But like I say, they do a lot of work on avoiding cache misses and branch mispredictions, which are their own source of "stop the world while I page in from main memory" or "stop the pipeline while I build a new one". If it was doing traditional garbage collection, that would be an utterly pointless microoptimisation.

                                          Rust isn't a religion. Don't treat it like one.

                                          When it was very new a bunch of C programmers shit on its ideas and said C was the only real systems programming language, but rust, which was pretty much Linear ML dressed up in C style syntax came from hyper weird functional programming language to trusted systems programming language. Why? Because it does memory management sooooo much better than C and is just about as fast. Guess what roc is doing? Memory management soooooo much better than C, and sooooo much less niggly and hard to get right than the borrow checker and is just about as fast.

                                          Plenty of beginners program in rust by just throwing clone at every error the borrow checker sends them, or even unsafe! Bye bye advantages of rust, because it was hard to please. Roc calculates from your code whether it needs to clone (eg once for a reference to an unmodified value, each time for an initial value for the points in a new data structure), and like rust, frees memory when it's not being used.

                                          Rust does manual cloning. Roc does calculated cloning. Rust wins over C for memory safety by calculating when to free rather than using manual free, totally eliminating a whole class of bugs. Roc could win over rust by calculating when to clone, eliminating a whole class of unnecessary allocation and deallocation. Don't be so sure that no one could do better than rust. And the devXP in rust is really poor.

                                          C This user is from outside of this forum
                                          C This user is from outside of this forum
                                          [email protected]
                                          wrote last edited by [email protected]
                                          #20

                                          There is no reference counting if the count is always one.

                                          The defining feature of reference counting is that its a runtime check. Which in turn results in a runtime performance.

                                          If there is no in memory counter at runtime, nobody calls that reference counting.

                                          D 2 Replies Last reply
                                          2
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups