• 3 Posts
  • 118 Comments
Joined 2 years ago
cake
Cake day: June 14th, 2023

help-circle
  • Some of those details are portable, particularly the behavior of code objects. Function declarations (def statements) bind code objects to names within a namespace; binding within a class namespace will create methods by calling the declared metaclass, which defaults to the type() builtin type object.

    Some other details are not portable. CPython stores code objects on the C heap and allocates generic closures; it supports either a dict from strings to locals, or user-declared slots naming a tuple of locals. PyPy automatically computes slots in all cases and supports the dict as a special case. Threads generally share a single heap per interpreter, so the creation of threads doesn’t matter for declaring or instantiating objects; note that the community makes this work by pushing the convention that .__init__() methods should not do computation and instead should merely initialize the locals, akin to similar conventions in C++. That said, Jython threads are Java threads, not OS threads like in CPython or PyPy, so normal assumptions about threading may not hold.

    You will have to let go of some of your practices around memory management. Python is memory-safe and garbage-collected by default; while sometimes you’ll want to remove names or map keys with del, it usually isn’t necessary. Similarly, while there are maybe a half-dozen ways to customize class creation and memory layout, it’s almost never actually necessary to use more than one of them at a time. Instead, stick to writing Pythonic code, and let runtimes like PyPy worry about performance. PyPy goes fast by simplifying what happens under the hood; if it exposed guaranteed internal structure then it would be slower.


  • In terms of the standard principal programming paradigms, Python is on the right-hand side in the “Shared state” column. Note two interesting things: first, Python’s box is represented by Java and OCaml; second, the box has two labels, “Sequential object-oriented programming” and “Stateful functional programming”. Python is technically a prototype-based language like ECMAScript, but it can be seen as either object-oriented or functional depending on whether we think of prototypes as classes or closures respectively.

    Note that unlike “Imperative programming”, represented by Pascal and C, Python has closures. It does have closure quirk, also called lambda quirk, which ruins an otherwise-lexically-scoped language, but folks with lots of Python experience are used to working around closure quirk. Python functions are not procedures; they are sugar for objects with a .__call__() method.

    If this is your first time with the principal paradigms, please keep in mind the following quotes. First, from the associated book:

    More is not better or worse than less, just different.

    That is, Turing-completeness doesn’t have a canonical set of computational features. Second, from the chart PDF:

    Two languages that implement the same paradigm can nevertheless have very different “flavors” for the programmer, because they make different choices on what programming techniques and styles to facilitate.


  • This is for short-lived cloud-allocated (virtual) machines which have an IPv4 address but not necessarily a DNS presence. When there are more than a handful of machines, name management becomes its own unique pain; often, the domain names of such a machine are an opaque string of numbers under some subdomain, and managing the name is not different from managing the raw IP address instead. Similarly, for the case of many machines all serving a wildcard (e.g. a parking page) allocating a single IP-address certificate might be preferable to copying the wildcard certificate to each machine.

    As you point out, though, SSH exists and has accumulated several decades of key-management theory. Using HTTPS instead of SSH for two machines with one owner is definitely not what I would do. I’ve worked at all scales from homelabs to Google and I can’t imagine using IP-address certificates for any of it.

    Now, with all of that said, if Let’s Encrypt were available over e.g. Yggdrasil then there would be a use-case for giving certificates directly to IPv6 addresses and extending PKI to the entire Yggdrasil VPN. That seems like a stretch though.



  • Put a rescue distro on a USB stick. When you first boot the laptop, use the rescue distro. Write down the USB IDs (lsusb) and PCI IDs (lspci). Read through the kernel boot log (sudo dmesg | less) and write down the names of any kernel drivers that might matter; WiFi, GPUs, USB bridges, and keyboard layouts are important in particular. For laptops, look up manufacturer-specific drivers for keyboards, fans, and power management.

    Linux requires about 8MiB of RAM to boot. The entire netbook movement relied on machines with 2GiB or less; I remember putting Linux onto a 2GiB Sony VAIO that had struggled to boot Windows. Your laptops aren’t too small, but you may be choosing distros with poor hardware support or large monolithic packages. I bet that one of Debian, Gentoo, or NixOS would boot on those machines that still work; of those, Debian is probably easiest.

    Old laptops sucks. Windows use to be very efficient. XP and 7 has held up very well after all these years. And most importantly Linux isn’t a one size fits all solution.

    Nah, Windows sucked back then too. If a machine boots Windows XP or Windows 7, then it can easily be made to boot an out-of-the-box Linux distro. The Asus machine you listed might have some boot issues, but the Acer and Dell do not appear different from any of the Acers or Dells that I’ve put Linux on in the past decade. My daily driver is a $150 refurbished Dell Latitude 5390 running NixOS.





  • I would rather use Magic Wormhole if I have to have an intermediate server operated by somebody else.

    Your protocol isn’t documented enough to allow interoperability. It is important for folks to be able to develop their own clients and frontends; the ecosystem becomes richer and more resilient to attacks when there are many different implementations.

    I’m not sensing an awareness of capabilities. Access to a file is one of the classic examples of a capability and a file-sharing system should be oriented around ensuring that references to files are unforgeable and copyable.

    The terms of service are unacceptable and I won’t be trying out the product. I can point at exactly what’s wrong; talk to your attorney for details.

    Users are expected to respect the intellectual property rights of others when using the app.

    You don’t understand what file-sharing technology is used for.

    We reserve the right to introduce tools and technologies for monitoring the performance of the app and improving its functionality. By using the app, you acknowledge and agree to this potential monitoring.

    Ah yes, because telemetry has never been met with user backlash.

    The company does not collect user data, apart from what is needed for monitoring tools to ensure the app’s stability and to make improvements.

    You don’t need user data for that. Y’know what’s a lot easier? Just don’t collect user data!

    We may also use Sentry.io for error monitoring and NLevel Software for analytics.

    I block those.

    The app may include functionality to report users, and we reserve the right for this functionality to send necessary details for any investigation.

    Ah yes, completely fair that somebody accused of misbehavior gets their local data exfiltrated too.

    Meanwhile Magic Wormhole merely tells us that it is MIT licensed and we can do whatever we like with it.



  • Pick a language like Perl, where some packages are written in C and some are written in pure Perl, and you’ll get to experience the same cryptic GCC errors, sometimes. There’s no secret to pip; many Python developers upload wheels with pre-compiled binaries, including Windows-compatible binaries, and so you don’t have to run GCC because they already did it for you.




  • Corbin@programming.devtoProgramming@programming.devWhy fastDOOM is fast
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    4 months ago

    For what it’s worth, most of your comments aren’t eligible for copyright; they aren’t sufficiently original or information-packed. Just like @onlinepersona@programming.dev and their licensing efforts, it’s mostly a vanity to attach a license to unoriginal one-line throwaway jokes. I wouldn’t say that it’s arrogant so much as lacking in self-awareness; a one-liner must be deeply insightful, contain a pun or paraprosdokian, address the current zeitgeist, or otherwise be memorable above and beyond the time and place that contextualized it.


  • Well, here is a very funny one-off commit, but my biggest effort was probably substantial parts of a couple AMD/ATI GPU drivers, well-summarized here. As usual, that was a team effort, with particular credit to Deucher (AMD), Glisse (radeon maintainer), and Airlie (DRM/DRI maintainer). So, put up or shut up. Or, to paraphrase the sentiment that you seem to not grok: talk is cheap; show us your code.

    Let me make it clear. I call out brigading because it is useless noise that distorts and obfuscates the kernel development process. I don’t care that you’re salty that I’m pointing out that your “absolute crickets” comment is not only incorrect, but empty in the sense that your lack of perception is not a substitute for the actual process of kernel development. Additionally, in this case, it seems like you’re still focused on personalities rather than the underlying computer science; I expect “absolute crickets” when asking you about the topic of memory safety.







  • Your argument is completely specious. Re-read that list. Assembly is a second language in the kernel already, and really it’s multiple languages, one per supported ISA. Perl and Python scripts are used to generate data tables; there are multiple build-time languages. eBPF is evaluated at runtime; the kernel contains bytecode loaders, JIT compilers, and capability management for it. The kernel has already paid the initial cost of setting up a chimeric build process which evaluates many different languages at many different stages.