Package: ast2ast 1.1.0

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.0.tar.gz
ast2ast_1.1.0.zip(r-4.7-x86_64)ast2ast_1.1.0.zip(r-4.7-arm64)ast2ast_1.1.0.zip(r-4.6-x86_64)ast2ast_1.1.0.zip(r-4.6-arm64)ast2ast_1.1.0.zip(r-4.5-x86_64)
ast2ast_1.1.0.tgz(r-4.6-x86_64)ast2ast_1.1.0.tgz(r-4.6-arm64)ast2ast_1.1.0.tgz(r-4.5-x86_64)ast2ast_1.1.0.tgz(r-4.5-arm64)
ast2ast_1.1.0.tar.gz(r-4.7-arm64)ast2ast_1.1.0.tar.gz(r-4.7-x86_64)ast2ast_1.1.0.tar.gz(r-4.6-arm64)ast2ast_1.1.0.tar.gz(r-4.6-x86_64)
ast2ast_1.1.0.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://konrad1991.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.25 score 39 stars 49 scripts 755 downloads 2 exports 3 dependencies

Last updated from:7a4d9977d6. Checks:13 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64NOTE429
linux-devel-x86_64NOTE546
source / vignettesOK456
linux-release-arm64NOTE430
linux-release-x86_64NOTE504
macos-release-arm64NOTE386
macos-release-x86_64NOTE751
macos-oldrel-arm64NOTE465
macos-oldrel-x86_64NOTE960
windows-devel-arm64NOTE853
windows-devel-x86_64NOTE818
windows-release-arm64NOTE864
windows-release-x86_64NOTE675
windows-oldrel-x86_64NOTE776
wasm-releaseOK179

Exports:make_packagetranslate

Dependencies:R6RcppRcppThread

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-13
Started: 2022-01-31

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-06
Started: 2022-01-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-06
Started: 2026-08-18

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-09-09
Started: 2026-09-09