Programming Leftovers
-
Rlang ☛ Unveiling Power Regression: A Step-by-Step Guide in R
In the realm of statistics, power regression stands out as a versatile tool for exploring the relationship between two variables, where one variable is the power of the other. This type of regression is particularly useful when there’s an inherent nonlinear relationship between the variables, often characterized by an exponential or inverse relationship.
-
University of Toronto ☛ Go's API stability and making assumptions, even in semi-official code
Right now, there are some Go programs, such as errcheck, that will work if you build them with Go 1.21 but fail if you build them with the latest Go development version. In fact they will panic deep in the Go standard library, specifically in go/types. Given Go's promises about compatibility, you might expect that this is an error in the development version of Go, especially since the path to the panic goes through golang.org/x/tools, which is also written by the Go developers (although it's not stable and its own API isn't covered by compatibility guarantees). However, it's not a Go problem (cf, also). Instead, it shows either how tricky API compatibility is in practice or alternately how almost anyone can fall prey to Hyrum's law (obligatory xkcd).
-
Jake Lazaroff ☛ Web Components Eliminate JavaScript Framework Lock-in
Those aren’t the only options, though. You can also use web components in tandem with JavaScript frameworks. To that end, I want to talk about a key benefit that I haven’t seen mentioned as much: web components can dramatically loosen the coupling of JavaScript frameworks.
To prove it, we’re going to do something kinda crazy: build an app where every single component is written with a different framework.
-
Miguel Young de la Sota ☛ Designing a SIMD Algorithm from Scratch
Another explainer on a fun, esoteric topic: optimizing code with SIMD (single instruction multiple data, also sometimes called vectorization). Designing a good, fast, portable SIMD algorithm is not a simple matter and requires thinking a little bit like a circuit designer.
-
Python
-
Daniel Lemire ☛ A simple WebSocket benchmark in Python
Modern web applications often use the http/https protocols. However, when the server and client needs to talk to each other in a symmetrical fashion, the WebSocket protocol might be preferable. For example, if you want to program a multiplayer video game, the WebSocket protocol is almost surely better than http. In A simple WebSocket benchmark in JavaScript, I showed that JavaScript (through Node.js) can produce efficient WebSocket servers, at least in the simplest cases.
-