Better HN
topnewbestaskshowjobs
Log inSign up

mindblah

7 karma · joined Aug 5, 2024 (2y ago) · 2 submissions

Submissions

comment 2y ago · link · parent

Well, one thing you can use alongside this project is a small library called cpp-dump, which lets you pretty print variables. https://github.com/philip82148/cpp-dump

It's just a normal library you can use with any compiled project, but it works nicely with Root C++ for built-in and std types.

Great if (say) you're working through implementing vector or linear algebra and want a nice way to display your multi-dimensional arrays and vectors.

Just copy the project folder somewhere (most conveniently where you invoke the interpreter from), do `#include "cpp-dump/dump.hpp` and then `cpp_dump(myVariable)` to print your variables.

You can see how it looks in this example where I was mucking about with permutations of vectors: https://i.imgur.com/yRpY5Bj.png

comment 2y ago · link · parent

Folks who like this kind of thing should definitely check out CERN's Root framework. I've been using its C++ interpreter in a Jupyter notebook environment to learn C++. It's probably also quite a bit more mature than this project. https://root.cern/