Programming Leftovers
-
Dirk Eddelbuettel: qlcal 0.0.3 on CRAN: Maintenance and Updates
qlcal is based on the calendaring subset of QuantLib. It is provided (for the R package) as a set of included files, so the package is self-contained and does not depend on an external QuantLib library (which can be demanding to build). qlcal covers over sixty country / market calendars and can compute holiday lists, its complement (i.e. business day lists) and much more.
This release fixes a small bug affecting one function, brings calendar updates from QuantLib 1.27 and 1.28, and applies a little bit of polish to appease clang++-15.
-
Dirk Eddelbuettel: RcppQuantuccia 0.1.1 on CRAN: Maintenance
A minor release of RcppQuantuccia arrived on CRAN today. RcppQuantuccia started from the Quantuccia header-only subset / variant of QuantLib which it brings it to R. This project validated the idea of making the calendaring functionality of QuantLib available in a more compact and standalone project – which we now do with qlcal which can be seen as a successor to this.
-
Alpha-beta pruning illustrated by the smothered mate
In the process of writing it and debugging it, another Recurser and I traced through the execution with a known position where we could calculate the execution. This let us figure out what was going wrong, and also gain some intuition for what the algorithm was doing. I'm going to use that same position here to illustrated alpha-beta pruning. (This is partially so that when I inevitably forget the details, I can come back here and refresh myself!)
-
The case against Effect Systems (e.g., the IO data type)
As Scala developers and fans of the functional programming promoted by Haskell, how do we justify the use of IO to newbies coming from Java? It’s been a fun ride, but the truth is that Java 19 is changing everything.
-
Tree search in Haskell
There are two problems with this. First, the filter is in the wrong place. It says that the search should proceed downward only from the good nodes, and stop when it reaches a not-good node. This isn’t what we want, because it should be up to childrenOf to decide how to continue the search. If the search should be pruned at a particular node, childrenOf should return an empty list of children. For example, when searching for palindromes, the search would be cut off at ab, and never proceed downward to find aba or abccbccba.
But the larger problem is that in most cases the search computes forever without producing any output at all, because the call to s recurses before it returns even one list element.
-
The proper setup of a Go module, as I understand it
I have been a little bit confused about some aspects of Go modules in practice for a while, and to get things more nailed down in my head, I'm writing some entries (writing entries here can be a form of talking to the duck). This is the first one, because before I understand the unusual corner cases I need to cover the normal and proper cases.
-
A deeper look into the GCC Rust front-end
Philip Herron and Arthur Cohen presented an update on the "gccrs" GCC front end for the Rust language at the 2022 Kangrejos conference. Less than two weeks later — and joined by David Faust — they did it again at the 2022 GNU Tools Cauldron. This time, though, they were talking to GCC developers and refocused their presentation accordingly; the result was an interesting look into the challenges of implementing a compiler for Rust. Herron started by saying that he initially found the project too difficult; the Rust language was simply too volatile to try to develop a compiler for it. So he gave up for a while. He kept getting questions about when the work would be done, though, so he eventually restarted the project. The language has been mostly stable since 2015, so the task has gotten a little easier.
There are a few goals for the gccrs project beyond simply compiling Rust code. The work needs to end up in the GCC mainline once it's ready. It should reuse as much of the GNU toolchain as possible. There is also an effort to make the gccrs code as easy as possible to backport to older versions of GCC. Finally, advanced features like link-time optimization should be supported for Rust code.
-
Buy a Perl 5.36 mug and support The Perl Foundation | dean [blogs.perl.org]
Mugs celebrating Perl 5.36 are now available at The Perl Store with all proceeds going to The Perl Foundation
-
Generating Stereo FM Signals, Thanks To Python
A casual understanding of how AM radio works is pretty easy to come by, and standard FM is only a little more complicated. Things can go off the tracks a bit with stereo FM, though — figuring out how they squeeze two separate audio tracks onto one radio signal is a bit of a head-scratcher. In that case, wrapping your head around the concept might be helped by mocking up a stereo FM signal with an arbitrary waveform generator and a little bit of Python.
-
(Re)moving outdated Python tools and scripts [LWN.net]
At the end of September, Victor Stinner reported on a security bug fix he had been working on for a script from the CPython Tools/scripts directory. As part of that work, he realized that there were 74 scripts in that directory that were potentially outdated, unused, unmaintained, trivial, buggy, or some combination of all of those. It is not uncommon for projects to have code that accretes in overlooked corners of the source tree, but it makes sense to periodically take a look to see if changes are needed. Stinner seems to have kicked that off for Python with his message.
The proximate cause was a shell-code-injection flaw in get_remote_certificate.py, which is a thin wrapper around the openssl command-line tool to retrieve a TLS certificate from a site and display it. As Stinner notes, just using openssl directly is "simple enough". So he suggested removing get_remote_certificate.py from the repository entirely for Python 3.12.
-
This Week In Rust: This Week in Rust 465