• 2 Posts
  • 39 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle

  • I mean it could hurt:

    cube:
            push    {r4, r5, r6, r7, r8, r9, r10, fp}
            sub     sp, sp, #112
            add     r7, sp, #0
            str     r0, [r7, #92]
            mov     r3, sp
            mov     ip, r3
            ldr     r1, [r7, #92]
            ldr     r0, [r7, #92]
            ldr     r6, [r7, #92]
            subs    r3, r1, #1
            str     r3, [r7, #108]
            mov     r2, r1
            movs    r3, #0
            mov     r4, r2
            mov     r5, r3
            mov     r2, #0
            mov     r3, #0
            lsls    r3, r5, #3
            orr     r3, r3, r4, lsr #29
            lsls    r2, r4, #3
            subs    r3, r0, #1
            str     r3, [r7, #104]
            mov     r2, r1
            movs    r3, #0
            str     r2, [r7, #80]
            str     r3, [r7, #84]
            mov     r2, r0
            movs    r3, #0
            str     r2, [r7, #64]
            str     r3, [r7, #68]
            ldrd    r4, [r7, #80]
            mov     r3, r5
            ldr     r2, [r7, #64]
            mul     r2, r2, r3
            ldr     r3, [r7, #68]
            strd    r4, [r7, #80]
            ldr     r4, [r7, #80]
            mul     r3, r4, r3
            add     r3, r3, r2
            ldr     r2, [r7, #80]
            ldr     r4, [r7, #64]
            umull   r8, r9, r2, r4
            add     r3, r3, r9
            mov     r9, r3
            mov     r2, #0
            mov     r3, #0
            lsl     r3, r9, #3
            orr     r3, r3, r8, lsr #29
            lsl     r2, r8, #3
            subs    r3, r6, #1
            str     r3, [r7, #100]
            mov     r2, r1
            movs    r3, #0
            str     r2, [r7, #32]
            str     r3, [r7, #36]
            mov     r2, r0
            movs    r3, #0
            str     r2, [r7, #72]
            str     r3, [r7, #76]
            ldrd    r4, [r7, #32]
            mov     r3, r5
            ldrd    r8, [r7, #72]
            mov     r2, r8
            mul     r2, r2, r3
            strd    r8, [r7, #72]
            ldr     r3, [r7, #76]
            mov     r8, r4
            mov     r9, r5
            mov     r4, r8
            mul     r3, r4, r3
            add     r3, r3, r2
            mov     r2, r8
            ldr     r4, [r7, #72]
            umull   r10, fp, r2, r4
            add     r3, r3, fp
            mov     fp, r3
            mov     r2, r6
            movs    r3, #0
            str     r2, [r7, #24]
            str     r3, [r7, #28]
            ldrd    r4, [r7, #24]
            mov     r3, r4
            mul     r2, r3, fp
            mov     r3, r5
            mul     r3, r10, r3
            add     r3, r3, r2
            mov     r2, r4
            umull   r4, r2, r10, r2
            str     r2, [r7, #60]
            mov     r2, r4
            str     r2, [r7, #56]
            ldr     r2, [r7, #60]
            add     r3, r3, r2
            str     r3, [r7, #60]
            mov     r2, #0
            mov     r3, #0
            ldrd    r8, [r7, #56]
            mov     r4, r9
            lsls    r3, r4, #3
            mov     r4, r8
            orr     r3, r3, r4, lsr #29
            mov     r4, r8
            lsls    r2, r4, #3
            mov     r2, r1
            movs    r3, #0
            str     r2, [r7, #16]
            str     r3, [r7, #20]
            mov     r2, r0
            movs    r3, #0
            str     r2, [r7, #8]
            str     r3, [r7, #12]
            ldrd    r8, [r7, #16]
            mov     r3, r9
            ldrd    r10, [r7, #8]
            mov     r2, r10
            mul     r2, r2, r3
            mov     r3, fp
            mov     r4, r8
            mul     r3, r4, r3
            add     r3, r3, r2
            mov     r2, r8
            mov     r4, r10
            umull   r4, r2, r2, r4
            str     r2, [r7, #52]
            mov     r2, r4
            str     r2, [r7, #48]
            ldr     r2, [r7, #52]
            add     r3, r3, r2
            str     r3, [r7, #52]
            mov     r2, r6
            movs    r3, #0
            str     r2, [r7]
            str     r3, [r7, #4]
            ldrd    r8, [r7, #48]
            mov     r3, r9
            ldrd    r10, [r7]
            mov     r2, r10
            mul     r2, r2, r3
            mov     r3, fp
            mov     r4, r8
            mul     r3, r4, r3
            add     r3, r3, r2
            mov     r2, r8
            mov     r4, r10
            umull   r4, r2, r2, r4
            str     r2, [r7, #44]
            mov     r2, r4
            str     r2, [r7, #40]
            ldr     r2, [r7, #44]
            add     r3, r3, r2
            str     r3, [r7, #44]
            mov     r2, #0
            mov     r3, #0
            ldrd    r8, [r7, #40]
            mov     r4, r9
            lsls    r3, r4, #3
            mov     r4, r8
            orr     r3, r3, r4, lsr #29
            mov     r4, r8
            lsls    r2, r4, #3
            mov     r3, r1
            mov     r2, r0
            mul     r3, r2, r3
            mov     r2, r6
            mul     r3, r2, r3
            adds    r3, r3, #7
            lsrs    r3, r3, #3
            lsls    r3, r3, #3
            sub     sp, sp, r3
            mov     r3, sp
            str     r3, [r7, #96]
            mov     r3, r1
            mov     r2, r0
            mul     r3, r2, r3
            mov     r2, r6
            mul     r3, r2, r3
            mov     sp, ip
            mov     r0, r3
            adds    r7, r7, #112
            mov     sp, r7
            pop     {r4, r5, r6, r7, r8, r9, r10, fp}
            bx      lr
    






  • Babylon 5 is a weird show for me. When it was first running, I religiously watched it. If I couldn't watch it live, I got upset and went around my circle of friends to see who'd recorded it so I could watch it as quickly as possible. Up to Season 4 I was gripped. (Season 5 was "meh" because of production shenanigans.)

    Years later I watched them on DVD and … the magic was gone. Watching one episode after another, without separating them by a week, just took the shine off of it. I didn't even finish watching the episodes on DVD; I think I made it to mid season 3 (and the amount I watched slid down and down up to that) before not bothering to continue. I eventually gave them all to a friend of mine and never watched the show again.

    I can't think of a single show I've ever watched that had that weird impact on me: first loved, second bored. Usually shows I loved I keep loving, shows I was bored by remained boring, and very occasionally a show I thought was boring the first time got more interesting on second viewing. But B5? It's the only one that goes this way.


  • I have always understood that C generally compiles almost directly to assembly with little to no abstraction overhead, and it would not require platform-specific ASM code.

    You have always understood incorrectly then. I'd recommend a trip over to Godbolt and take a look at the assembler output from C code. Play around with compiler options and see the (often MASSIVE!) changes. That alone should tell you that it doesn't compile "almost directly to assembly".

    But then note something different. Count the different instructions used by the C compiler. Then look at the number of instructions available in an average CISC processor. Huge swaths of the instruction set, especially the more esoteric, but performance-oriented instructions for very specific use cases, are typically not touched by the compiler.

    In the very, very, very ancient days of C the C compiler compiled almost directly to assembly. Specifically PDP-11 assembly. And any processor that was similar to the PDP-11 had similar mappings available. This hasn't been the case, however, likely longer than you've been alive.







  • I think you're missing a few key points:

    1. It's a COMEDIC series, not a serious drama. It's Adams taking potshots at things that struck him as funny or upset him. Like the whole "shoe event horizon" thing was an eloquent rant about how he couldn't find shoes that fit one day. (No, really!) The fact that it blew up into this massive thing was an accident, not a design, and he didn't set out to write a Serious SF Series™.

    2. The "Britishness" of the relationships is part of that comedy. He's making fun of Brits' "reserve".

    3. The Fenchurch thing never really fit into the vibe, and given the series' entire schtick of random things occurring out of nowhere and then vanishing into nowhere (like the guy whose every incarnation was killed by Arthur Dent), it's on-point for her to just vanish into nothingness. (And as for his reaction, consult point 2.)

    TL;DR Summary

    This is a comedic series best viewed as a collection of incoherent, inconsistent vignettes with an underlying theme (kind of like the more serious The Martian Chronicles of Ray Bradbury), not as a serious space drama spread out over books.



  • The author, w/o explicitly mentioning it anywhere, is explicitly talking about distributed systems where you’ve got plenty of resources, stable network connectivity and a log/trace ingestion solution (like Sumo or Datadog) alongside your setup.

    That is the very core of my objection. He hasn't identified the warrants for his argument, meaning his argument is literally gibberish to people working from a different set of warrants. Dudebro here could learn a thing or two from Toulmin.

    This is a problem endemic to techbros writing about tech. They assume, quite incorrectly, that the entire world is just clones of themselves perhaps a little bit behind on the learning curve. (It never occurs, naturally, that others might be ahead of them on the learning curve or *gasp!* that there may be more than one curve! That would be silly!)

    So they write without establishing their warrants. (Hell, they often write without bothering to define their terms, because "trace" means the same thing in all forms of computer technology, amirite?!) They write as if they have The Answer instead of merely a possible answer in a limited set of circumstance (which they fail to identify). And they write as if they're on the top of the learning heap instead of, as is statistically far more likely, somewhere in the middle.

    Which makes it funny when he sings the praises of a tracing library that, when I investigated it briefly, made me choke with laughter at just how painfully ineffective it is compared to tools I've used in the past; specifically Erlang's tracing tools. The library he's text-wanking to is pitifully weak compared to what comes out of the box in an Erlang environment. You have to manually insert tracing calls (error-prone, tedious, obfuscatory) for example. Whatever you don't decide to trace in advance can't be traced. Whereas Erlang's tracing system (and, presumably Ruby-on-BEAM's, a.k.a. Elixir) lets you make ad hoc tracing calls on live systems as they're executing. This means you can trace a live system as it's fucking up without having to be a precognitive psychic when coding, leaving the costs of tracing at 0 until such a time as you genuinely need them.

    So he doesn't identify his warrants, he writes as if he has the One True Answer, he assumes all programming forms use the same jargon in the same way, and he acts as if he's the guru sharing his wisdom when he's actually way behind the curve on the very tech he's pitching.

    He is a, in a word, programmer.


  • My own thoughts.

    1. Instead of defining the difference between logging and tracing, the author spams the screen with pages' worth of examples of why logging is bad, then jumps into tracing by immediately referencing code that uses a specific tracing library (OpenTelemetry Tracer) without at any point explaining what that code is actually doing to someone who is not familiar with it already. To me this smacks of preaching to the choir since if you're already familiar with this tool, you're likely already a) familiar with what "tracing" is compared to "logging", and b) probably a tracing advocate to begin with. If you want to persuade an undecided or unfamiliar audience, confusing them and/or making assumptions about what they know or don't know is … suboptimal.

    2. If you're going to screen dump your code in your rant, FUCKING COMMENT IT YOU GIT! I don't want to have to read through 100 lines of code in an unfamiliar language written to an unfamiliar architecture to find the three (!) lines that are actually on the fucking topic!

    3. If you're going to show changes in your code, put before/after snapshots side by side so I don't have to go scrolling back to the uncommented hundred-line blob to see what changed. It's not that hard. Using his own damned example from "Step 1":

    // BEFORE
    func PrepareContainer(ctx context.Context, container ContainerContext, locales []string, dryRun bool, allLocalesRequired bool) (*StatusResult, error) {
    	logger.Info(`Filling home page template`)
    
    // AFTER
    var tr = otel.Tracer("container_api")
    
    func PrepareContainer(ctx context.Context, container ContainerContext, locales []string, dryRun bool, allLocalesRequired bool) (*StatusResult, error) {
    	ctx, span := tr.Start(ctx, "prepare_container")
    	defer span.End()
    

    (And while you're at it, how 'bout explaining the fucking code you wrote? How hard is it to add a line explaining what that defer span.End() nonsense is? Remember, you're trying to sell people on the need for tracing. If they already know what you're talking about you're preaching to the choir, son.)

    Of course in "The Result" he talks about the diff between the two functions … but doesn't actually provide that diff. Instead he provides another hundred-line blob kept far away from the original so you have to bounce back and forth between them to spot the differences. Side-by-side diffs are a thing and there's plenty of tools that make supplying them trivial. Maybe the author should think about using them.

    1. The technique this guy is espousing, if I'm reading it right, sounds fine but only in limited realms. This would kill development in my realm (small embedded systems), for example. If you have (effectively, from my domain's perspective) infinite RAM, CPU, persistent storage, and bandwidth, then yes, this is likely a very good technique. (I can't be certain, of course, because he hasn't actually explained anything, just blasted uncommented code while referencing a library he assumes we know about. The only reason I followed any of it is because I'm familiar with Erlang's tooling for this kind of stuff which puts what he's showing off to shame.) But if your RAM is limited (hint: measured in 2-digit KB and shared by your stack(s), heap, and static memory), if your CPU is a blazing-fast 80MHz, and if you think 1MB of persistent storage (which your program binary has to share) is a true bucket of gold in wealth, and, yes, if you're transmitting over a communications link that would have '80s-era modem jockies looking on you with pity, then maybe, just maybe, tracing isn't so great an idea after all.


  • And we all know the first thing writers are taught is “bore the audience to death in the beginning of your story because they’ll stick around for the possibility of things finally picking up”.

    No, wait.

    They’re taught the exact opposite. They’re taught to hook the audience early to induce the interest that keeps people going over the slow parts because they’re already invested.

    A TV show has 3, sometimes 4, episodes to hook me. If I’m not hooked, I’m out. A book has 50 pages to hook me. If I’m not hooked, I’m out. Life’s too short to slog through boring crap on the off chance it gets better. Because it rarely does.


  • I don’t mind people going on and on and on. (I mean I loved Mervyn Peake!) What I hate about Stephenson is how he:

    1. Can’t write people. At all. His “characters” are “concepts with a name attached”. Ugh.
    2. He often goes on and on and on about stuff he’s absolutely wrong about at a fundamental level. (Like his bizarre take on Chinese culture in that one with the nanotech; I’ve forgotten the title. The Diamond Age?)

    One or the other above I can cope with. Both together made me cringe every time I set eye on a page.