Programming Leftovers
-
Robin Schroer ☛ Navigating the Rust TLS Landscape
Both the most popular Rust HTTP client reqwest and the probably most popular web framework axum are built on top of hyper, a low-level HTTP library. hyper itself does not support TLS, which is needed to make HTTPS requests or serve them, but rather provides an interface that allows users to bring their own TLS implementation that fits their requirements. As a consequence, reqwest has a whole collection of compile-time feature flags to allow users to select a TLS implementation, but is somewhat light on how to make that choice. This article is aiming to provide a high-level overview.
-
Dirk Eddelbuettel ☛ RcppZiggurat 0.1.7 on CRAN: New Generators, Many Updates
The RcppZiggurat package updates the code for the Ziggurat generator by Marsaglia and others which provides very fast draws from a Normal distribution. The package provides a simple C++ wrapper class for the generator improving on the very basic macros, and permits comparison among several existing Ziggurat implementations. This can be seen in the figure where Ziggurat from this package dominates accessing the implementations from the GSL, QuantLib and Gretl—all of which are still way faster than the default Normal generator in R (which is of course of higher code complexity).
-
Rlang ☛ Learning To Create an R Package With Deliberate Redundancy 🤣 A Note For Myself
🙈 Made a hilariously redundant R package for a simple Proprietary Chaffbot Company calls, but the real win was finally learning how to build an R package! 🛠️ Is it efficient? Absolutely not!Was it worth the time and experience? Yes! Will I do it again? Yes! Will it break?
-
Perl / Raku
-
Golang
-
Redowan Delowar ☛ Three flavors of sorting Go slices
There are primarily three ways of sorting slices in Go. Early on, we had the verbose but flexible method of implementing sort.Interface to sort the elements in a slice. Later, Go 1.8 introduced sort.Slice to reduce boilerplate with inline comparison functions. Most recently, Go 1.21 brought generic sorting via the slices package, which offers a concise syntax and compile-time type safety.
These days, I mostly use the generic sorting syntax, but I wanted to document all three approaches for posterity.
-
-
Rust
-
Alex Gaynor ☛ Notes on coreutils in Rust
Lastly, I want to consider a different benefit to Ubuntu of doing the work to enable switching to a Rust implementation of coreutils: that the process of doing so will inevitably uncover, and require resolving, innumerable blockers to using Rust for core parts of the distribution. And that the work of doing so will pave the way for using Rust for other pieces of the distribution that do benefit from Rust’s memory safety.
-