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. Something something history is a flat circle

Something something history is a flat circle

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
43 Posts 24 Posters 3 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.
  • F [email protected]

    K&R started with BCPL as their base of inspiration. They then made B, and then C. The followup should be called P.

    Z This user is from outside of this forum
    Z This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #29

    https://en.m.wikipedia.org/wiki/P_(programming_language)

    1 Reply Last reply
    1
    • C [email protected]

      As I said, I don't consider going out of bounds of a buffer a memory safety issue. Forcing the programmer to handle an out-of-bounds case every time there is an array access can be incredibly tedious. So much that not even rust forces you to do so. And if that language has iterators, it's even less of an issue.

      I consider out-of-bounds array access to same as casting a pointer to another type. Just because a language lets you do it, it doesn't mean that it is not memory safe. It is a performance feature, since checking the bounds every time is always possible (and incredibly easy to implement), but also with too big of an impact when you could just check the length once per loop instead of per loop iteration.

      anyoldname3@lemmy.worldA This user is from outside of this forum
      anyoldname3@lemmy.worldA This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #30

      If you're going to change the definition of words, it's pretty easy to show that garbage collection on its own is sufficient, but it's not possible to have a useful conversation if someone's using their own personal definition of the terms being discussed. The generally accepted definition of memory safety includes deeming out-of-bounds accesses and other spatial memory safety issues unsafe.

      C 1 Reply Last reply
      1
      • B [email protected]

        Does Ada have a capability as powerful as the borrow checker?

        A This user is from outside of this forum
        A This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #31

        I’ve never used Rust but from my very cursory knowledge of what the borrow checker entails, it wouldn’t add so much to Ada.

        Use of pointers is already strongly discouraged by the simple fact that the language is designed to rarely truly need them. Besides, the compiler itself chooses automatically whether to pass data by value or by reference depending on the required results and what is most efficient. You can also specify parameters passed to a function as read-only. Finally, another thing that Ada does to prevent yourself shooting in your foot is to enforce strong encapsulation of functions and data.

        Overall, one way to put it in simple terms is that Ada requires the programmer to give enough information to the compiler so as to ensure that it actually outputs what you want it to, which as far as I understand, is sort of what the borrow checker is there for. The downside to the Ada approach is that it is very verbose, but with the kind of code editing capabilities we have nowadays it’s certainly not as much a hassle as it was when Ada came out.

        Anyways, I suspect that both languages are different enough in overall paradigm that trying to solve problems in Ada the way you would in Rust would probably be quite frustrating and give rather poor result.

        B 1 Reply Last reply
        0
        • anyoldname3@lemmy.worldA [email protected]

          If you're going to change the definition of words, it's pretty easy to show that garbage collection on its own is sufficient, but it's not possible to have a useful conversation if someone's using their own personal definition of the terms being discussed. The generally accepted definition of memory safety includes deeming out-of-bounds accesses and other spatial memory safety issues unsafe.

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

          With your definition this conversation doesn't make sense though. Since rust's direct array access doesn't perform bounds checks when building in release mode. And it doesn't require using unsafe.

          anyoldname3@lemmy.worldA 1 Reply Last reply
          0
          • C [email protected]

            With your definition this conversation doesn't make sense though. Since rust's direct array access doesn't perform bounds checks when building in release mode. And it doesn't require using unsafe.

            anyoldname3@lemmy.worldA This user is from outside of this forum
            anyoldname3@lemmy.worldA This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #33

            That's not what Rust's documentation says. It does a compile-time bounds check if it can prove what the index might be during compilation, and a runtime bounds check if it can't. In release mode, it tries harder to prove the maximum index is below the minimum length, but it still falls back to a runtime bounds check if it can't unless you use get_unchecked, which is unsafe.

            1 Reply Last reply
            0
            • C [email protected]

              How can you not have memory-safety while also having a garbage collector?

              Garbage collection means that all objects live as long as you have a reference to it. Which means that you can only dereference a pointer to invalid memory if you willingly create an invalid pointer, or reinterpret the type of one pointer into another. Going out of bounds of an array counts as the first case.

              If a language has garbage collection but no compiler/interpreter supports it, then the language doesn't have garbage collection.

              E This user is from outside of this forum
              E This user is from outside of this forum
              [email protected]
              wrote on last edited by [email protected]
              #34

              I've gotten segfaults in python with only the standard library

              1 Reply Last reply
              0
              • F [email protected]

                K&R started with BCPL as their base of inspiration. They then made B, and then C. The followup should be called P.

                icastfist@programming.devI This user is from outside of this forum
                icastfist@programming.devI This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #35

                Some people really suck at coming up with names for their programming languages. There are so many single letter languages (B, C, D, E, F, J, K, V...) that it really makes one wonder what the fuck is wrong with them

                F 1 Reply Last reply
                2
                • V [email protected]

                  It looks like a nice mix of some of the worst design choices of C++ with some of the most dubious choices of Rust.

                  icastfist@programming.devI This user is from outside of this forum
                  icastfist@programming.devI This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #36

                  Oh, so it's a contender against Brainfuck

                  1 Reply Last reply
                  5
                  • Z [email protected]
                    This post did not contain any content.
                    icastfist@programming.devI This user is from outside of this forum
                    icastfist@programming.devI This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #37

                    Zig or V could've been shown instead of Carbon (the lone C)

                    1 Reply Last reply
                    1
                    • icastfist@programming.devI [email protected]

                      Some people really suck at coming up with names for their programming languages. There are so many single letter languages (B, C, D, E, F, J, K, V...) that it really makes one wonder what the fuck is wrong with them

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

                      These days, search engine optimization tends to force new single letter languages into obscurity. Even Go would have issues there if Google hadn't been behind it.

                      icastfist@programming.devI Z 2 Replies Last reply
                      5
                      • F [email protected]

                        These days, search engine optimization tends to force new single letter languages into obscurity. Even Go would have issues there if Google hadn't been behind it.

                        icastfist@programming.devI This user is from outside of this forum
                        icastfist@programming.devI This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #39

                        Even in the early 2000s, those single letters would be awful as lone search terms

                        1 Reply Last reply
                        1
                        • A [email protected]

                          I’ve never used Rust but from my very cursory knowledge of what the borrow checker entails, it wouldn’t add so much to Ada.

                          Use of pointers is already strongly discouraged by the simple fact that the language is designed to rarely truly need them. Besides, the compiler itself chooses automatically whether to pass data by value or by reference depending on the required results and what is most efficient. You can also specify parameters passed to a function as read-only. Finally, another thing that Ada does to prevent yourself shooting in your foot is to enforce strong encapsulation of functions and data.

                          Overall, one way to put it in simple terms is that Ada requires the programmer to give enough information to the compiler so as to ensure that it actually outputs what you want it to, which as far as I understand, is sort of what the borrow checker is there for. The downside to the Ada approach is that it is very verbose, but with the kind of code editing capabilities we have nowadays it’s certainly not as much a hassle as it was when Ada came out.

                          Anyways, I suspect that both languages are different enough in overall paradigm that trying to solve problems in Ada the way you would in Rust would probably be quite frustrating and give rather poor result.

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

                          The borrow checker is a lot deeper than merely making pointer use a bit safer; it provides a model for data ownership based on affine types.

                          Also, to the extent that "Ada requires the programmer to give enough information to the compiler so as to ensure that it actually outputs what you want it to," if I understand you correctly, that is basically true of every language with a static type system. At the extreme end, we have dependently typed languages which essentially let you express arbitrary mathematical propositions in your types and, if the program compiles, then you know that they will always be satisfied without having to do any checks at runtime.

                          1 Reply Last reply
                          0
                          • F [email protected]

                            These days, search engine optimization tends to force new single letter languages into obscurity. Even Go would have issues there if Google hadn't been behind it.

                            Z This user is from outside of this forum
                            Z This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #41

                            That's why you put the "-lang" postfix if you have issues with searching for documentation of functions, etc.

                            S 1 Reply Last reply
                            2
                            • Z [email protected]

                              The "better" performance is due to the built-in multi-threading support, and that functional programming makes it relatively safer to pull off. Otherwise single-threaded Rust is very hard to optimize.

                              A This user is from outside of this forum
                              A This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #42

                              Rust has monomorphisation like C++ and every function has the aliasing guarantees of restrict, a keyword rarely seen in C code bases use and C++ doesn't even support.
                              This means you can get more optimisations while writing in an intuitive style, where C/C++ requires some changes to the code.

                              On the other hand rustc has some hiccups with argument passing and rvo. One could argue that that's just the compiler while the aliasing problems are part of the language in the C/C++ case, but while there is only one rust compiler its performance is the languages performance.

                              For most use cases they are about equally fast.

                              1 Reply Last reply
                              0
                              • Z [email protected]

                                That's why you put the "-lang" postfix if you have issues with searching for documentation of functions, etc.

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

                                Can't find a lot searching for java-lang...

                                1 Reply Last reply
                                0
                                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