@HenrikBengtsson



Before: sequential, readable, auditable
💡 Futureverse design goal
- I want your mind and focus to stay here!
After: parallel, hard to read, hard to maintain
library(parallel)
if (parallel) {
if (.Platform$OS.type == "windows") {
cl <- makeCluster(8)
res <- parLapply(cl, patients, fit_model)
stopCluster(cl)
} else {
options(mc.cores = 8)
res <- mclapply(patients, fit_model)
}
} else {
res <- lapply(patients, fit_model)
}Before: sequential, readable, auditable
After: parallel, readable, maintainable

+35% reverse dependencies yearly
(500+ direct, 1600+ recursive)

Top 0.6% most downloaded packages


futurize()Source-to-source code translation
futurize() inspects the expression on the leftEliminates the refactoring tax
purrr, foreach, etc.)Automatic code rewriting
Without changing any code, you can switch from local and remote parallel processing to large-scale high-performance compute (HPC) processing:
plan() |
Environment | Use case |
|---|---|---|
sequential |
Single machine | Sequential (default, debugging) |
multisession |
Single machine | Parallel across multiple cores |
mirai_multisession |
Single machine | Same as above; powered by mirai |
cluster |
Many machines | Parallel across many machines (desktops, cloud) |
batchtools_* |
Slurm/SGE/LSF | Scheduler-based HPC clusters |

| CRAN Package | Use |
|---|---|
| boot | Bootstrap resampling |
| caret | Machine learning training |
| DiceKriging | Kriging models |
| ez | Easy analysis of variance |
| fwb | Fractional weighted bootstrap |
| gamlss | Generalized additive models |
| glmmTMB | Generalized linear mixed models |
| glmnet | Lasso & elastic-net |
| kernelshap | Kernel SHAP explanations |
| lme4 | Linear mixed-effects models |
| metafor | Meta-analysis models |
| mgcv | Generalized additive models |
| modelsummary | Model summaries & tables |
| CRAN Package | Use |
|---|---|
| parameters | Model parameters |
| partykit | Recursive partitioning |
| pls | Partial least squares |
| pvclust | Hierarchical clustering |
| riskRegression | Risk regression (survival) |
| sandwich | Robust covariance estimators |
| seriation | Data ordering |
| stars | Spatiotemporal data cubes |
| strucchange | Structural change tests |
| SuperLearner | Super Learner ensembles |
| tm | Text mining |
| vegan | Community ecology |
| Bioc Package | Use |
|---|---|
| BiocParallel | Map-reduce infrastructure |
| DESeq2 | Differential gene expression |
| GenomicAlignments | Genomic alignments (BAM) |
| GSVA | Gene set variation analysis |
| Rsamtools | Rsamtools utilities |
| scater | Single-cell transformations |
| scuttle | Single-cell utilities |
| SingleCellExperiment | Single-cell containers |
| sva | Surrogate variable analysis |

✅ futurize() cancels remaining parallel tasks if there is an error or an interrupt
✅ estimate efficiency of parallelization
Is it worth it? Is there a better parallel backend? (coming)
⬜ optimize data distribution to parallel workers: (coming)
shared memory (e.g. new mori package by C. Gao 2026)
⬜ resource declarations: (coming)

useR! 2026, Henrik Bengtsson, futureverse.org