Is this what you mean by nlopt? https://github.com/stevengj/nlopt
If so, it looks like you're interfacing from R to high-performing code written in C. Isn't that exactly what OP was describing?
If so, it looks like you're interfacing from R to high-performing code written in C. Isn't that exactly what OP was describing?
Now, I generally use Julia for heavy computes, and usually its much faster than R. But not always.
And this little bit of code runs for hours on the largest instance on AWS every day. Why I was looking so speed it up.