Are there any implementations of algorithms for variable-length optimization, where the number of parameters can vary? Examples can be found here (particle swarm based), here, here, and here (genetic algorithms).

(If not, I’d love to see a package implementing some!)

Not necessarily; one of the algorithms I linked was a particle swarm. The general principle is just that I have a number of parameters that can vary and needs to be optimized alongside the parameters themselves. Any packages that work in this case would be much appreciated.

A good example of these problems would be trying to optimize both the number and placement of knots for a spline being fit to data, or modeling a distribution as a mixture of n normals (where n is unknown).