JSUCI 1.0 - connect javascript chess engines to UCI
Posted: Fri Mar 28, 2014 3:17 am
Javascript is getting a more and more versatile programming language. Particularly the latest javascript engines as well as new standards (HTML5) allow for high performance applications to be written.
Javascript chess engines are interesting, because they are easy to integrate and thus very multifunctional. E.g. just imagine we add a button to analyze positions on the analysis board in this forum, or on TCEC, etc.
There already exist a variety of javascript chess engines that run in the browser and are played on their native guis. In an attempt to coordinate these individual efforts and to promote future developments I have created a JS to UCI port. It is an application that on the one hand communicates with the GUI and on the other hand is a Javascript Engine that can interpret *.js files. The code is very simple and basically just relays messages without any error checking. For the JS interpretation I used the open source V8 engine developed by Google.
This way it will be much easier to compare javascript chess engines (and even match them with standard engines) and furthermore it will become more feasable to use these tools outside their native environment and make them portable.
You find the download to the JSUCI package here: https://sourceforge.net/projects/jsuci/
So far I have written a wrapper for the open source javascript chess engine p4wn by Douglas Bagnall to give an example. (on a side note: I would like to contact the author, but couldn't find him registered on this board, has anyone got means to contacting Douglas?). The engine is simple and only accepts "go depth n" commands.
To run p4wn, you have to launch the application with the path to the loader js file in the command line (e.g. "jsuci_1.exe p4wn\p4wn_loader.js")
Now some technical notes:
The communication with the engines relies on the new HTML5 standard for Web Workers. The engines are started as individual threads and then UCI commands are sent over the default pipes.
Does there exist any interest in this new tool? As a tester? Engine programmer? Others?
Javascript chess engines are interesting, because they are easy to integrate and thus very multifunctional. E.g. just imagine we add a button to analyze positions on the analysis board in this forum, or on TCEC, etc.
There already exist a variety of javascript chess engines that run in the browser and are played on their native guis. In an attempt to coordinate these individual efforts and to promote future developments I have created a JS to UCI port. It is an application that on the one hand communicates with the GUI and on the other hand is a Javascript Engine that can interpret *.js files. The code is very simple and basically just relays messages without any error checking. For the JS interpretation I used the open source V8 engine developed by Google.
This way it will be much easier to compare javascript chess engines (and even match them with standard engines) and furthermore it will become more feasable to use these tools outside their native environment and make them portable.
You find the download to the JSUCI package here: https://sourceforge.net/projects/jsuci/
So far I have written a wrapper for the open source javascript chess engine p4wn by Douglas Bagnall to give an example. (on a side note: I would like to contact the author, but couldn't find him registered on this board, has anyone got means to contacting Douglas?). The engine is simple and only accepts "go depth n" commands.
To run p4wn, you have to launch the application with the path to the loader js file in the command line (e.g. "jsuci_1.exe p4wn\p4wn_loader.js")
Now some technical notes:
The communication with the engines relies on the new HTML5 standard for Web Workers. The engines are started as individual threads and then UCI commands are sent over the default pipes.
Does there exist any interest in this new tool? As a tester? Engine programmer? Others?