We are a user experience design and software development firm
Hire us to design your site, build your application, serve billions of users and solve real problems.
I've been building GWT interfaces for a while now, and it's been pretty cool. My attrophied Swing skills are slowly coming back and the kinds of stuff I've written has been leagues beyond my early Ajax stuff. So far so good.
Throughout it all, I've been trying to obey my own principle of avoiding leaky business logic and sensitive data. That means that most of the heavy lifting, business logic wise, happens on the server side.
This past weekend, however, I got a rare chance to do some programming for myself. One of my hobbies is chess, and I've written a few programs over the years to help me study and analyze the game. Right now I'm putting the plumbing together for a web/iphone application site. I've got all the stuff that handles FEN, move generation, PGN and UCI (interfacing to chess engines) on the server side, and the application side is mostly concerned with board displays.
It seemed kind of inefficient to make a round trip for every FEN or move generation operation, so I thought I'd write a simple bit of chess code in Java and compile it as a library using GWT. After all, this isn't proprietary or high security business logic that can't sit in the browser. Before I did that, though, I took another look at my favorite chess library, Chesspresso. It's a sort of swiss army knife chess utility library that was originally developed for a chess database application. Big, sophisticated, nice.
An hour later after stripping out all of the java.io.* specific code, I had a nice GWT library that did FEN, move generation and position state for me, all in a pretty svelt 50k of JavaScript code. I had an "aha" moment very similar to the one I had on seeing "write once, run anywhere" actually work with Java on Windows and Solaris back in 1998. Here I could port this non-trivial Java library to run in the browser in literaly a matter of minutes. I was jazzed about GWT all over again.
The idea isn't to write a high performance chess playing program. Even with all of the performance improvements in TraceMonkey, you're not going to be able to get that kind of speed out of current JavaScript engines. But to avoid having to make a round trip for every chess specific bit of logic, this is certainly a good way to go.
I'll have an iPhone version of my analysis app up by the end of October, depending on how many free weekends I get.
Hire us to design your site, build your application, serve billions of users and solve real problems.
Hey! I just read this. Did you ever get it working?? I’d love to get in touch and talk about maybe working together!?
Email me => chessdev [+}gm4il.com
Erik
http://www.chess.com/members/view/erik
Comment by Play Chess, Friday, October 24, 2008 @ 4:00 pm
[...] I blogged a few weeks ago, I ported the Java chess library ChessPresso into GWT, which was a blast and an example of how you [...]
Pingback by Pathfinder Development » Chess Game Viewer in GWT, Tuesday, November 11, 2008 @ 6:14 pm