"How to develop for the Stan C++ Core" Tutorial

I’m following up on the tutorial: “Developing for the Stan C++ Core” I presented at Stan Con 2018 (California). Here’s a link to the slides and worksheet:

Just a heads up: my slides tend to be rather sparse and might be a little hard to follow if you didn’t attend the talk.

4 Likes

Thanks for the presentation, Charles. Quick, slightly OT question. Do you have any book to recommend to pick up C++? I’m fairly experienced in Python, but I don’t have a Computer Science background.

When I was a CS undergrad I liked this book as a reference. If you’re coming from Python you’ll have to learn about pointers and the heap which this books covers. Also templates.

By the way Charles, thanks for giving that talk!

I’ve been enjoying Discovering Modern C++: An Intensive Course for Scientists, Engineers, and Programmers so far. I’m inexperienced with C++ and haven’t read other books, but I picked it because of the numerical bent and strongly positive reviews.

If I wanted to learn more about how Stan works / understand the code base, would a good starting point be the recommended papers from the workshop file?

A good place to start might be http://www.learncpp.com/. It’s well indexed, so you can jump to sections relevant to the code you’re working on.

For books, I would roll with recommendations from other users. “C++ Primer” is a standard reference.

You may get something out of looking at pull-requests. This is my earliest one and it has been thoroughly reviewed. The good news is developers will check your code + you can always ask questions on this forum!

1 Like

If I wanted to learn more about how Stan works / understand the code base, would a good starting point be the recommended papers from the workshop file?

Yes. The Stan math paper is fantastic and has lots of good references (actually it would be great to add a table of content to it, it is rather long). The other papers can help you fill in some gaps / go deeper into subjects you are curious about.

2 Likes

Most of the C++ resources are aimed at computer scientists.

I really like Vandevoorde and Josuttis’s C++ template book, but that’s particularly hard core.

The Scott Meyers books are good, but again assume you’re in the deep end of API design.

1 Like

Is the video tutorial going to be posted online?

My background wasn’t C++ either and to understand the difference from scripting languages I found this book really useful: https://www.amazon.com/Accelerated-C-Practical-Programming-Example/dp/020170353X

I think it won’t be useful if you like to have details of complicated concepts laid out for you but for me I just needed something I could infer how C++ is supposed to be used from.

There is no video record.