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.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://cran.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:

openblascpp

4.32 score 88 scripts 762 downloads 2 exports 4 dependencies

Last updated from:bc58088e01. Checks:10 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64OK322
linux-devel-x86_64OK342
source / vignettesOK624
linux-release-arm64OK313
linux-release-x86_64OK352
windows-devel-arm64OK536
windows-devel-x86_64OK375
windows-release-arm64OK548
windows-release-x86_64OK372
wasm-releaseOK232

Exports:make_packagetranslate

Dependencies:R6RcppRcppThreadsundials

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-26
Started: 2026-10-26

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-26
Started: 2022-03-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-26
Started: 2026-10-26

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-26
Started: 2022-03-14

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

Last update: 2026-10-26
Started: 2026-09-14

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

Last update: 2026-10-26
Started: 2026-10-26

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

Last update: 2026-10-26
Started: 2026-10-26

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-26
Started: 2026-10-26