Russ Allbery: Review: The Martian Contingency
| Series: | Lady Astronaut #4 |
| Publisher: | Tor |
| Copyright: | 2025 |
| ISBN: | 1-250-23703-3 |
| Format: | Kindle |
| Pages: | 390 |
| Series: | Lady Astronaut #4 |
| Publisher: | Tor |
| Copyright: | 2025 |
| ISBN: | 1-250-23703-3 |
| Format: | Kindle |
| Pages: | 390 |
A maintenance release 0.9.14 of the RcppClassic
package arrived earlier today on CRAN, and has been built for r2u. This package
provides a maintained version of the otherwise deprecated initial Rcpp
API which no new projects should use as the normal and current
Rcpp API is so much better.
A few changes had cumulated up since the last release in late 2022.
We updated continuous integration scripts a few times, switched to
Authors@R in DESCRIPTION, and rejigged build scripts a
little to accommodate both possible build architectures for macOS. We
also updated the vignette by updating all reference and switching the
new asis vignette builder now available in Rcpp.
CRANberries
also reports the changes relative to the
previous release from 3 1/2 years ago. Questions, comments etc
should go to the rcpp-devel
mailing list off the R-Forge page.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
Yet another maintenance release of the tidyCpp
package arrived on CRAN this morning, a mere week and a half after the
previous release. It has been built for r2u as well. The package
offers a clean C++ layer (as well as one small C++ helper class) on top
of the C API for R which aims to make use of this robust (if awkward) C
API a little easier and more consistent. See the vignette for motivating
examples.
This release, just like the preceding
one less than two weeks ago, had its hand forced by an overnight
change in R-devel. The breakage this created has since been reverted in
R-devel but as the writing is on the wall are now removing the
definition involving these accessors preemptively. We were also missing
version checks for two newly added alternates.
Changes are summarized in the NEWS entry that follows.
Thanks to my CRANberries, there is also a diffstat report for this release. For questions, suggestions, or issues please use the issue tracker at the GitHub repo.Changes in tidyCpp version 0.0.10 (2026-03-15)
- Hide five accessors as underlying macros removed from Rinternals
- Preemptively hide another accessor
- Ensure two definitions are conditional on R 4.5.0 or later
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
Another maintenance release of the RcppCNPy
package arrived on CRAN today,
and has already been built as an r2u binary. RcppCNPy
provides R with read and write access to NumPy files thanks to the cnpy library by Carl Rogers
along with Rcpp for the glue to R.
The changes are minor and similar to other recent changes. We aid Rcpp in the transition away from calling
Rf_error() by relying in Rcpp::stop() which
has better behaviour and unwinding when errors or exceptions are
encountered. So once again no user-facing changes. Full details are
below.
CRANberries also provides a diffstat report for the latest release. As always, feedback is welcome and the best place to start a discussion may be the GitHub issue tickets page. If you like this or other open-source work I do, you can now sponsor me at GitHub.Changes in version 0.2.15 (2026-03-13)
- Replaced Rf_error with Rcpp::stop in three files
- Maintenance updates to continuous integration
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
Another minor maintenance release for the RcppBDT
package is now on CRAN, and had
been built as binary for r2u.
The RcppBDT
package is an early adopter of Rcpp
and was one of the first packages utilizing Boost and its Date_Time
library. The now more widely-used package anytime is a
direct descentant of RcppBDT.
This release is again primarily maintenance. We aid Rcpp in the transition away from calling
Rf_error() by relying in Rcpp::stop() which
has better behaviour and unwinding when errors or exceptions are
encountered. No feature or interface changes.
The NEWS entry follows:
Courtesy of my CRANberries, there is also a diffstat report for this release. For questions, suggestions, or issues please use the issue tracker at the GitHub repo.Changes in version 0.2.8 (2026-03-12)
- Replaced Rf_error with Rcpp::stop in three files
- Maintenance updates to continuous integration
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
Another maintenance release of our RcppDE package arrived
at CRAN, and has been built for
r2u. RcppDE is a port
of DEoptim, a
package for derivative-free optimisation using differential evolution,
from plain C to C++. By using RcppArmadillo the
code became a lot shorter and more legible. Our other main contribution
is to leverage some of the excellence we get for free from using Rcpp, in particular the ability to
optimise user-supplied compiled objective functions which can
make things a lot faster than repeatedly evaluating interpreted
objective functions as DEoptim does (and
which, in fairness, most other optimisers do too). The gains can be
quite substantial.
This release is again maintenance. We aid Rcpp in the transition away from calling
Rf_error() by relying in Rcpp::stop() which
has better behaviour and unwinding when errors or exceptions are
encountered. We also overhauled the references in the vignette, added an
Armadillo version getter and made the regular updates to continuous
integration.
Courtesy of my CRANberries, there
is also a diffstat
report. More detailed information is on the RcppDE page,
or the repository.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
Another minor update 0.3.13 for our nanotime
package is now on CRAN, and has
been uploaded to Debian and
compiled for r2u. nanotime
relies on the RcppCCTZ
package (as well as the RcppDate
package for additional C++ operations) and offers efficient high(er)
resolution time parsing and formatting up to nanosecond resolution,
using the bit64
package for the actual integer64 arithmetic. Initially
implemented using the S3 system, it has benefitted greatly from a
rigorous refactoring by Leonardo who not only rejigged
nanotime internals in S4 but also added new S4 types for
periods, intervals and durations.
This release, the first in eleven months, rounds out a few internal
corners and helps Rcpp with the
transition away from Rf_error to only using
Rcpp::stop which deals more gracefully with error
conditions and unwinding. We also updated how the vignette is made, its
references, updated the continuous integration as one does, altered how
the documentation site is built, gladly took a PR from Michael polishing another
small aspect, and tweaked how the compilation standard is set.
The NEWS snippet below has the fuller details.
Thanks to my CRANberries, there is a diffstat report for this release. More details and examples are at the nanotime page; code, issue tickets etc at the GitHub repository and all documentation is provided at the nanotime documentation site.Changes in version 0.3.13 (2026-03-08)
- The
methodspackage is now a Depends as WRE recommends (Michael Chirico in #141 based on a suggestion by Dirk in #140)- The mkdocs-material documentation site is now generated via altdoc
- Continuous Integration scripts have been updated
- Replace
Rf_errorwithRcpp::stop, turn remaining one into(Rf_error)(Dirk in #143)- Vignette now uses the
Rcpp::asisbuilder for pre-made pdfs (Dirk in #146 fixing #144)- The C++ compilation standard is explicitly set to C++17 if an R version older than 4.3.0 is used (Dirk in #148 fixing #147)
- The vignette references have been updated
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
A new maintenance release 0.4.26 of RProtoBuf
arrived on CRAN today. RProtoBuf
provides R with bindings for the
Google Protocol Buffers
( ProtoBuf ) data encoding and serialization library used and
released by Google, and deployed very widely in numerous projects as a
language and operating-system agnostic protocol. The new release is also
already as a binary via r2u.
This release brings an update to aid in an ongoing Rcpp transitions from
Rf_error to Rcpp::stop, and includes a few
more minor cleanups including one contributed by Michael.
The following section from the NEWS.Rd file has full details.
Thanks to my CRANberries, there is a diff to the previous release. The RProtoBuf page has copies of the (older) package vignette, the quick overview vignette, and the pre-print of our JSS paper. Questions, comments etc should go to the GitHub issue tracker off the GitHub repo.Changes in RProtoBuf version 0.4.26 (2026-03-06)
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
A new release 0.3.14 of RcppGSL is
now on CRAN. The RcppGSL
package provides an interface from R to the GNU GSL by relying on the
Rcpp package. It has already been
uploaded to Debian, and is also
already available as a binary via r2u.
This release, the first in over three years, contains mostly
maintenance changes. We polished the fastLm example
implementation a little more, updated continunous integration as one
does over such a long period, adopted the Authors@R convention, switched
the (pre-made) pdf vignette to a new driver now provided by Rcpp, updated vignette references and
URLs, and updated one call to Rf_error to aid in a Rcpp transition towards using only
Rcpp::stop which unwinds error conditions better.
(Technically this was a false positive on Rf_error but on
the margin worth tickling this release after all this time.)
The NEWS entry follows:
Thanks to my CRANberries, there is also a diffstat report for this release. More information is on the RcppGSL page. Questions, comments etc should go to the issue tickets at the GitHub repo.Changes in version 0.3.14 (2026-03-05)
- Updated some internals of
fastLmexample, and regeneratedRcppExports.*files- Several updates for continuous integration
- Switched to using Authors@R
- Replace
::Rf_errorwith(Rf_error)in old example to aid Rcpp transition toRcpp::stop(or this pass-through)- Vignette now uses the
Rcpp::asisbuilder for pre-made pdfs- Vignette references have been updated, URLs prefer https and DOIs
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
Another maintenance release of the tidyCpp
package arrived on CRAN this morning. The packages offers a clean C++
layer (as well as one small C++ helper class) on top of the C API for R
which aims to make use of this robust (if awkward) C API a little easier
and more consistent. See the vignette for motivating
examples.
This release follows a similar release in
November and had its hand forced by rather abrupt and forced
overnight changes in R-devel, this time the removal of
VECTOR_PTR in [this commit]. The release also contains
changes accumulated since the last release (including some kindly
contritbuted by Ivan) and those are signs that the R Core team can do
more coordinated release management when they try a little harder.
Changes are summarize in the NEWS entry that follows.
Thanks to my CRANberries, there is also a diffstat report for this release. For questions, suggestions, or issues please use the issue tracker at the GitHub repo.Changes in tidyCpp version 0.0.9 (2026-03-03)
- Several vignette typos have been corrected (#4 addressing #3)
- A badge for r-universe has been added to the README.md
- The vignette is now served via GitHub Pages and that version is referenced in the README.
- Two entry points reintroduced and redefined using permitted R API function (Ivan Krylov in #5).
- Another entry has been removed to match R-devel API changes.
- Six new attributes helpers have been added for R 4.6.0 or later.
VECTOR_PTR_RO(x)replaces the removedVECTOR_PTR, a warning or deprecation period would have been nice here.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can now sponsor me at GitHub.
The x13binary team
is happy to share the availability of Release 1.1.61.2 of the x13binary
package providing the X-13ARIMA-SEATS program
by the US Census Bureau which arrived on CRAN earlier today, and has
already been built for r2u.
This release responds to a CRAN request to display the
compiler version when building. x13binary, just
like three other packages there, creates and ships a local binary it
interfaces with. So our build was a little outside of
R CMD INSTALL ... but now signals build versions like R does. We also modernized and
simplified our continuous intgegration script based on r-ci.
Courtesy of my CRANberries, there
is also a diffstat report for this release showing
changes to the previous release.
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
Earlier this week a colleague of mine, Emilio Jes s Gallego Arias, shared a demo of something he built as an experiment, and I felt the desire to share this and add a bit of reflection. (Not keen on watching a 5 min video? Read on below.)
#eval. This is a bit like the interpreter found in Haskell or Python, but without needing a separate process, or like using a Jupyter notebook, but without the stateful cell management.
When the Free Software movement started in the 1980s, most of the world
had just made a transition from free university-written software to
non-free, proprietary, company-written software. Because of that, the
initial ethical standpoint of the Free Software foundation was that it's
fine to run a non-free operating system, as long as all the software you
run on that operating system is free.
Initially this was just the
editor.
But as time went on, and the FSF managed to write more and more parts of
the software stack, their ethical stance moved with the times. This was
a, very reasonable, pragmatic stance: if you don't accept using a
non-free operating system and there isn't a free operating system yet,
then obviously you can't write that free operating system, and the
world won't move towards a point where free operating systems exist.
In the early 1990s, when
Linus initiated the
Linux kernel, the situation reached the point where the original dream
of a fully free software stack was complete.
Or so it would appear.
Because, in fact, this was not the case. Computers are physical objects,
composed of bits of technology that we refer to as "hardware", but in
order for these bits of technology to communicate with other bits of
technology in the same computer system, they need to interface with
each other, usually using some form of bus protocol. These bus protocols
can get very complicated, which means that a bit of software is required
in order to make all the bits communicate with each other properly.
Generally, this software is referred to as "firmware", but don't let
that name deceive you; it's really just a bit of low-level software that
is very specific to one piece of hardware. Sometimes it's written in an
imperative high-level language; sometimes it's just a set of very simple
initialization vectors. But whatever the case might be, it's always a
bit of software.
And although we largely had a free system, this bit of low-level
software was not yet free.
Initially, storage was expensive, so computers couldn't store as much
data as today, and so most of this software was stored in ROM chips on
the exact bits of hardware they were meant for. Due to this fact, it was
easy to deceive yourself that the firmware wasn't there, because you
never directly interacted with it. We knew it was there; in fact, for
some larger pieces of this type of
software it was possible, even in
those days, to install updates. But that was rarely if ever done at the
time, and it was easily forgotten.
And so, when the free software movement slapped itself on the back and
declared victory when a fully free operating system was available, and
decided that the work of creating a free software environment was
finished, that only keeping it recent was further required, and that we
must reject any further non-free encroachments on our fully free
software stack, the free software movement was deceiving itself.
Because a computing environment can never be fully free if the
low-level pieces of software that form the foundations of that computing
environment are not free. It would have been one thing if the Free
Software Foundation declared it ethical to use non-free low-level
software on a computing environment if free alternatives were not
available. But unfortunately, they did not.
In fact, something very strange happened.
In order for some free software hacker to be able to write a free
replacement for some piece of non-free software, they obviously need to
be able to actually install that theoretical free replacement. This
isn't just a random thought; in fact it has
happened.
Now, it's possible to install software on a piece of rewritable storage
such as flash memory inside the hardware and boot the hardware from
that, but if there is a bug in your software -- not at all unlikely if
you're trying to write software for a piece of hardware that you don't
have documentation for -- then it's not unfathomable that the
replacement piece of software will not work, thereby reducing your
expensive piece of technology to something about as useful as a
paperweight.
Here's the good part.
In the late 1990s and early 2000s, the bits of technology that made up
computers became so complicated, and the storage and memory available to
computers so much larger and cheaper, that it became economically more
feasible to create a small, tiny, piece of software stored in a ROM chip
on the hardware, with just enough knowledge of the bus protocol to
download the rest from the main computer.
This is awesome for free software. If you now write a replacement for
the non-free software that comes with the hardware, and you make a
mistake, no wobbles! You just remove power from the system, let the DRAM
chips on the hardware component fully drain, return power, and try
again. You might still end up with a brick of useless silicon if some
of the things you sent to your technology make it do things that it was
not designed to do and therefore you burn through some critical bits of
metal or plastic, but the chance of this happening is significantly
lower than the chance of you writing something that impedes the boot
process of the piece of hardware and you are unable to fix it because
the flash is overwritten. There is anecdotal
evidence
that there are free software hackers out there who do so. So, yay,
right? You'd think the Free Software foundation would jump at the
possibility to get more free software? After all, a large part of why we
even have a Free Software Foundation in the first place, was because of
some piece of hardware that was
misbehaving,
so you would think that the foundation's founders would understand the
need for hardware to be controlled by software that is free.
The strange thing, what has always been strange to me, is that this is
not what happened.
The Free Software Foundation instead decided that non-free software on
ROM or flash chips is fine, but non-free software -- the very same
non-free software, mind -- that touches the general storage device that
you as a user use, is not. Never mind the fact that the non-free
software is always there, whether it sits on your storage device or not.
Misguidedness aside, if some people decide they would rather not update
the non-free software in their hardware and use the hardware with the
old and potentially buggy version of the non-free software that it came
with, then of course that's their business.
Unfortunately, it didn't quite stop there. If it had, I wouldn't have
written this blog post.
You see, even though the Free Software Foundation was about Software,
they decided that they needed to create a hardware
certification program. And this hardware
certification program ended up embedding the strange concept that if
something is stored in ROM it's fine, but if something is stored on a
hard drive it's not. Same hardware, same software, but different
storage. By that logic, Windows respects your freedom as long as the
software is written to ROM. Because this way, the Free Software
Foundation could come to a standstill and pretend they were still living
in the 90s.
An unfortunate result of the "RYF" program is that it means that
companies who otherwise would have been inclined to create hardware that
was truly free, top to bottom, are now more incentivised by the RYF
program to create hardware in which the non-free low-level software
can't be replaced.
Meanwhile, the rest of the world did not pretend to still be living in
the nineties, and free hardware communities now exist. Because of how
the FSF has marketed themselves out of the world, these communities call
themselves "Open Hardware" communities, rather than "Free Hardware"
ones, but the principle is the same: the designs are there, if you have
the skill you can modify it, but you don't have to.
In the mean time, the open hardware community has evolved to a point
where even CPUs are designed in
the open, which you can design your own version of.
But not all hardware can be implemented as RISC-V, and so if you want a
full system that builds RISC-V you may still need components of the
system that were originally built for other architectures but that would
work with RISC-V, such as a network card or a GPU. And because the FSF
has done everything in their power to disincentivise people who would
otherwise be well situated to build free versions of the low-level
software required to support your hardware, you may now be in the weird
position where we seem to have somehow skipped a step.
My own suspicion is that the universe is not only queerer than we suppose, but queerer than we can suppose.-- J.B.S. Haldane (comments for this post will not pass moderation. Use your own blog!)
The AI hype is based on the assumption that the frontier AI labs are producing better and better foundational models at an accelerating pace. Is that really true, or are people just in sort of a mass psychosis because AI models have become so good at mimicking human behavior that we unconsciously attribute increasing intelligence to them? I decided to conduct a mini-benchmark of my own to find out if the latest and greatest AI models are actually really good or not.
Common for all the test questions is that they are fairly straightforward and have a clear answer, yet the answer isn t common knowledge or statistically the most obvious one, and instead requires a bit of reasoning to get correct.
Some of these questions are also based on myself witnessing a flagship model failing miserably to answer it.
While Gemini and Grok were among the three models not falling into this trap, the response from Claude was exemplary good:
I have seen Grok do something similar before, which in fact inspired me to include this question in my mini-benchmark.
GPT got a bit further, but for Hindi, Arabic and Bengali it listed the numerals in local script, not the number words. Gemini, GLM and Kimi gave a complete and correct answer as a list, while the absolute best answer and presentation was by Claude, that gave the table below:
Claude Opus 4.6 10 Most Commonly Spoken Languages (by Total Speakers)Note: Rankings are based on estimated total speakers (native + non-native). Rankings can vary depending on the source and methodology used.
# Language 1 2 3 4 5 1 English One Two Three Four Five 2 Mandarin Chinese (y ) ( r) (s n) (s ) (w ) 3 Hindi (ek) (do) (t n) (ch r) (p ch) 4 Spanish Uno Dos Tres Cuatro Cinco 5 French Un Deux Trois Quatre Cinq 6 Arabic (w id) (ithn n) (thal tha) (arba a) (khamsa) 7 Bengali (ek) (dui) (tin) (ch r) (p ch) 8 Portuguese Um Dois Tr s Quatro Cinco 9 Russian (odin) (dva) (tri) (chetyre) (pyat') 10 Japanese (ichi) (ni) (san) (shi) (go)
A human can easily count that there are 10 rows and 30+ columns in the grid, but because the picture resolution isn t good enough, the exact number of columns can t be counted, and the answer should be that there are at least 300 launch pads in the picture.
GPT and Grok both guessed the count is zero. Instead of hallucinating some number they say zero, but it would have been better to not give any number at all, and just state that they are unable to perform the task. Gemini gave as its answer 101 , which is quite odd, but reading the reasoning section, it seems to have tried counting items in the image without reasoning much about what it is actually counting and that there is clearly a grid that can make the counting much easier. Both Qwen and Kimi state they can see four parallel structures, but are unable to count drone launch pads.
The absolutely best answer was given by Claude, which counted 10-12 rows and 30-40+ columns, and concluded that there must be 300-500 drone launch pads. Very close to best human level - impressive!
This question applied only to multi-modal models that can see images, so GLM and MinMax could not give any response.
$ SH_SCRIPTS="$(mktemp; grep -Irnw debian/ -e '^#!.*/sh' sort -u cut -d ':' -f 1 true)"
$ shellcheck -x --enable=all --shell=sh "$SH_SCRIPTS"
/tmp/tmp.xQOpI5Nljx
debian/tests/integration-tests: /tmp/tmp.xQOpI5Nljx
debian/tests/integration-tests: openBinaryFile: does not exist (No such file or directory)$SH_SCRIPTS, resulting in the entire multi-line string being passed as a single argument to shellcheck. So instead of receiving two separate file paths, shellcheck tries to open one file literally named /tmp/tmp.xQOpI5Nljx\ndebian/tests/integration-tests.
Incorrect argument expansion is fairly easy for an experienced human programmer to notice, but tricky for an LLM. Indeed, Grok, MinMax, and Qwen fell for this trap and focused on the mktemp, assuming it somehow fails to create a file. Interestingly GLM fails to produce an answer at all, as the reasoning step seems to be looping, thinking too much about the missing file, but not understanding why it would be missing when there is nothing wrong with how mktemp is executed.
Claude, Gemini, and Kimi immediately spot the real root cause of passing the variable quoted and suggested correct fixes that involve either removing the quotes, or using Bash arrays or xargs in a way that makes the whole command also handle correctly filenames with spaces in them.
| Model | Sports | Economics | Emoji | Languages | Visual | Shell | Score |
|---|---|---|---|---|---|---|---|
| Claude Opus 4.6 | 6/6 | ||||||
| GPT-5.2 | ~ | 2.5/6 | |||||
| Grok 4.1 | 3/6 | ||||||
| Gemini 3.1 Pro | 5/6 | ||||||
| GLM 5 | ? | N/A | 3/5 | ||||
| MinMax M2.5 | N/A | 1/5 | |||||
| Qwen3.5 Plus | ~ | 2.5/6 | |||||
| Kimi K2.5 | 4/6 |
The eighteenth release of the qlcal package
arrivied at CRAN today. There
has been no calendar update in QuantLib 1.41 so it has been relatively
quiet since the last release last summer but we now added a nice new
feature (more below) leading to a new minor release version.
qlcal
delivers the calendaring parts 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. Examples
are in the README at the repository, the package page,
and course at the CRAN package
page.
This releases makes it (much) easier to work with multiple calendars.
The previous setup remains: the package keeps one global (and hidden)
calendar object which can be set, queried, altered, etc. But now we
added the ability to hold instantiated calendar objects in R. These are
external pointer objects, and we can pass them to functions requiring a
calendar. If no such optional argument is given, we fall back to the
global default as before. Similarly for functions operating on one or
more dates, we now simply default to the current date if none is given.
That means we can now say
> sapply(c("UnitedStates/NYSE", "Canada/TSX", "Australia/ASX"),
\(x) qlcal::isBusinessDay(xp=qlcal::getCalendar(x)))
UnitedStates/NYSE Canada/TSX Australia/ASX
TRUE TRUE TRUE
> > sapply(c("UnitedStates/NYSE", "Canada/TSX", "Australia/ASX"),
\(x) qlcal::isBusinessDay(as.Date("2026-02-16"), xp=qlcal::getCalendar(x)))
UnitedStates/NYSE Canada/TSX Australia/ASX
FALSE FALSE TRUE
> NEWS.Rd follow.
Courtesy of my CRANberries, there is a diffstat report for this release. See the project page and package documentation for more details, and more examples.Changes in version 0.1.0 (2026-02-18)
- Invalid calendars return id TARGET now
- Calendar object can be created on the fly and passed to the date-calculating functions; if missing global one used
- For several functions a missing date object now implies computation on the current date, e.g.
isBusinessDay()
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub. Edited 2026-02-21 to correct a minor earlier error: it referenced a QuantLib 1.42 release which does not (yet) exist.
The eighteenth release of the qlcal package
arrivied at CRAN today. There
has been no calendar update in QuantLib 1.41 so it has been relatively
quiet since the last release last summer but we now added a nice new
feature (more below) leading to a new minor release version.
qlcal
delivers the calendaring parts 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. Examples
are in the README at the repository, the package page,
and course at the CRAN package
page.
This releases makes it (much) easier to work with multiple calendars.
The previous setup remains: the package keeps one global (and hidden)
calendar object which can be set, queried, altered, etc. But now we
added the ability to hold instantiated calendar objects in R. These are
external pointer objects, and we can pass them to functions requiring a
calendar. If no such optional argument is given, we fall back to the
global default as before. Similarly for functions operating on one or
more dates, we now simply default to the current date if none is given.
That means we can now say
> sapply(c("UnitedStates/NYSE", "Canada/TSX", "Australia/ASX"),
\(x) qlcal::isBusinessDay(xp=qlcal::getCalendar(x)))
UnitedStates/NYSE Canada/TSX Australia/ASX
TRUE TRUE TRUE
> > sapply(c("UnitedStates/NYSE", "Canada/TSX", "Australia/ASX"),
\(x) qlcal::isBusinessDay(as.Date("2026-02-16"), xp=qlcal::getCalendar(x)))
UnitedStates/NYSE Canada/TSX Australia/ASX
FALSE FALSE TRUE
> NEWS.Rd follow.
Courtesy of my CRANberries, there is a diffstat report for this release. See the project page and package documentation for more details, and more examples.Changes in version 0.1.0 (2026-02-18)
- Invalid calendars return id TARGET now
- Calendar object can be created on the fly and passed to the date-calculating functions; if missing global one used
- For several functions a missing date object now implies computation on the current date, e.g.
isBusinessDay()
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub. Edited 2026-02-21 to correct a minor earlier error: it referenced a QuantLib 1.42 release which does not (yet) exist.
Major decisions are introduced to stakeholders in a meeting, smaller ones by email. A delay allows people to submit final comments before adoption.Now, of course, the devil is in the details (and ADR-101), but the point is to keep things simple. A crucial aspect of the proposal, which Jacob Kaplan-Moss calls the one weird trick, is to "decide who decides". Our previous process was vague about who makes the decision and the new template (and process) clarifies decision makers, for each decision. Inversely, some decisions degenerate into endless discussions around trivial issues because too many stakeholders are consulted, a problem known as the Law of triviality, also known as the "Bike Shed syndrome". The new process better identifies stakeholders:
Note: this article was also published on the Tor Blog.
Note: I have not published blog posts about my academic papers over the past few years. To ensure that my blog contains a more comprehensive record of my published papers and to surface these for folks who missed them, I will be periodically (re)publishing blog posts about some older published projects. It seems natural to think of online communities competing for the time and attention of their participants. Over the last few years, I ve worked with a team of collaborators led by Nathan TeBlunthuis to use mathematical and statistical techniques from ecology to understand these dynamics. What we ve found surprised us: competition between online communities is rare and typically short-lived. When we started this research, we figured competition would be most likely among communities discussing similar topics. As a first step, we identified clusters of such communities on Reddit. One surprising thing we noticed in our Reddit data was that many of these communities that used similar language also had very high levels of overlap among their users. This was puzzling: why were the same groups of people talking to each other about the same things in different places? And why don t they appear to be in competition with each other for their users time and activity? We didn t know how to answer this question using quantitative methods. As a result, we recruited and interviewed 20 active participants in clusters of highly related subreddits with overlapping user bases (for example, one cluster was focused on vintage audio). We found that the answer to the puzzle lay in the fact that the people we talked to were looking for three distinct things from the communities they worked in:
Figure from No Community Can Do Everything: Why People Participate in Similar Online Communities depicts three key benefits that people seek from online communities and how individual communities tend not to optimally provide all three. For example, large communities tend not to afford a tight-knit homophilous community.This work was published as a paper at CSCW: TeBlunthuis, Nathan, Charles Kiene, Isabella Brown, Laura (Alia) Levi, Nicole McGinnis, and Benjamin Mako Hill. 2022. No Community Can Do Everything: Why People Participate in Similar Online Communities. Proceedings of the ACM on Human-Computer Interaction 6 (CSCW1): 61:1-61:25. https://doi.org/10.1145/3512908.
This work was supported by the National Science Foundation (awards IIS-1908850, IIS-1910202, and GRFP-2016220885). A full list of acknowledgements is in the paper.
Version 0.0.27 of RcppSpdlog arrived
on CRAN moments ago, and will
be uploaded to Debian and built for
r2u shortly. The (nice)
documentation
site will be refreshed too. RcppSpdlog
bundles spdlog, a
wonderful header-only C++ logging library with all the bells and
whistles you would want that was written by Gabi Melman, and also includes fmt by Victor Zverovich. You can learn
more at the nice package
documention site.
Brian Ripley has now turned C++20 on as a default for R-devel (aka R
4.6.0 to be ), and this turned up misbehvior in packages using RcppSpdlog such as
our spdl wrapper
(offering a nicer interface from both R and C++) when relying on
std::format. So for now, we turned this off and remain with
fmt::format from the fmt library while we
investigate further.
The NEWS entry for this release follows.
Courtesy of my CRANberries, there is also a diffstat report detailing changes. More detailed information is on the RcppSpdlog page, or the package documention site.Changes in RcppSpdlog version 0.0.27 (2026-02-11)
- Under C++20 or later, keep relying on
fmt::formatuntil issues experienced usingstd::formatcan be identified and resolved
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
Both R and Python make it reasonably easy to work with compiled
extensions. But how to access objects in one environment from the other
and share state or (non-trivial) objects remains trickier.
Recently (and while r-forge was resting so we opened GitHub
Discussions) a question was asked concerning R
and Python object pointer exchange.
This lead to a pretty decent discussion including arrow interchange demos (pretty
ideal if dealing with data.frame-alike objects), but once the focus is
on more library-specific objects from a given (C or C++, say) library
it is less clear what to do, or how involved it may get.
R has external pointers, and these make it feasible to instantiate
the same object in Python. To demonstrate, I created a pair of
(minimal) packages wrapping a lovely (small) class from the excellent spdlog library by Gabi Melman, and more specifically
in an adapted-for-R version (to avoid some R CMD check
nags) in my RcppSpdlog
package. It is essentially a nicer/fancier C++ version of the
tic() and tic() timing scheme. When an object
is instantiated, it starts the clock and when we accessing it later it
prints the time elapsed in microsecond resolution. In Modern C++ this
takes little more than keeping an internal chrono
object.
Which makes for a nice, small, yet specific object to pass to Python.
So the R side of
the package pair instantiates such an object, and accesses its
address. For different reasons, sending a raw pointer across does not
work so well, but a string with the address printed works fabulously
(and is a paradigm used around other packages so we did not invent
this). Over on the Python side of the
package pair, we then take this string representation and pass it to
a little bit of pybind11 code to
instantiate a new object. This can of course also expose functionality
such as the show time elapsed feature, either formatted or just
numerically, of interest here.
And that is all that there is! Now this can be done from R as well
thanks to reticulate
as the demo() (also shown on the package README.md)
shows:
> library(chronometre)
> demo("chronometre", ask=FALSE)
demo(chronometre)
---- ~~~~~~~~~~~
> #!/usr/bin/env r
>
> stopifnot("Demo requires 'reticulate'" = requireNamespace("reticulate", quietly=TRUE))
> stopifnot("Demo requires 'RcppSpdlog'" = requireNamespace("RcppSpdlog", quietly=TRUE))
> stopifnot("Demo requires 'xptr'" = requireNamespace("xptr", quietly=TRUE))
> library(reticulate)
> ## reticulate and Python in general these days really want a venv so we will use one,
> ## the default value is a location used locally; if needed create one
> ## check for existing virtualenv to use, or else set one up
> venvdir <- Sys.getenv("CHRONOMETRE_VENV", "/opt/venv/chronometre")
> if (dir.exists(venvdir))
+ > use_virtualenv(venvdir, required = TRUE)
+ > else
+ > ## create a virtual environment, but make it temporary
+ > Sys.setenv(RETICULATE_VIRTUALENV_ROOT=tempdir())
+ > virtualenv_create("r-reticulate-env")
+ > virtualenv_install("r-reticulate-env", packages = c("chronometre"))
+ > use_virtualenv("r-reticulate-env", required = TRUE)
+ >
> sw <- RcppSpdlog::get_stopwatch() # we use a C++ struct as example
> Sys.sleep(0.5) # imagine doing some code here
> print(sw) # stopwatch shows elapsed time
0.501220
> xptr::is_xptr(sw) # this is an external pointer in R
[1] TRUE
> xptr::xptr_address(sw) # get address, format is "0x...."
[1] "0x58adb5918510"
> sw2 <- xptr::new_xptr(xptr::xptr_address(sw)) # cloned (!!) but unclassed
> attr(sw2, "class") <- c("stopwatch", "externalptr") # class it .. and then use it!
> print(sw2) # xptr allows us close and use
0.501597
> sw3 <- ch$Stopwatch( xptr::xptr_address(sw) ) # new Python object via string ctor
> print(sw3$elapsed()) # shows output via Python I/O
datetime.timedelta(microseconds=502013)
> cat(sw3$count(), "\n") # shows double
0.502657
> print(sw) # object still works in R
0.502721
> Questions, suggestions, bug reports, are welcome at either the (now awoken from the R-Forge slumber) Rcpp mailing list or the newer Rcpp Discussions.Changes in version 0.0.2 (2026-02-05)
- Removed replaced unconditional virtualenv use in demo given preceding conditional block
- Updated README.md with badges and an updated demo
Changes in version 0.0.1 (2026-01-25)
- Initial version and CRAN upload
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. If you like this or other open-source work I do, you can sponsor me at GitHub.
Next.