news
Programming Leftovers
-
Buttondown LLC ☛ Programming Language Escape Hatches
Rust is the most famous example of mainstream language that trades capability for tractability. Rust has a lot of rules designed to prevent common memory errors, like keeping a reference to deallocated memory or modifying memory while something else is reading it. As a consequence, there's a lot of things that cannot be done in (safe) Rust, like interface with an external C function (as it doesn't have these guarantees).
To do this, you need to use unsafe Rust, which lets you do additional things forbidden by safe Rust, such as deference a raw pointer. Everybody tells you not to use unsafe unless you absolutely 100% know what you're doing, and possibly not even then.
Sounds like an escape hatch to me!
-
Ruby 3.2.9 Released
Ruby 3.2.9 has been released.
This release includes the following security fixes: [...]
-
Ruby 3.3.9 Released
Ruby 3.3.9 has been released.
This release includes the following security fix of default gems:
- CVE-2025-24294: Possible Denial of Service in resolv gem
-
Python
-
Shell/Bash/Zsh/Ksh
-
University of Toronto ☛ Getting decent error reports in Bash when you're using 'set -e'
Suppose that you have a shell script that's not necessarily complex but is at least long. For reliability, you use 'set -e' so that the script will immediately stop on any unexpected errors from commands, and sometimes this happens. Since this isn't supposed to happen, it would be nice to print some useful information about what went wrong, such as where it happened, what the failing command's exit status was, and what the command was. The good news is that if you're willing to make your script specifically a Bash script, you can do this quite easily.
The Bash trick you need is: [...]
-
and the following fixes for build issues: [...]