WebAssembly

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

WebAssembly

Post by cdani »

Maybe someone is interested for their web chess related projects:

"WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together."

https://developer.mozilla.org/en-US/docs/WebAssembly
niklasf
Posts: 42
Joined: Sat May 16, 2015 11:41 pm

Re: WebAssembly

Post by niklasf »

I made a WebAssembly build for Stockfish: https://github.com/niklasf/stockfish.js

Unfortunately WebAssembly has no support for threading right now. That's a downside in itself, but is especially annoying if you want to allow interaction, e.g. stopping search. You have to actively poll for that (and call JavaScript to execute the event loop).

Still nps gets up to 70% of native performance, which is a huge improvement. (Before performance was at around 10% using ASMJS in Firefox).