Programming Leftovers
-
Robin Schroer ☛ Extension Traits
Rust allows us to implement a trait for a type as long as we own either the trait or the type. This means we cannot implement Iterator for u32, but we can implement Iterator for MyType, and we can implement MyTrait for u32.1 The former is very common, either through the derive macro like #[derive(Copy, Clone, Debug)], or explicitly like when we implement Display for a type.
-
Dirk Eddelbuettel ☛ #46: Adding arm64 to r2u
r2u, introduced less than three years ago in post #37, has become a runaway success. When I last tabulated downloads in early January, we were already at 33 million downloads of binary CRAN packages across the three Ubuntu LTS releases we support. These were exclusively for the ‘amd64’ platform of standard (Intel or AMD made) x64_64 cpus. Now we are happy to announce that arm64 support has been added and is available!
-
Bertrand Meyer ☛ Blog Archive New preprint: Lessons from Formally Deployed Software Systems
The paper resulted from an attempt to identify as many such formally-verified systems actually deployed in industry as possible. Some of the projects were selected thanks to a questionnaire that we sent out to many forums; others were found through a variety of sources. Out of many initially identified projects the articles covers 32; other than interest and relevance, the criteria for selection included our ability to find detailed information about them and verify that information. Whenever possible we used published accounts, but for some of the most interesting systems deployed in industry little is available in the literature; we only retained those for which we could get and validate information from the projects themselves, over the course of many interactions.
-
Chloé Vulquin ☛ Floating Points & Boxes
Computers deal with numbers, big and small, but must do this with real-world constraints (how big your CPU registers are, and how big your RAM is). As a consequence, CPUs tend to understand two types of numbers natively. The first, called integers, are perfectly accurate, and represent a whole number (either exclusively positive, named unsigned integers, or both positive and negative, named signed integers, or just “integers”). These have a strict size limit of 2 to the power of the size of the register (so on most modern CPUs, 2^64 for unsigned integers). The second can represent partial numbers and numbers that are bigger than this, at the cost of (potentially) losing precision. These are called floating point numbers, and are defined by the IEEE 754 specification.
There’s a bunch of explanations online about how floating points ACTUALLY work internally, but basically none of them that I’ve read have went into the kind of detail I wanted. I wanted1 to understand them well enough I could implement them in software, and know how I can manipulate them safely. I got there! The goal of this post is to get you there, without needing to buy a copy of the standard.
-
Fabian Sanglard ☛ Why fastDOOM is fast
Before digging into fastDOOM, let's understand where the code comes from. DOOM was originally developed on NeXT Workstation. The game was structured to be easy to port with most of the code in a core surrounded by small sub-systems performing I/O.
-
Zig ☛ Devlog ⚡ Zig Programming Language
Lately, I've been extensively working with C interop, and one thing that's been sorely missing is clear error messages from UBSan. When compiling C with zig cc, Zig provides better defaults, including implicitly enabling -fsanitize=undefined. This has been great for catching subtle bugs and makes working with C more bearable. However, due to the lack of a UBSan runtime, all undefined behavior was previously caught with a trap instruction.
-
Michal Měchura ☛ Falsehoods programmers believe about languages
I can’t believe nobody has done this list yet. I mean, there is one about names, one about time and many others on other topics, but not one about languages yet (except one honorable mention that comes close). So, here’s my attempt to list all the misconceptions and prejudices I’ve come across in the course of my long and illustrious career in software localisation and language technology. Enjoy – and send me your own ones!
-
Geoffrey Litt ☛ Avoid the nightmare bicycle
In my opinion, one of the most important ideas in product design is to avoid the “nightmare bicycle”.
Imagine a bicycle where the product manager said: “people don’t get math so we can’t have numbered gears. We need labeled buttons for gravel mode, downhill mode, …”
-
Andy Wingo: whippet lab notebook: on untagged mallocs
Salutations, populations. Today’s note is more of a work-in-progress than usual; I have been finally starting to look at getting Whippet into Guile, and there are some open questions.
inventory
I started by taking a look at how Guile uses the Boehm-Demers-Weiser collector‘s Hey Hi (AI) to make sure I had all my bases covered for an eventual switch to something that was not BDW. I think I have a good overview now, and have divided the parts of BDW-GC used by Guile into seven categories.
-
Applications
-
Ruben Schade ☛ MacVim now has fancy tabs
I like them! They give me 1990s Lotus SmartSuite vibes somehow.
-
-
Perl / Raku
-
Sparrowdo ☛ No code CI for Raku modules – Sparrowdo
Hey, community! CI has always been an essential part of module development. However we are “lazy” and “busy” and … whatever … ) So, why spent time on it if there is already free and no code CI system to use – https://sparky.sparrowhub.io
-
DEV Community ☛ Sourcing: Part 1 – Exploring Event Sourcing in Raku - DEV Community
I’ve been studying a very interesting approach to building systems called Event Sourcing. In event sourcing, every change to an application’s state is captured as an immutable event. Instead of storing only the current state, you persist a sequence of events that record all the actions that have taken place. This approach not only allows for an accurate reconstruction of the system state by replaying events but also provides a robust audit log and improves debugging and analysis capabilities.
-
-
Python
-
Python ☛ The features of Python's help() function
Let's take a look at all 6 uses of help. We'll start with the most common 3 uses: functions, modules, and all other objects.
-
Noë Flatreaud ☛ Real-time notifications with Flask and Server-Sent Events (SSE)
Server-Sent Events (SSE) offer a straightforward way to push real-time updates from a server to a client. Unlike WebSockets, which enable two-way communication, SSE is designed for one-way communication from the server to the client. This makes SSE an excellent choice for applications that need to send notifications, updates, or messages to clients without full-duplex connections. If you need to implement real time notifications in Flask by hand, you might find this post relevant.
-