Hacker News new | ask | show | jobs
by waynecochran 19 days ago
Here is an example. I wrote a MacOS app in Objective-C++/C++ that used Eigen's JacobiSVD solver at one point. A colleague of mine use Claude to port it into a web tool that used JavaScript. I scrolled thru the JS code and saw that is wrote is own Jacobi SVD solver. So I assume it did this match the exact behavior of the MacOS app -- using a 3rd party solver may not accomplish this. SVD solvers can behave differently in different use cases. What are the options for JS?
1 comments

Not sure, I’m not familiar with the web ecosystem. Not familiar at all, so my next question will probably be stupid. Would it have been possible to compile your C++ library to WebAssembly?
I am sure it probably was - a bit heavier option. There other mobile / VR / XR apps that I had to port to a variety of platforms using languages like Swift and Kotlin -- each platform has its own vector library. These don't necessarily provide SVD routines. Apple has their Accelerate framework, but is very unnatural to use IMO -- and Swift and C++ don't play that well together regardless of what folks say (that is why I tend to still use Obj-C++ when I have a choice).

There was another app where I had a 3x3 shear transformation that I needed to decompose into a rotation * scale * rotation which is exactly what SVD does (see https://tinyurl.com/384mkdvh). No need to bring in a full linear algebra package just for that.