user30272: I agree that this might look like a question that Google has the answer to, but I could not find the answer. C++ is a language that many chess engines are built on, like Stockfish and Leela Chess Zero, but isn't Node.js more ideal because of its speed and ability compared to other languages like Python to be used as backend code and efficiency in machine learning using TensorFlow and/or Brain.js? Why are there no chess engines in Node.js then?

user23446: There are chess engines that run on the V8 JavaScript engine used in Node.JS; pretty much all online chess games use those to offload the computation (relatively nothing today) to the client, e.g. https://www.chess.com/play/computer
Here's a standalone chess engine in JS.
Chess is popular enough to be a hobby challenge: Here are several high-level-language chess AIs.

user30537: This is more of a question for Stack Overflow if you ask me... But since I've come here from there and I'm a software engineer and avid chess player, I'll try to explain.

This basically boils down to two factors, history and speed of execution. I'll handle them separately.
History
Javascript (the language Node uses) is a relatively young language. It was developed in 1996. Node, is even younger, being released in 2009. In comparison, C came out in 1972 and C++ in 1985.
The first major breakthrough in chess engines occurred when Deep Blue (written in C++) became the first chess engine to beat a grandmaster in 1997. At that point, it had been in active development for a few years and Javascript (then JScript) was a fledgling language that could do just the most basic web-based things.
As a result of this, it seems like a natural progression that future chess engines would build on the existing work and continue with C based languages. Not to mention the fact that the number of software engineers that could program in C/++ also vastly exceeded the number of JS engineers until well into the new millenium.

Speed
Chess is a hard problem computationally. It has a game-tree complexity score of 123 (exactly what this means is beyond the scope of this answer, but Noughts and Crosses has a score of 5, for comparison). As such, unless you want to be hanging around for a really long time while the computer works out its next move, your engine needs to run fast.
Javascript (and by extension Node) is an interpreted language. That means at runtime, it needs to be parsed and compiled before it can be executed. It also means that there's no opportunity for compile time optimisations to take place.
In direct juxtaposition to this, C based languages are precompiled. This means that they can execute directly at runtime with no intermediary steps and little overhead. There is also a plethora of compile-time optimisations that take place.
The end result of this is that for any given program, C/++ will perform approximately an order of magnitude faster on average. Admittedly, this has improved in the last few years somewhat, but they are still incomparable in terms of raw speed.
It must be noted, however, that speed and efficiency were far more important in previous decades. With today's computing power, even the most inefficient chess engine will run in a reasonable manner (unless it's just a dumb, extensive brute force - that will just never finish). Hence, why there are now Javascript based chess engines.

Conclusion
When you consider the history of the two languages along with the amount of computational power (and therefore the importance of efficiency) required to run a chess engine, it becomes clear why most of them are written in C based languages.
I will also add some personal opinion. C and C++, as strongly typed, procedural languages are simply far more suited to writing code for something like a chess engine. Sure, it can be done in Javascript but that was designed primarily for sending requests to a server and displaying results on a website, it's not designed for complex algorithms and the structures it uses show that.

user27289: Node.js is just a JavaScript (JS) runtime environment that is basically just Chrome's V8 JS engine, with the APIs (set of standardized commands for interacting with something) only needed for a browser environment (e.g., open a new tab) removed and a new set of APIs needed for a console environment (e.g., changing file permissions) added. However, it's still JS underneath and is not as performant as a compiled language like C++.
It was created to allow a server's back end to use the same language as the scripts in front-end web-page that it's serving, enabling easy code reuse (very commonly validation logic for something that's usually checked on the front-end, but also on the back-end, because you can't trust the user) and only requiring a product's team to only need one language skill-set.
It's become popular outside of these bounds, simply because a lot more people have JS skills and the JS ecosystem is much bigger, so now it's used in applications where those intangible benefits outweigh its performance downsides, but chess engines are not one of those applications.
As to machine learning (ML), you have it confused with Python, another language, where ease of use and ecosystem size outweigh performance drawbacks, but Node.js has never been a major player in ML.

user28052: To add onto the comments: Node.js and Python are higher-level languages/frameworks, used as "glue languages" for machine learning frameworks that just serve as human-friendly wrappers to coordinate lower level machine learning libraries that do the serious number-crunching, usually in C++ (TensorFlow and PyTorch), with other specialized GPU code in CUDA, numerical libraries in Fortran and even small bits of assembly (BLAS and LAPACK).
Using JavaScript for a frontend, like a website, or GUI is reasonable since that is not computationally demanding and JavaScript is well-suited to making user-facing frontends.

user1006: Node.js isn't a language; it's a framework on top of JavaScript.
It's also not fast, certainly not compared to compiled languages like C++ or Java.
Nor is JavaScript easier to use than compiled languages. If anything, it's far worse, especially for large complex applications.
Of course, for a lot of people who never learn anything but JavaScript, they think JavaScript is easier to use simply because it's all they know. I for example think Java is easier to use than Python because I've been using Java for 25 years and Python only very occasionally. That doesn't mean Python is harder to use or learn; it only means I've never taken the time because I had no real need to learn it.

user30419: Here is a link comparing C++ to Node.js from this question on Stack Overflow.
To answer your question: C++, while more difficult to write, is way faster than basically anything else.

30272: <p>I agree that this might look like a question that Google has the answer to, but I could not find the answer. <a href="https://en.wikipedia.org/wiki/C%2B%2B" rel="nofollow noreferrer">C++</a> is a language that many chess engines are built on, like <a href="https://en.wikipedia.org/wiki/Stockfish_%28chess%29" rel="nofollow noreferrer">Stockfish</a> and <a href="https://en.wikipedia.org/wiki/Leela_Chess_Zero" rel="nofollow noreferrer">Leela Chess Zero</a>, but isn't Node.js more ideal because of its speed and ability compared to other languages like <a href="https://en.wikipedia.org/wiki/Python_%28programming_language%29" rel="nofollow noreferrer">Python</a> to be used as backend code and efficiency in <a href="https://en.wikipedia.org/wiki/Machine_learning" rel="nofollow noreferrer">machine learning</a> using <a href="https://en.wikipedia.org/wiki/TensorFlow" rel="nofollow noreferrer">TensorFlow</a> and/or Brain.js? Why are there no chess engines in Node.js then?</p>
 23446: <p>There are chess engines that run on the V8 JavaScript engine used in Node.JS; pretty much all online chess games use those to offload the computation (relatively nothing today) to the client, e.g. <a href="https://www.chess.com/play/computer" rel="nofollow noreferrer">https://www.chess.com/play/computer</a></p>
<p><a href="https://www.npmjs.com/package/js-chess-engine" rel="nofollow noreferrer">Here</a>'s a standalone chess engine in JS.</p>
<p>Chess is popular enough to be a hobby challenge: <a href="https://rosettacode.org/wiki/Chess_player" rel="nofollow noreferrer">Here</a> are several high-level-language chess AIs.</p>
 30537: <p>This is more of a question for Stack Overflow if you ask me... But since I've come here from there and I'm a software engineer and avid chess player, I'll try to explain.</p>
<hr />
<p>This basically boils down to two factors, history and speed of execution. I'll handle them separately.</p>
<p><strong>History</strong></p>
<p>Javascript (the language Node uses) is a relatively young language. It was developed in 1996. Node, is even younger, being released in 2009. In comparison, C came out in 1972 and C++ in 1985.</p>
<p>The first major breakthrough in chess engines occurred when Deep Blue (written in C++) became the first chess engine to beat a grandmaster in 1997. At that point, it had been in active development for a few years and Javascript (then JScript) was a fledgling language that could do just the most basic web-based things.</p>
<p>As a result of this, it seems like a natural progression that future chess engines would build on the existing work and continue with C based languages. Not to mention the fact that the number of software engineers that could program in C/++ also vastly exceeded the number of JS engineers until well into the new millenium.</p>
<hr />
<p><strong>Speed</strong></p>
<p>Chess is a <em>hard</em> problem computationally. It has a game-tree complexity score of 123 (exactly what this means is beyond the scope of this answer, but Noughts and Crosses has a score of 5, for comparison). As such, unless you want to be hanging around for a really long time while the computer works out its next move, your engine needs to run fast.</p>
<p>Javascript (and by extension Node) is an interpreted language. That means at runtime, it needs to be parsed and compiled before it can be executed. It also means that there's no opportunity for compile time optimisations to take place.</p>
<p>In direct juxtaposition to this, C based languages are precompiled. This means that they can execute directly at runtime with no intermediary steps and little overhead. There is also a plethora of compile-time optimisations that take place.</p>
<p>The end result of this is that for any given program, C/++ will perform approximately an order of magnitude faster on average. Admittedly, this has improved in the last few years somewhat, but they are still incomparable in terms of raw speed.</p>
<p>It must be noted, however, that speed and efficiency were far more important in previous decades. With today's computing power, even the most inefficient chess engine will run in a reasonable manner (unless it's just a dumb, extensive brute force - that will just never finish). Hence, why there are now Javascript based chess engines.</p>
<hr />
<p><strong>Conclusion</strong></p>
<p>When you consider the history of the two languages along with the amount of computational power (and therefore the importance of efficiency) required to run a chess engine, it becomes clear why most of them are written in C based languages.</p>
<p>I will also add some personal opinion. C and C++, as strongly typed, procedural languages are simply far more suited to writing code for something like a chess engine. Sure, it can be done in Javascript but that was designed primarily for sending requests to a server and displaying results on a website, it's not designed for complex algorithms and the structures it uses show that.</p>
 27289: <p>Node.js is just a JavaScript (JS) runtime environment that is basically just Chrome's <a href="https://en.wikipedia.org/wiki/V8_%28JavaScript_engine%29" rel="noreferrer">V8</a> JS engine, with the APIs (set of standardized commands for interacting with something) only needed for a browser environment (e.g., open a new tab) removed and a new set of APIs needed for a console environment (e.g., changing file permissions) added. However, it's still JS underneath and is not as performant as a compiled language like C++.</p>
<p>It was created to allow a server's back end to use the same language as the scripts in front-end web-page that it's serving, enabling easy code reuse (very commonly validation logic for something that's usually checked on the front-end, but also on the back-end, because you can't trust the user) and only requiring a product's team to only need one language skill-set.</p>
<p>It's become popular outside of these bounds, simply because a lot more people have JS skills and the JS ecosystem is much bigger, so now it's used in applications where those intangible benefits outweigh its performance downsides, but chess engines are not one of those applications.</p>
<p>As to machine learning (ML), you have it confused with Python, another language, where ease of use and ecosystem size outweigh performance drawbacks, but Node.js has never been a major player in ML.</p>
 28052: <p>To add onto the comments: Node.js and Python are higher-level languages/frameworks, used as &quot;glue languages&quot; for machine learning frameworks that just serve as human-friendly wrappers to coordinate lower level machine learning libraries that do the serious number-crunching, usually in C++ (TensorFlow and <a href="https://en.wikipedia.org/wiki/PyTorch" rel="nofollow noreferrer">PyTorch</a>), with other specialized GPU code in <a href="https://en.wikipedia.org/wiki/CUDA" rel="nofollow noreferrer">CUDA</a>, numerical libraries in <a href="https://en.wikipedia.org/wiki/Fortran" rel="nofollow noreferrer">Fortran</a> and even small bits of assembly (<a href="https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms" rel="nofollow noreferrer">BLAS</a> and <a href="https://en.wikipedia.org/wiki/LAPACK" rel="nofollow noreferrer">LAPACK</a>).</p>
<p>Using <a href="https://en.wikipedia.org/wiki/JavaScript" rel="nofollow noreferrer">JavaScript</a> for a frontend, like a website, or GUI is reasonable since that is not computationally demanding and JavaScript is well-suited to making user-facing frontends.</p>
 1006: <p>Node.js isn't a language; it's a framework on top of JavaScript.
It's also not fast, certainly not compared to compiled languages like C++ or Java.</p>
<p>Nor is JavaScript easier to use than compiled languages. If anything, it's far worse, especially for large complex applications.
Of course, for a lot of people who never learn anything but JavaScript, they think JavaScript is easier to use simply because it's all they know. I for example think Java is easier to use than Python because I've been using Java for 25 years and Python only very occasionally. That doesn't mean Python is harder to use or learn; it only means I've never taken the time because I had no real need to learn it.</p>
 30419: <p>Here is <a href="https://web.archive.org/web/20180324192118/http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=node&amp;lang2=gpp" rel="noreferrer">a link</a> comparing C++ to Node.js from <a href="https://stackoverflow.com/questions/12195841/node-js-vs-c-for-mathematic">this question</a> on Stack Overflow.</p>
<p>To answer your question: C++, while more difficult to write, is way faster than basically anything else.</p>
