Threads for chadcmulligan

  1. 5

    This paper (and, more pertinently, its associated website) have been circulated broadly, but I’m a bit disillusioned with it.

    Its ‘antialiasing’[0] is only approximate (and, empirically, people say it looks bad). Its proposed solution to this is basically multisampling, which is not so nice (especially after its creator criticised another renderer for using multisampling for antialiasing). A good heuristic to decide when to multisample requires taking 4 samples anyway, just the same as you need in order to decide how to do analytic ‘antialiasing’. (Incidentally, pathfinder and most cpu-based solutions use trapezoidal ‘antialiasing’; I wonder why no one uses analytic integrals?)

    Its space partitioning could be improved (one easy start is to use binary search or interpolation search).

    Its per-vertex calculations are a bit slow compared with a method which pre-calculates coefficients. Perhaps this was an intentional choice, to reduce memory usage, but clever algebraic manipulation can get rid of all the divisions and square roots in the happy path (i.e. when not needing to compute analytic coverage), which seems rather significant. (These precalcuations can also be performed at high precision, improving numerical accuracy slightly, though this is likely not very significant at popular resolutions and bit depths.)

    The patented portion (using a bitfield as a lookup table) is indeed original, but pretty frivolous; and its creator’s (implied) claims that other methods are not robust seem especially frivolous when you consider that the patented portion is basically just a souped-up range check[1]. Add to which that you should be doing bounds checks anyway, as part of your space partitioning, and, well…


    All of which is not to say that slug is bad, just that it’s not particularly good, either, and it’s certainly not all it’s cracked up to be. It does well enough for games. Compared with pathfinder, it has one major advantage, which is that it’s fragment-oriented rather than scanline-oriented; but it is possible to produce a much nicer fragment-oriented renderer.


    0: The term ‘antialiasing’ as used in computer graphics is a lie which has nothing to do with its signal-processing definition, and might better be called ‘blurring’.

    1: Don’t believe me? Look at fastuidraw git history; it formerly used the patented technique, but switched to range checks with fairly little disruption.

    1. 1

      The term ‘antialiasing’ as used in computer graphics is a lie which has nothing to do with its signal-processing definition, and might better be called ‘blurring’.

      It took me a long time to realise this when learning computer graphics, I’m probably not alone.

    1. 7

      I have been working on a personal replacement for ncurses, for use in my own projects. It does not have a lot of features yet (colour, for example), but I am continually improving it.

      https://github.com/opFez/tui-lib

      1. 1

        I’ve been doing something similar for TUI windowing/controls on Windows, in the hope that with a good library for it, I’d write useful TUI programs. Unfortunately that second part has proven hard - I haven’t found many problems where TUI seems better suited than CLI. Do you have any TUI applications in mind that you’d like to see?

        https://github.com/malxau/yori/tree/master/libwin

        1. 1

          Personally, I’m writing the quintessential rogue-clone for my library. After that, I’ll probably start work on a text editor. That’s just my ideas though, I do understand if you want to do something innovative, but in that case I can’t help you.

          1. 1

            Admin panels of various sorts, IMO. Things like the Services admin window, where I can open/close things. Site checkers that report up/down.

            Those are the things I’d write as TUIs

          2. 1

            Wow, I wrote a curses replacement in the 80’s to run on DOS, definitely a lot of fun.

            Edit: remembered some details I wrote it in Turbo C and used a telnet library but the library I had was the small memory model, so the program was a maximum of 64KB. I could only implement a subset of curses because the program exceeded 64k, the large model library cost money, so 64K it was. It was used quite a bit iirc.

          1. 2

            Does knowing mathematical induction help? It did for me, but not sure if it would help non math folk, though induction is pretty straight forward I’ve always felt.

            1. 3

              Knowing induction helps with understanding recursion, but teaching induction to those who don’t have it is one of the harder things. They’re slippery concepts to grasp, for similar reasons.

              1. 1

                namely: for everything except the base cases, you make the thing work by assuming the thing already works and using the thing as a component of itself. But you have to shut up the part of your brain that asks “how am I supposed to assume the correctness of f when I haven’t even finished writing it yet? (or, for induction, when that’s the thing I’m supposed to be proving?). It’s kind of like a deferred constraint, everything snaps together in the end, but you have to deal with something that feels wrong when it’s half-finished.

            1. 1

              I remember first learning about CG and reading about this - it caused me a lot of confusion, because that’s the theory but in practice no one does this. One of the most frequent ways is down size a double size image, and as @kornel says font hints

              1. 2

                […] but to ensure that the next generation of software developers are given a firm grasp on fundamental programming concepts; concepts that represent the building-blocks that all software rests on; a curriculum that has taken heavy damage from the adoption of Java and C# in the early 2K’s.

                Anyone who actually used Delphi, please enlighten me. What’s better than in Java? I’m not saying Java’s OOP is in any way superior, but I don’t see huge differences in quality to any other OOP language I ever used.

                PS: I didn’t like Turbo Pascal, but that doesn’t mean I hadn’t given Delphi a chance, it just never crossed my path.

                1. 4

                  The big thing about Delphi isn’t the language imho, its the VCL - the visual component library that Delphi comes with, it allows drag and drop development of apps very easily. The VCL is itself written in Delphi, and it comes with the source code for it that you can step through to debug. You can write you’re own components in Delphi as well and install them in the Delphi IDE (this does have some downsides as you can crash delphi if your component has a bug).

                  C# has these things but you have to carry around the C# runtime (same with Java), Delphi compiles to a single executable making your apps very easy to distribute.

                  Delphi is also fast - as fast as C in most cases - it has pointers and so on to allow you to do everything you can in C.

                  1. 2

                    Yeah I heard GUI stuff in Delphi was good, I liked the Visual Basic 5/6 gui editor and from what I’ve heard that one wasn’t as good…

                    But that’s not really regarding OOP, tbh. And while your points all make sense, they do not answer the question at all :P

                    1. 1

                      You asked “What’s better than in Java?”, thats some of the things that are better than in Java.

                      As I mention Delphi isn’t just the language - object pascal is just another object oriented language, not particularly impressive imho, but it does the job. The thing Delphi has which is different is the VCL and language support for Visual Components. C# has some similar component features (it was architected by the same guy), but Delphi has some advantages over C# as I mentioned. I’d recommend downloading the free community one and have a look if your curious, its very different from what you’d be used to in Java.

                      1. 2

                        Rereading it, yes, sorry, it’s a little unclear, I specifically meant the OOP part, because I mention Java OOP and that s what imho the author of the link was arguing with the perceived damage.

                        1. 2

                          No problemo, the Delphi language is pretty standard, It’s been a few releases since I’ve used Java but language features migrate into other languages eventually. My other reply mentions a few shortcomings I find in the object Pascal language. tbh those sort of things really don’t matter that much in Delphi - the VCL (and firemonkey) sort of trumps any shortcomings the language has.

                          If you were asking which language is better object pascal or Java - I’d probably say Swift :-), but its not an apples to apples comparison - Delphi is so much more than just the language.

                1. 2

                  Not only will it help the next generation of students learn proper programming from the ground up

                  I don’t really want to hate on Delphi because I do like slightly obscure languages, but I feel like the industry is kinda moving towards function-style programming (with a lot of languages, including even Java, adopting things like map and fold, lambda functions). To the best of my knowledge, Delphi doesn’t have anything like this (correct me if I’m wrong). Why not just teach people C, C++, Rust, Go, Python using freely-available compilers, big communities and a lot of support and more modern from a PLT standpoint?

                  1. 12

                    Empowering new programmers to make GUI apps through a visual form editor is a great way to get confidence. Even if you don’t have the core logic of the app in good shape, you can at least see and interact with something.

                    Contrast that with the text-centric design philosophy of web UI design.

                    1. 3

                      I wrote a fart app with my nephew in less than an hour with delphi (actual coding was a couple of lines), he thought it was great - pressing buttons making fart sounds, it doesn’t get any better.

                      1. 2

                        That’s great. That’s the real vision of making computing accessible: easy things should be easy.

                        There’s so much lip service paid to accessibility and yet we’re over-eager to continue stacking poor abstractions atop one another, further hindering discoverability in the process.

                      2. 1

                        Good point. I grew up with text-centric design, but I see how that might help some people

                      3. 3

                        You can do functional programming in Delphi now, its changed a lot over the years https://dzone.com/articles/fun-with-anonymous-methods-using-higher-order-func though the syntax is a bit messy imho, but look at the functional syntax in C++ :-)

                        The latest version also supports type inferencing. It has generics, pretty well everything other languages have. It also has a lot of stuff other languages don’t have - Visual Component Library (VCL), Years of components available, free and paid, drag and drop development for GUI apps, the ability to create your own components which you can include in the IDE, it produces a single .exe file for easy distribution.

                        I do find the language a bit verbose compared to things like Swift, but with the type inferencing engine this may improve. The need to predeclare things in a separate declaration and implementation section I also find a bit dated.

                      1. 3

                        This is a huge comeback for Delphi, so good to see. Their tools are still one of the best in class

                        1. 5

                          I know this isn’t for everyone - in general the activity itself used to get a really bad rap and is pretty pricey - but since I accidentally started CrossFit about two years ago, all sitting related pain (and even most RSI-related pain) has disappeared. I couldn’t recommend some form of weightlifting + short HIIT cardio enough.

                          1. 7

                            I’m curious to learn how one accidentally gets into fitness.

                            1. 2

                              Haha, sure, short story time: we got accepted to be part of the the NYC Summer 2017 cohort at Techstars. My co-founders and me rented a place in Brooklyn. After a couple of weeks of 12+ hours in the co-working space, eating poorly and waking up in the middle of the night thinking about my Kanban board, I decided that I needed to find something that’d get me tired enough that I’d just sleep.

                              The closest gym to the apartment turned out to be a CrossFit gym with a great summer promo. One of my best friends had started CrossFit a year prior and was very happy with it, so I decided to give it a go. If I hated it I’d just use the gym as a free-weight facility. The very first ‘on-ramp’ class (which is designed to be a very light version of it) I almost died. I walked home in a daze, laid on a couch to catch my breath and passed out for an hour. I realized how badly out of shape I was.

                              So, I stuck with it. One of the things that surprised me is just how friendly people were. Everyone was helping everyone else: giving tips on form, recommending scaled versions of exercises (“don’t try this yet, do this other thing to build strength instead”), cheering if you were the last one, and general camaraderie. The ‘beasts’ weren’t trying to compete with the newbies, but rather everyone was on their own lane and high-fived everyone else after the workout. The feeling of ‘going through this shit together’ definitely helps build a sense of community that’ll keep you coming back.

                              I was worried I’d drop it once we came back to the Bay Area. Agonized a bit with finding the ‘perfect box’ (gyms in NYC are pretty high end) and struggled with sticker shock (going from a $50 a month promo to ~$200 was painful), but once I settled on a box and went back to it, I couldn’t be happier.

                              1. 1

                                Nice, that sounds great. I fit into the “skinny-fat” category due to a fast metabolism and a sedentary lifestyle. I am relocating to the Bay Area in a few months and am thinking about bulking and cutting once I get there. I lurk in /r/brogress and other places so I’ve bookmarked a bunch of resources.

                                Thanks for sharing!

                            2. 3

                              I do studio pilates and find the same. Maybe it’s just getting things moving. My personal theory is you need all the muscles working to hold everything together, particularly all the little muscles. Hours of sitting or not moving means the little muscles atrophy and things rub against each other that shouldn’t which causes pain. There’s also theories about the fascia needing release, but who knows. I think the main thing is you need some sort of regular exercise to keep things working.

                              1. 3

                                I highly recommend regular calisthenics practice in general. Convict Conditioning is a good book. I’ve written about my thoughts here.

                                1. 2

                                  Glad to hear I’m not the only one. I couldn’t tell if the reason I don’t experience sitting-related pain is because my age or if it’s because my back takes enough of a beating already, but your comment makes me think the latter.

                                1. 2

                                  Functional programming is all about in-group signaling and sunk costs

                                  1. 2

                                    That was a nice piece of trolling given it had some truth mixed in with it. There’s definitely cult-like behavior around some of these languages. That said, there’s individuals and companies using them because they have real benefits. @Yogthos already commented on it with some of them. Destroyed the original claim, too.

                                    I’ll just highlight a few traits of CL as a non-CL user that impress me. Powerful/easy macros, any paradigm not already supported is easy to add (esp adding aspects just took a library), REPL environments for fast development, optimized compiles for delivery, can compile a single function after changing it, and live updates to running environment. If you’re correct, then C, C++, Java, .NET, PHP, Python, etc. had all these capabilities as they got popular since CL was nothing special. Alternatively, these are all useless with only masochistic zealots using them while those other languages, their IDE’s, and ecosystems never adopted or attempted any of those capabilities.

                                    The additions of CL-like features to some of those languages, their IDE’s, and external projects they keep attempting suggests there’s some actual advantages to CL’s design and capabilities. Its capabilities from the 1980’s or earlier (i.e. Genera). Being so far ahead and so flexible attracts many bright minds who become obsessed with it. It also attracts ordinary developers who simply want its capabilities, in CL or another preferred language. A combination of crowds with varying motivations. That’s my theory.

                                    1. 2

                                      I agree with the overall notion in the article, but some of the examples given are just terrible. Avoiding global variables isn’t something specific to lisp or functional programming; it’s just called good programming. Even in an unabashedly imperative Algol-like language like Lua, experienced programmers refuse to use globals in nontrivial codebases, because it makes things harder to understand.

                                      1. 2

                                        “why strict churches are strong”

                                        fascinating idea. thanks for posting.

                                        1. 2

                                          Good article - here’s a link to the paper by Sosis and Bressler that seems to be broken in the article http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.500.5715&rep=rep1&type=pdf

                                          1. 2

                                            Thanks. Fixed the link.

                                        1. 1

                                          No ones mentioned Appcode - my Swift IDE of choice.

                                          1. 3

                                            many JS programmers aren’t very good at it and they make ecosystem-defining libraries anyway

                                            every PHP programmer is bad at programming

                                            it’s hard to see your technical arguments when you use personal comments like this

                                            1. 1

                                              Yeah - I know several amazing programmers working on wp-core. They’re willing to use PHP in return for a chance to work on the tech that powers nearly 1/4 of all websites.

                                              1. 1

                                                There are some perhaps, but they are the exception.

                                                Like the author I have stopped paying attention to JS developers and their latest frameworks, they show a lack of knowledge of CS and reinvent small parts of systems that have existed elsewhere for a long time and present them as something new.

                                                No doubt there are some exceptions, but its to hard to find them as the bulk of JS developers can’t tell the difference.

                                                Just to be clear I’ve used both because I’ve had to, but if I wanted to build something knew there are better languages. This isn’t personal, merely an observation of JS developers in general, again there are exceptions but the signal to noise ratio is too low.