GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - r-lib/cpp11: cpp11 helps you to interact with R objects using C++ code.

BranchesTags
Open more actions menu

Latest commit

 

History

673 Commits
673 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.github
.github
 
 
R
R
 
 
cpp11test
cpp11test
 
 
inst/include
inst/include
 
 
man
man
 
 
revdep
revdep
 
 
tests
tests
 
 
vignettes
vignettes
 
 
.Rbuildignore
.Rbuildignore
 
 
.clang-format
.clang-format
 
 
.covrignore
.covrignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
DESCRIPTION
DESCRIPTION
 
 
LICENSE
LICENSE
 
 
LICENSE.md
LICENSE.md
 
 
MAINTENANCE.md
MAINTENANCE.md
 
 
Makefile
Makefile
 
 
NAMESPACE
NAMESPACE
 
 
NEWS.md
NEWS.md
 
 
README.md
README.md
 
 
_pkgdown.yml
_pkgdown.yml
 
 
air.toml
air.toml
 
 
codecov.yml
codecov.yml
 
 
cpp11.Rproj
cpp11.Rproj
 
 
cran-comments.md
cran-comments.md
 
 

Repository files navigation

cpp11

Lifecycle: stable R-CMD-check CRAN status Codecov test coverage

cpp11 helps you to interact with R objects using C++ code. Its goals and syntax are similar to the excellent Rcpp package.

Using cpp11 in a package

To add cpp11 to an existing package, put your C++ files in the src/ directory and add the following to your DESCRIPTION file:

LinkingTo: cpp11

Then decorate C++ functions you want to expose to R with [[cpp11::register]]. Note that this is a C++11 attribute, not a comment like is used in Rcpp.

cpp11 is a header only library with no hard dependencies and does not use a shared library, so it is straightforward and reliable to use in packages without fear of compile-time and run-time mismatches.

Alternatively, you can vendor the current installed version of cpp11 headers into your package with cpp11::vendor_cpp11(). This ensures the headers will remain unchanged until you explicitly update them.

Getting started

See vignette("cpp11") to get started using cpp11 in your scripts, particularly if you are new to C++ programming.

Getting help

Posit Community is the best place to ask for help using cpp11 or interfacing C++ with R.

Motivations

Rcpp has been a widely successful project, however over the years a number of issues and additional C++ features have arisen. Adding these features to Rcpp would require a great deal of work, or in some cases would be impossible without severely breaking backwards compatibility.

cpp11 is a ground up rewrite of C++ bindings to R with different design trade-offs and features.

Changes that motivated cpp11 include:

  • Enforcing copy-on-write semantics.
  • Improving the safety of using the R API from C++ code.
  • Supporting ALTREP objects.
  • Using UTF-8 strings everywhere.
  • Applying newer C++11 features.
  • Having a more straightforward, simpler implementation.
  • Faster compilation time with lower memory requirements.
  • Being completely header only to avoid ABI issues.
  • Capable of vendoring if desired.
  • More robust protection using a much more efficient linked list data structure.
  • Growing vectors more efficiently.

See vignette("motivations") for full details on the motivations for writing cpp11.

Conversion from Rcpp

See vignette("converting") if you are already familiar with Rcpp or have an existing package that uses Rcpp and want to convert it to use cpp11.

Learning More

  • Welding R and C++ - Presentation at SatRday Columbus (slides)

Internals

See vignette("internals") for details on the cpp11 implementation or if you would like to contribute to cpp11.

Code of Conduct

Please note that the cpp11 project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Thanks

cpp11 would not exist without Rcpp. Thanks to the Rcpp authors, Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Nathan Russell, Douglas Bates and John Chambers for their work writing and maintaining Rcpp.

About

cpp11 helps you to interact with R objects using C++ code.

cpp11.r-lib.org/

Topics

cppcpp11r

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

225 stars

Watchers

12 watching

Forks

52 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.