Hacker News new | ask | show | jobs
by rocqua 3128 days ago
This looks downright amazing.

I only wish it had come a few months earlier. I've had to switch from python in a jupyter notebook to C++ for performance reasons, and I really felt the loss of incrementalism.

1 comments

You can create your project into python library by wrapping in ctypes or using the cffi package. I do that with some of my numerical simulation code and it doesn't take away from the interactivity of python. Once I get a feature more or less complete, I re-write it in c/fortran and compile it away. This maintains performance as well as focus, because the 'interesting' thing you'll be working on is quick and dirty using python, and the stuff you've already okay'd is in a compiled language out of sight.
It is this transpiling from python to C++ that I want to avoid. Especially because there is a lot of iterative development on the C++.

However, I'll essentially never be able to run my code from a notebook because it runs on a cluster I need to SSH into. Thing is, I'd like to develop that code locally and iteratively.

But I thought you said you already re-wrote it from python to c++ anyways? I was trying to point out it doesn't have to be either/or. That being said, I think the fact that you need to get access through ssh is another hurdle all together.
I switched once I needed the performance, but that was not near the end of developtment. The switch was made far from a point where the code, or even the algorithms were finished.

Thus it was required to do a lot of incremental development in C++. It wouldn't make sense to add in a manual transpilation at every increment, and I needed the actual C++ code to judge performance.