Answers.Body: <p>Stockfish JS is a Javascript port of the Stockfish engine. It should be useful for your project. You might want to learn the UCI protocol.</p>
  
  <p>Hint:</p>
  
  <p>Use Stockfish JS. Consider:</p>
  
  <ul>
  <li>Send MultiPV for a position. You will get an evaluation for the moves.</li>
  </ul>
  
  <p>OR </p>
  
  <ul>
  <li>For n legal moves, play them one by one. Ask Stockfish for an evaluation on each of those possibilities.</li>
  </ul>
  
  <p>The second approach is slower but more accurate. If you just want shallow search, try the first one.</p>
  
  <p>If you could multithread, do it. If you could run positions independently, do it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-21T16:04:39.303Z
Answers.LastActivityDate: 2018-06-21T16:04:39.303Z
Answers.UserDisplayName: SmallChess
Body: <p>I am working on a statistical chess project that needs to evaluate many (about 20-30) different positions per turn. They do not need to be deep but fast.</p>
  
  <p>Is there a possibility to use engines (stockfish is preferred because I am familiar with its evaluation system) that receives a fen as an input and gives me a fast evaluation of the position (probably with a given deepness, e.g 10) as output.</p>
  
  <p>It should run in a web browser. So I assume the <a href="https://github.com/official-stockfish/Stockfish" rel="nofollow noreferrer">official Stockfish</a> is not suitable, because it is written in C++.</p>
  
  <p>I found <a href="https://github.com/nmrugg/stockfish.js/" rel="nofollow noreferrer">this</a> and <a href="https://github.com/exoticorn/stockfish-js" rel="nofollow noreferrer">this</a>, but there is no hint how to use them, so I would appreciate for some hints if I should use them. Does somebody has experience with this implementations? Could you advise me something else?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-21T15:38:52.547Z
Comments.Text: What about running on Python?
Comments.UserDisplayName: SmallChess
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-21T16:00:06.723Z
Comments.Text: @SmallChess I am working on a web plugin. Is it possible to use python from plugins? I am experienced in Python and Java, but a newbie in web projects.
Comments.UserDisplayName: Superluminal
Tags: <engines><software><stockfish><programming><evaluation>
Title: Is there a way to get MANY and FAST (but not deep) position evaluations in javascript?
ThreadText: # Is there a way to get MANY and FAST (but not deep) position evaluations in javascript?
  
  (Asked by: username_0 on 2018-06-21)
  
  I am working on a statistical chess project that needs to evaluate many (about 20-30) different positions per turn. They do not need to be deep but fast.
  
  Is there a possibility to use engines (stockfish is preferred because I am familiar with its evaluation system) that receives a fen as an input and gives me a fast evaluation of the position (probably with a given deepness, e.g 10) as output.
  
  It should run in a web browser. So I assume the [official Stockfish](https://github.com/official-stockfish/Stockfish) is not suitable, because it is written in C++.
  
  I found [this](https://github.com/nmrugg/stockfish.js/) and [this](https://github.com/exoticorn/stockfish-js), but there is no hint how to use them, so I would appreciate for some hints if I should use them. Does somebody has experience with this implementations? Could you advise me something else?
  
  **Tags:** engines, software, stockfish, programming, evaluation
  
  > **Comments:**
  > **username_1**: What about running on Python?  
  > **username_0**: @username_1 I am working on a web plugin. Is it possible to use python from plugins? I am experienced in Python and Java, but a newbie in web projects.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-06-21. Score: 2
  
  Stockfish JS is a Javascript port of the Stockfish engine. It should be useful for your project. You might want to learn the UCI protocol.
  
  Hint:
  
  Use Stockfish JS. Consider:
  
  * Send MultiPV for a position. You will get an evaluation for the moves.
  
  OR
  
  * For n legal moves, play them one by one. Ask Stockfish for an evaluation on each of those possibilities.
  
  The second approach is slower but more accurate. If you just want shallow search, try the first one.
  
  If you could multithread, do it. If you could run positions independently, do it.
  
  
  ---
  
  