Stockfish in Lozza UIs
Posted: Wed Jan 07, 2015 3:08 pm
There is a growing need to 'compile' static languages into Javascript for native use in web browsers etc. Mozilla's approach is to use Clang to convert C/C++ to LLVM then emscripten to convert that in a subset of Javascript that minimises garbage collection (asm.js).
Norbert pointed me at a project where somebody had done that for Stockfish 5. https://github.com/exoticorn/stockfish-js
Given that Lozza is a UCI compliant engine needing no extra commands for web use - it's an edit of one line to replace Lozza with stockfish in my web UIs. I tweaked the play UI to take the engine as a paramater:-
Play Lozza (default): http://op12no2.me/toys/lozzadev/play.htm
Play Stockfish: http://op12no2.me/toys/lozzadev/play.htm?e=stockfish.js
So if you want your engine on the web, feel free to start with my UI code or donate your .js file for inclusion in the Lozza repertoire... Can then extend a bit to run Javascript tournys in client browsers...
Thanks Norbert!
PS: Firefox support asm.js explicitly, Google does not, indeed their whole approach to this is different but Stockfish will run in both Browsers. Dunno about Explorer etc.
Norbert pointed me at a project where somebody had done that for Stockfish 5. https://github.com/exoticorn/stockfish-js
Given that Lozza is a UCI compliant engine needing no extra commands for web use - it's an edit of one line to replace Lozza with stockfish in my web UIs. I tweaked the play UI to take the engine as a paramater:-
Play Lozza (default): http://op12no2.me/toys/lozzadev/play.htm
Play Stockfish: http://op12no2.me/toys/lozzadev/play.htm?e=stockfish.js
So if you want your engine on the web, feel free to start with my UI code or donate your .js file for inclusion in the Lozza repertoire... Can then extend a bit to run Javascript tournys in client browsers...
Thanks Norbert!
PS: Firefox support asm.js explicitly, Google does not, indeed their whole approach to this is different but Stockfish will run in both Browsers. Dunno about Explorer etc.