I need to run some C++ code in javascript. The code is long and actually kinda heavy, and it's slow in javascript. I'm hoping I'll have better results in C++, because it's faster. I can convert to C++ pretty easily, I just need to know how to run this code. And if it doesn't work, it'll be great knowledge anyway and a good way to spend my time in quarantine.
Asked
Active
Viewed 56 times
0
-
2The way to run C++ code in Javascript is to... convert your C++ code to Javascript and then run that code. I'm serious. Web browsers won't let you run C++ code for good reasons. – user253751 Nov 13 '20 at 20:12
-
1NodeJS or client-side? – shreyasm-dev Nov 13 '20 at 20:12
-
Well I already mentioned that I want this to be more efficient than running javascript, and I already have the code in javascript, I want to run it in C++ to be more efficient. – Nov 13 '20 at 20:30
-
If you want to do this in a browser, the answer is probably ... use WASM? If it's on the server you've got a lot more flexibility. – CoffeeTableEspresso Nov 13 '20 at 20:34
-
And, what is this piece of code doing that takes so long? – CoffeeTableEspresso Nov 13 '20 at 20:35
-
No I don't have to do it in a browser, I run it on my server. – Nov 14 '20 at 01:19