Open-source project
nrc/r4cppp avatar
nrc/r4cppp

nrc/r4cppp: a Rust tutorial that assumes you already know C++

Rust for C++ programmers

3,897 stars300 forksRustLicense varies

At a glance

What is it?
r4cppp is a Markdown tutorial by nrc aimed at experienced C and C++ programmers, covering only the parts of Rust that differ from what they already know. It is prose and example code, not a crate, and it has no build step beyond reading the files.
Who is it for?
Adopt r4cppp if you are a working C or C++ programmer who wants the differences explained in low-level terms and are willing to read Markdown files in the repository rather than a rendered book. Do not adopt it if you are new to systems programming, because the README states the material assumes you already know how pointers, references, integer widths and memory management work, and it deliberately avoids basics.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 161 days ago.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • nrc/r4cppp3,897 ★ · +7
Star history
Repository2026-09-242026-11-25
nrc/r4cppp3.9k3.9k

7 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What r4cppp is for, and who it is written for

r4cppp is a tutorial, not a library. The README describes it as "A Rust tutorial for experienced C and C++ programmers" and states the intended audience explicitly: programmers who already know how pointers and references work and are used to systems programming concepts such as integer widths and memory management. That framing decides everything else about the project. The goal, in the README's words, is to cover primarily the differences between Rust and C++ so that such a reader gets writing Rust quickly without lots of material they already know.

The author, @nrc, explains the origin: the tutorial started as a series of blog posts, partly as an aid to learning Rust himself and partly because existing resources spent too much time on basics and used higher-level intuitions where lower-level ones would have worked better. The README also concedes that Rust's own documentation has since got much better, while arguing that C++ programmers remain a natural audience for Rust who are not particularly well catered for. That is an honest statement of the niche: this is a supplement to the official book, not a replacement for it.

The chapter list is the whole product

There is no runtime and no package. The repository is a set of Markdown files plus a graphs directory and a shell script. The contents list runs from "Introduction - Hello world!" through control flow, primitive types and operators, unique pointers, borrowed pointers, Rc and raw pointers, data types, two destructuring chapters, arrays and vecs, graphs and arena allocation, to closures and first-class functions.

The ordering is the interesting design decision. Ownership and borrowing arrive early (chapters four and five), before data types and collections, because that is the part a C++ programmer cannot guess from syntax alone. Destructuring gets two chapters, which suggests the author found it worth more space than a general tutorial would give it. Graphs and arena allocation is the one chapter with its own subdirectory, and it is the kind of topic a C++ reader will recognise immediately: how do you build a cyclic structure when the language's default ownership model does not want you to.

What is absent matters as much. The list stops at closures. There is no chapter on traits, no chapter on error handling, no chapter on Cargo or project layout, and no chapter on unsafe in depth. If you need those, the README points elsewhere.

How the material is meant to be read

The README gives no install instructions because there is nothing to install. It gives a contents list with relative links such as hello-world.md and control-flow.md, and that is the entry point. The files are plain GitHub markdown, and the README states that all writing should be valid GitHub markdown, so the intended reading surface is the repository view on GitHub or a local clone.

There is a compile_pdf.sh at the top level, which implies the author also produced a PDF build of the chapters, but the README does not document what that script requires or what it emits. Treat it as an artefact of the author's workflow rather than a supported build path. The one format constraint the README does state is a width limit of 80 columns, which explains why the prose reads as narrow, wrapped paragraphs rather than long lines.

Because the chapters are separate files, they can be read out of order. A reader who already understands move semantics from modern C++ might go straight to borrowed.md and rc-raw.md, while someone coming from C might start at unique.md.

Reading the first chapter locally

The practical setup is a clone and a Markdown reader. The README links the chapters by relative path, so a local clone preserves the links between files. Run this from a directory where you keep checkouts:

bash
git clone https://github.com/nrc/r4cppp.git
cd r4cppp
ls *.md

The listing should show the chapter files named in the contents list, including hello-world.md, control-flow.md, primitives.md, unique.md, borrowed.md, rc-raw.md, data-types.md, destructuring.md, destructuring-2.md, arrays.md and closures.md, alongside README.md and LICENSE.md. If a file from the contents list is missing, the README is out of step with the tree and you should check the repository listing rather than assume the link is broken.

To follow along with the code in the chapters you need a Rust toolchain, but the README does not name an installation method or a version, and it does not state which Rust edition the examples target. Install Rust through whatever channel you already use and expect to adjust examples yourself. The README does point at the official book and the API documentation as the place to go for a second opinion, which is the honest division of labour: r4cppp explains the differences, the book explains the language.

Where the tutorial is thin, and where it is the wrong tool

The README is unusually candid about the friction. It says the big difference is that the sometimes vague concepts of good systems programming are strictly enforced by the compiler, that this can be infuriating at first, and that there are things you want to do which the compiler will not let you do in safe code, sometimes things that are in fact safe but which you cannot convince the compiler of. That is a fair description of the borrow checker from the receiving end, and it sets expectations better than a chapter of reassurance would.

The structural limitation is coverage. Twelve chapters cannot carry a language. Traits, generics beyond the passing mention in the introduction, error handling, modules, Cargo, testing and unsafe are all outside the contents list. The README directs readers to the official book for anything not covered, which is the right call but means r4cppp is a companion rather than a curriculum.

Age is the other risk. The README itself warns, in the context of StackOverflow, that Rust has changed a lot over the years and some answers might be very out of date. The same caution applies to any tutorial written across a long period, and nothing in the README states which Rust version each chapter was checked against. If you are the kind of reader who needs every example to compile as printed, this format will frustrate you.

How r4cppp differs from The Rust Book and from video talks

The README names its own alternatives, and the comparison is concrete. The Rust book is described as the best place for learning Rust in general and the best place to go for a second opinion on material here or for material not covered. The difference in approach is audience and starting point: the book teaches Rust to someone who may not know systems programming, while r4cppp assumes you already think in pointers, integer widths and manual memory management, and spends its pages on what is new to you.

The README also links "A Firehose of Rust", a recorded talk introducing C++ programmers to how lifetimes, mutable aliasing and move semantics work. That is the same audience in a different medium. A talk gives you the mental model in an hour and no reference text; r4cppp gives you files you can re-read and search, at the cost of being prose you have to work through yourself. The README additionally points to the Rust reference manual, noting it is a little out of date in places but thorough and good for looking up details, and to the users forum and StackOverflow for questions. None of those is a substitute for the others, and the README does not pretend otherwise.

Licence, maintenance and the cost of keeping up

The repository carries a LICENSE.md at the top level, but the licence is reported as NOASSERTION, meaning the file's contents were not matched to a standard identifier. Read LICENSE.md yourself before reusing or republishing any part of the tutorial, particularly the example code. This is not legal advice, and the practical point is simply that you cannot assume a well-known permissive licence applies here.

The repository is not archived, and the last push was on 2026-06-17. That is recent enough that the project is not abandoned, but the README describes the work as having grown from a blog series over time and invites contributions, which means the maintenance model is volunteer editing rather than scheduled releases. The repository has no published GitHub releases, so there is no version to pin and no changelog to consult. Upgrading means pulling the branch and re-reading the chapter you care about. The README's contribution section is explicit that corrections and new chapters are wanted, and points contributors at issues tagged new material, so the realistic way to fix a stale example is to open a pull request rather than wait for a release.

Editorial conclusion

Adopt r4cppp if you are a working C or C++ programmer who wants the differences explained in low-level terms and are willing to read Markdown files in the repository rather than a rendered book. Do not adopt it if you are new to systems programming, because the README states the material assumes you already know how pointers, references, integer widths and memory management work, and it deliberately avoids basics. Before relying on any chapter, open the file you need and check its last commit date, since the tutorial was written over years during which Rust changed and the README warns that even StackOverflow answers can be very out of date. Verify first that the chapter you care about exists: the contents list ends at closures and first-class functions, so traits, error handling and cargo workflows are not covered.

Frequently asked questions

What is r4cppp?

It is a Rust tutorial written for experienced C and C++ programmers, consisting of Markdown chapters in the nrc/r4cppp repository. The README states that it concentrates on the differences between Rust and C++ so that readers who already know pointers, references and memory management can get writing Rust quickly.

How do I use the r4cppp tutorial?

There is nothing to install. Clone the repository and read the Markdown chapters in the order given by the contents list in the README, which links files such as hello-world.md, unique.md and borrowed.md by relative path.

Is there a PDF version of r4cppp?

The repository contains a compile_pdf.sh at the top level, which suggests a PDF build exists, but the README does not document what the script requires or what it produces. The README only states that the writing should be valid GitHub markdown and limited to 80 columns.

Does r4cppp cover traits, error handling or Cargo?

No. The contents list ends at closures and first-class functions, and the README directs readers to the official Rust book for material not covered here. You will need another source for traits, error handling, modules and project layout.

Which Rust version do the r4cppp examples target?

The README does not state a Rust version or edition for the examples. It does warn, about StackOverflow answers, that Rust has changed a lot over the years and some answers might be very out of date, so expect to adjust code as you follow along.

Can I contribute a chapter to r4cppp?

Yes. The README asks for pull requests for typos and mistakes, and invites issues for larger changes or new chapters, pointing contributors at issues tagged new material. It also sets a style: British English, 80-column width, valid GitHub markdown, and an academic but not dry tone.

Official sources

  1. Issues
  2. nrc/r4cppp on GitHub
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nrc-r4cppp.svg)](https://hysenlabs.com/projects/nrc-r4cppp)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/nrc-r4cppp.svg)](https://hysenlabs.com/projects/nrc-r4cppp)

Was this useful?