Package: ast2ast 1.1.2

Krämer Konrad

ast2ast: Translates an R Function to a C++ Function

Enable translation of a tiny subset of R to C++. The user has to define a R function which gets translated. For a full list of possible functions check the documentation. After translation an R function is returned which is a shallow wrapper around the C++ code. Alternatively an external pointer to the C++ function is returned to the user. The intention of the package is to generate fast functions which can be used as ode-system or during optimization.

Authors:Krämer Konrad [aut, cre]

ast2ast_1.1.2.tar.gz
ast2ast_1.1.2.zip(r-4.7-x86_64)ast2ast_1.1.2.zip(r-4.7-arm64)ast2ast_1.1.2.zip(r-4.6-x86_64)ast2ast_1.1.2.zip(r-4.6-arm64)ast2ast_1.1.2.zip(r-4.5-x86_64)
ast2ast_1.1.2.tgz(r-4.6-x86_64)ast2ast_1.1.2.tgz(r-4.6-arm64)ast2ast_1.1.2.tgz(r-4.5-x86_64)ast2ast_1.1.2.tgz(r-4.5-arm64)
ast2ast_1.1.2.tar.gz(r-4.7-arm64)ast2ast_1.1.2.tar.gz(r-4.7-x86_64)ast2ast_1.1.2.tar.gz(r-4.6-arm64)ast2ast_1.1.2.tar.gz(r-4.6-x86_64)
ast2ast_1.1.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
ast2ast/json (API)

# Install 'ast2ast' in R:
install.packages('ast2ast', repos = c('https://fastverse.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/konrad1991/ast2ast/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3

On CRAN:

Conda:

abstract-syntax-treecc-plus-plusexpression-templatematrixrcpptranspilervectoropenblascpp

7.94 score 40 stars 77 scripts 819 downloads 2 exports 4 dependencies

Last updated from:c0a877e676. Checks:15 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64OK396
linux-devel-x86_64OK450
source / vignettesOK420
linux-release-arm64OK366
linux-release-x86_64OK352
macos-release-arm64OK382
macos-release-x86_64OK907
macos-oldrel-arm64OK332
macos-oldrel-x86_64OK733
windows-devel-arm64OK698
windows-devel-x86_64OK529
windows-release-arm64OK638
windows-release-x86_64OK532
windows-oldrel-x86_64OK610
wasm-releaseOK224

Exports:make_packagetranslate

Dependencies:R6RcppRcppThreadsundials

Random numbers
Overview | Drawing numbers | Sampling | Densities | Each distribution owns its engine | Passing to inner functions | Order of evaluation | Limitations

Last update: 2026-11-10
Started: 2026-11-04

Bayesian sampling with nuts
Overview | Example: logistic regression | Result | Options | ODE models | Notes

Last update: 2026-11-10
Started: 2026-11-10

Derivatives at Tiny States: Michaelis-Menten
The problem in one sentence | Michaelis-Menten | What goes wrong at tiny S | What ast2ast reports | The fix: multiply through | Rule of thumb

Last update: 2026-10-30
Started: 2026-10-30

Detailed Documentation
Overview | Type system in ast2ast | Setting types for function arguments | Default behavior | Using argtypes() | Borrowing, constness, and references | Setting types for variables inside the function | Static types vs. R's dynamic typing | Derivatives | Forward mode | Reverse mode | Design philosophy | Inner functions | Functionals | Optimizers | Custom types (new_type) | Interpolation

Last update: 2026-10-30
Started: 2022-01-14

Differences to R
Overview | No access to the enclosing environment | No recycling | Integer arguments | Integer sum | Inf, NaN and NA

Last update: 2026-10-30
Started: 2026-10-20

Information for package authors
Guidance for Package Authors | Compiling R files into a package: make_package | Naming rationalization ast2ast | Comparison of R and ETR code | The XPtr interface | First, one creates the external pointer of the R function. | Afterwards the external pointer is used in an R package | call the function from the R package

Last update: 2026-10-30
Started: 2022-01-31

Inner Functions and Custom Types
Defining a custom type | An inner function operating on the type | Translating and calling it

Last update: 2026-10-30
Started: 2026-08-18

Jacobians: Dense, Coloured, Sparse and Banded
Overview | Example function | Dense | Colouring | Sparse and banded | Layouts | Returned to R

Last update: 2026-10-30
Started: 2026-10-20

Named Vectors and Layouts
Overview | Named vectors | Matrices, arrays and collections

Last update: 2026-10-30
Started: 2026-10-20

The Memory Model: Copy, Borrow, Ref
Boundary 1 -- R calls the translated function | Boundary 2 -- inside f, calling an inner fn() | In one table | The short version

Last update: 2026-10-30
Started: 2026-09-09

Hessians and Hessian-vector products
Overview | Example: standard errors of a logistic regression | Hessian-vector products | Notes

Last update: 2026-10-21
Started: 2026-10-21