Threads for tncowart

  1. 2

    I don’t believe I had heard of Vietas Formulas before today and now I’v heard about them in two unrelated contexts! They came up in a numberphile video about question 6 of the 1988 IMO https://youtu.be/NcaYEaVTA4g

    1. 1

      This is one of those super fascinating things about how mathematics is taught around the globe: I was taught this crap stuff in high school. I have no idea why but it was considered pretty important. To this day, I don’t think I’ve used this for anything other than scoring nerd points and solving high school algebra problems. I was in high school at a time when high school curricula was slowly being dragged into our age so there were a few odd relics, like a whole bunch of obscure tricks with logarithms that we didn’t quite know what to do with because the use of logarithm tables to simplify tedious multi-digit operations was no longer taught. I suspect this was one of those things.

    1. 5

      I much prefer simple visualizations. This one is busy and has many distracting details: the unnecessary right angle connections and angled presentation, the light gray graph lines within the connections, the color circles at the right angles – there are either better alternatives for these or they can be dropped. Honestly I would prefer the following plain text explanation:

                      INNER JOIN
      Inputs                     Result
      
      X1  1 --- Y1  1            1  X1   Y1
      X2  2 --- Y2  2            2  X2   Y2
      X3  3     Y3  4
      
                      LEFT JOIN
      Inputs                     Result
      
      X1  1 --- Y1  1            1  X1   Y1
      X2  2 --- Y2  2            2  X2   Y2
      X3  3     Y3  4            3  X3   NULL
      
                      OUTER JOIN
      Inputs                     Result
      
      X1  1 --- Y1  1            1  X1   Y1
      X2  2 --- Y2  2            2  X2   Y2
      X3  3     Y3  4            3  X3   NULL
                                 4  NULL Y3
      
      1. 1

        How would you do a plain text cross join? In particular, how would you “draw” the connections?

        1. 1

          I think this one is conceptually very simple, since it’s just the Cartesian product. Something like this looks good to me:

                          CROSS JOIN
          
                    Note: Every element of 
                    X matched with every element
                    of Y.  Cartesian product.
          
          Inputs                     Result
          
          X1  1 \ / Y1  1            1  X1   Y1
          X2  2 -X- Y2  2            1  X1   Y2
          X3  3 / \ Y3  4            1  X1   Y3
          
                                     2  X2   Y1
                                     2  X2   Y2
                                     2  X2   Y3
          
                                     3  X3   Y1
                                     3  X3   Y2
                                     3  X3   Y3
          
      1. 1

        How useful for me! Thank you for posting this.

        1. 6

          I think this is an interesting project. While the language of the write up feels like the kind of inflated language I associate with art projects, I think the process documentation and resulting font are cool.

          My initial feeling about the project is similar to others here— that its pointlessly cruel to the tree. But on further reflection I realized I don’t think I can defend the validity of that feeling. For one thing, AFAIK plants don’t feel pain. He also didn’t kill the tree and it seems to have healed up just fine. So on the cruelty scale this seems no worse than mowing the lawn.

          1. 5

            Yes it matters.

            At least with C++ developers can slowly learn the more arcane part of the language language while they use it. A bit more difficult with Rust.

            Furthermore, it might be possible to implement some form of borrow checking for existing languages.

            Any language should be easy to learn. That’s true for C and python. Language popularity is highly correlated with ease of learning. And this is true for all the new languages out there that try to do fancy things: most developers do not care.

            Personally, all I would ever want, is something mostly like C/C++, with pythonic features, easier to read and use, faster to compile, without a GC, statically compiled, without sophisticated things.

            1. 17

              I wouldn’t call C easy to learn. It probably has less essential complexity than Rust has, but there’s still a lot of fiddly details to learn that wouldn’t come up in languages created decades later with garbage collection and better tooling and syntactic defaults.

              1. 9

                A couple issues I found when wanting to learn C is all of the variation because of its history. What tooling should I use? Which conventions should I follow? Which version is the current version?

                The various C standards are not conveniently discoverable and even when you map them out, they’re written in reference to past standards. So to get the set of rules you have to mentally diff K&R C with a handful of other standards published over 40 years, etc. Starting completely from no knowledge and trying to figure out “What are the complete set of rules for the most modern version of C?” is nearly impossible. At least that has been my experience and biggest struggle when trying to get started with C multiple times over the years.

                Then I constantly see veteran C programmers arguing with each other about correct form, there seems to be far less consensus than with modern languages.

                1. 5

                  I’d say C is easy to learn but hard to master. But that could be said about a lot of languages.

                  1. 2

                    I think there is a big difference to what is the absolute minimum you can learn.

                    You can “learn” C with programs that compile and run the happy path mostly correctly. The probably have tons of bugs and security issues but you are using the language.

                    Rust forces you to handle these issues up front. This does make the minimal learning longer but the total learning to be a “production ready coder” is probably actually shorter.

                  2. 15

                    Man, I was terrified when I was learning C++. I would stick to the parts I was “comfortable” with, but when I would call someone else’s code (or a library) I couldn’t reliably know how the features they used would intersect with mine. And the consequences very often were debugging core dumps for hours. I’m no Rust fanboy, but if you’re going to have a language as complicated as Rust or C++, I’d rather learn with one that slaps my hand when doing something I probably oughtn’t do.

                    1. 11

                      So, Nim once ARC lands?

                      1. 3

                        Is that not the case already ? I unfortunately do not use Nim often these days so I might be out of touch, but if I recall correctly arc/orc are available but not the default.

                        EDIT: Yeah, It seems to use ref counting by default currently but the doc advise to use orc for newly written code Cf: https://nim-lang.github.io/Nim/mm.html

                      2. 8

                        Any language should be easy to learn. That’s true for C and python. Language popularity is highly correlated with ease of learning.

                        All other things being equal, yes, ease of learning is good. But at some point one may have to sacrifice ease of learning to make the expert’s work easier or more reliable or faster or leaner. Sometimes that’s what has to be done to reach the level of quality we require.

                        If it means some programmers can’t use it, so be it. It’s okay to keep the incompetents out.

                        1. 8

                          I was mostly with you, but “incompetents” is harsh.

                          1. 4

                            Can we at least agree that there is such a thing as incompetent programmers? I’m all for inclusivity, but at some point the job has to get done. Also, people can learn. It’s not always easy, but it’s rarely impossible.

                            1. 4

                              There are, but generally they’re not going to be successful whether they use Rust or another language. There are inexperienced developers who aren’t incompetent but just haven’t learned yet who will have an easier time learning some languages than Rust, and there are also experienced programmers who simply don’t know Rust who will also have an easier time learning other languages than Rust. Since the incompetent programmers will fail with or without Rust, it seemed like you were referring to the other groups as incompetent.

                              1. 5

                                Ah, the permanent connotation of “incompetent” eluded me. I was including people who are not competent yet. You only want to keep them out until they become competent.

                                My original point was the hypothesis that sometimes, being expert friendly means being beginner hostile to some extent. While it is possible (and desirable) to lower the learning curve as much as we reasonably can, it’s rarely possible to flatten it down to zero, and in some cases, it just has to be steep.

                                Take oscilloscopes for instance. The ones I was exposed to in high school were very simple. But the modern stuff I see now is just pouring buttons all over the place like a freaking airliner! That makes them much scarier to me, who have very little skill in electronics. But I also suspect all these buttons are actually valuable to experts, who may have lots of ways to test a wide variety of circuits. And those button give them a more direct access to all that goodness.

                                In the end, the question is, are steep learning curve worth it? I believe that in some cases, they are.

                                1. 3

                                  That makes sense. Thanks for clarifying. I don’t know if I have a strong opinion, but I do believe that there are cases that require extreme performance and that often requires expertise. Moreover, having been a C++ programmer for a time, I’m grateful that where C++ would accept a broken program, Rust slaps my hand.

                          2. 2

                            True. Ada Programming language easy to learn but not widely accepted or used

                          3. 4

                            At least with C++ developers can slowly learn the more arcane part of the language language while they use it. A bit more difficult with Rust.

                            I’m not sure what parts of Rust you consider “arcane”. The tough parts to learn, borrow checking and lifetimes, aren’t “arcane” parts of Rust; they are basically it’s raison d’être.

                            Any language should be easy to learn.

                            Ideally languages would be as simple/easy as they can be to meet their goals. But a language might be the easiest-to-learn expression of a particular set of goals and still be tough to learn – it depends on the goals. Some goals might have a lot of inherent complexity.

                            1. 3

                              If carefully aware of escape analyses as a programmer, you might realize that with Go, and, while programming Go for several years, I’m by no means a Go fanboy.

                              In particular, I conjecture that you could write a program in Go that does not use GC, unless the standard library functions you use themselves use GC.

                              I need to learn Rust, i realize, having written that prior sentence, and having been originally a C fan.

                              1. 6

                                Personally, I would strongly recommend the O’Reilly “Programming Rust, 2nd ed.” For me it was a breakthrough that finally allowed me to write Rust and not get stuck. It may not be “perfectly shiny” what I write, but before that, I often stumbled into some situations I just couldn’t get out of. Now I understand enough to be able to at least find some workaround - ugly or not, but it lets me go on writing.

                                Also, coming from Go (with a history of C++ long ago beforehand), one thing I had to get over and understand “philosophically” was the apparent lack of simplicity in Rust. For this, my “a ha” moment was realizing, that the two languages make different choices in a priorities triangle of: simplicity vs. performance vs. security. Go does value all 3, but chooses simplicity as the highest among them (thus GC, nulls, etc; but super approachable lang spec and stdlib APIs and docs). Rust does value all 3 too, but chooses performance AND security as the highest. Thus simplicity necessarily is just forced to the back-seat, with a “sorry, man; yes, we do care about you, but now just please stay there for a sec and let us carry out the quarrel we’re having here; we’ll come back to you soon and really try to look into what you’d like us to hear.” And notably the “AND” here is IMO a rather amazing feat, where before I’d assume it just has to often be an “or”. Also this theory rather nicely explains to me the sparking and heated arguments around the use of unsafe in the community - it would appear to happen around the lines where the “AND” is, or looks like it is, kind of stretching/cracking.

                              2. 2

                                Personally, all I would ever want, is something mostly like C/C++, with pythonic features, easier to read and use, faster to compile, without a GC, statically compiled, without sophisticated things.

                                I think you’re looking for Myddin (still WIP) or possibly Hare. Whether they’re “pythonic” is debatable though.

                                1. 1

                                  Any language should be easy to learn.

                                  Not only easy to run. Easy. Because why would one make it difficult if it clearly can be made easy? The whole point of programming languages is providing simoler alternatives to the targets of their compilers.