• 0 Posts
  • 97 Comments
Joined 1 year ago
cake
Cake day: July 15th, 2023

help-circle





  • lolcatnip@reddthat.comtoRisa@startrek.websiteLogical. Flawlessly logical.
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    1
    ·
    9 months ago

    I think what’s more important then canon is something like an analog of continuity from calculus. A function can be continuous everywhere, which is analogous to having perfect adherence to a canon. It can also have major discontinuities (like 1/x at x=0), which I think of as like a reboot. There are even single-point “removable” discontinuities (like x²/x at x=0), which can be fixed by adding a single point to a function, are more analogous a tiny detail being wrong that doesn’t affect anything else and can probably be fixed with a simple retcon if anyone even cares.

    You can do all kinds of calculations that depend on continuity of a function as long as they’re restricted to parts of the function with only removable discontinuities. Similarly, you can tell perfectly good stories in a broken canon as long as the story doesn’t focus on things in the canon that are broken. Each individual story needs to maintain its own continuity (or else we say it has plot holes), but discontinuities between stories don’t matter as long as stories feel like Star Trek to the audience.

    Of course, feeling like Star Trek is very subjective, and feeling like a bunch of connected stories share the same continuity can be very satisfying, but overall, I agree with Nimoy that fans should just relax and not let discontinuities ruin their enjoyment of a good story.




  • Historically Python has done no semantic analysis at all, and as far as I know CPython still ignores type annotations except for checking their syntax and (I think) checking that type expressions can be evaluated as regular expressions. It’s also one if the slowest languages around, and it used to be much worse in the 1.x days. The only actual declarations are global and nonlocal, unless they’ve added something else recently. Everything else that looks like a declaration is actually a statement executed for its side effects. The super function used to only be callable with two arguments, because automatically supplying self and the lexically enclosing class was considered too magical.

    If you’re looking for something like Java or C#, Python isn’t for you. It was designed for use cases like fancy scripts and small applications that aren’t CPU bound. It’s about as dynamic as a language can be, meaning it’s possible to break almost any analysis you might do with a call to eval, and a lot of what you’d expect to be core language primitives, like accessing a field of an object, can execute arbitrary code.





  • I disagree about comparing languages by speed. Just because you can make Go programs as fast as Rust programs, it’s not going to be as straightforward as doing it in Rust. I’d much rather spend slightly more effort up front to write idiomatic Rust code that’s fast by construction than try to make Go code faster by applying a bunch of arcane tweaks to it.


  • You can leak memory in Rust if you want to (and it’s occasionally desirable). What the type system prevents is mainly accessing memory that has been deallocated. The prevention of memory leaks uses RAII just like C++. The main difference related to allocation is that there’s no “new” operator; you can pretty much only allocate memory through the initialization of a smart pointer type.