Friday, April 14th, 2006

Morfik Chess Application

Category: Showcase

<p>The Morfik team has written a letter to the Ajaxian community, discussing their new chess application, and a lot more:

Last week we officially opened the Morfik website www.morfik.com to the general public and provided for download a fully featured release of the WebOS AppsBuilder for evaluation. I would appreciate it if you could review this release and share with your readers your thoughts on the product. But I would like to quickly say that this not the assistance I am seeking, though it would be nice J.

On our website we have established ‘Morfik Labs’ where we and some of our test developers are placing AppsBuilder sample examples (with source). These sample applications cover websites, business apps, games, mashups etc. They are at different stages of development and are focused on pushing the edges of what can run in the current breed of browsers. The Chess program in Morfik Labs is an example of this.

All the sample applications, including the Chess program, have been developed using the AppsBuilder visual designer and a high level language – Java, C#, Basic or Pascal. There is NO hand coding of JavaScript, or use of code snippets etc. It is all compiled into JavaScript for applications running in the browser and native code for the server. We are very keen to see if there is any limit to what can be achieved in the browser using this methodology, i.e. we are treating the browser as platform. It has been pointed out that “The smart developer isn’t one who knows how to implement it [JavaScript], but one who knows where and when to implement itâ€?. Of course the smart developer also needs to know what the limits are empirically and not subjectively.

Today we released version 0.4 of the Morfik Chess application (release notes below). This version has a chess engine developed with WebOS AppsBuilder using Object Pascal and compiled into pure JavaScript and HTML so that it can run in the browser. It is able to compute at least 2 moves deep. We believe this is the world’s first implementation of a chess engine in JavaScript.

We are developers, not chess engine experts. We have never written a chess engine before. The code is not yet optimized nor is it the most efficient way of writing a chess engine. Our source code is open and we hope interested individuals will take on the challenge to work with us to take this application or its descendants to the next level. They are also welcome to take the concept/code and independently develop a browser based chess engine/application. This is where we would like your assistance; to find people who would be interested in working with us on the Chess program to see how far browser based applications can be taken in the area of raw computing.

This endeavor is driven by the belief that the frontiers of browser applications have not yet been reached for three reasons:

  • Current applications written for the browser are limited because they use hand coded JavaScript. Strongly-typed compiled languages follow a rigorous programming model that has made compilers the preferred tool for building large and complex applications. Compiled code is, by definition, more reliable and scalable than interpreted code. Although the client-side code generated by AppsBuilder is JavaScript, rigorous type-checking and enforcement of referential integrity by the compiler produces reliable and scalable AJAX.
  • Browsers ‘raw power’ is progressing significantly due to competition. What was difficult to do yesterday is possible today and will be easy to accomplish tomorrow.
  • The mindset of developers needs to shift further towards the browser, i.e. it is not just a ubiquitous presentation level but also a ubiquitous OS layer. We may remember the days when developers were asked to move from DOS to Windows. How often the concern was raised that Windows based applications ran slower than those in DOS (and anyway it was only fancy graphics)….but as improvements were made the vision and reality of what could be delivered merged. We are today at the same juncture with regards to browsers. We need to change in order to meet the future. And the future is good.

Morfik Chess

Related Content:

Posted by Dion Almaer at 10:33 am
21 Comments

+++--
3.5 rating from 34 votes

21 Comments »

Comments feed TrackBack URI

Grr..whether you like your languages interpreted or compiled the compiled code is not better BY DEFINITION. It is not more reliable BY DEFINITION nor is it more scalable BY DEFINITION.

Comment by logicnazi — April 14, 2006

Hold on here, some odd statements are being made:

Current applications written for the browser are limited because they use hand coded JavaScript.

Hand coded JavaScript limits web applications? How else does one write code? Just say “Make it so?”

Strongly-typed compiled languages follow a rigorous programming model that has made compilers the preferred tool for building large and complex applications. Compiled code is, by definition, more reliable and scalable than interpreted code.

JavaScript is an interpreted language, so how does compiling (converting?) another language to JavaScript make it more reliable and scalable?

Although the client-side code generated by AppsBuilder is JavaScript, rigorous type-checking and enforcement of referential integrity by the compiler produces reliable and scalable AJAX.

Whether type-checking is necessary is debatable. Verifying referential integrity sounds quite useful. But this does not produce reliable and scalable AJAX. Heck, AJAX applications run on the client, where there is no such thing as scaling. It’s about how well the server is able to handle the XHR requests.

So, what to conclude from this? Does the Morfik team dislike JavaScript and would they rather spend resources on creating compilers so they can work in their favorite language?

Comment by Mark Wubben — April 14, 2006

Hold on here, some odd statements are being made:

Current applications written for the browser are limited because they use hand coded JavaScript.

Hand coded JavaScript limits web applications? How else does one write code? Just say “Make it so?”

Strongly-typed compiled languages follow a rigorous programming model that has made compilers the preferred tool for building large and complex applications. Compiled code is, by definition, more reliable and scalable than interpreted code.

JavaScript is an interpreted language, so how does compiling (converting?) another language to JavaScript make it more reliable and scalable?

Although the client-side code generated by AppsBuilder is JavaScript, rigorous type-checking and enforcement of referential integrity by the compiler produces reliable and scalable AJAX.

Whether type-checking is necessary is debatable. Verifying referential integrity sounds quite useful. But this does not produce reliable and scalable AJAX. Heck, AJAX applications run on the client, where there is no such thing as scaling. It’s about how well the server is able to handle the XHR requests.

So, what to conclude from this? Does the Morfik team dislike JavaScript and would they rather spend resources on creating compilers so they can work in their favorite language?

Comment by Mark Wubben — April 14, 2006

Does the Morfik team dislike JavaScript and would they rather spend resources on creating compilers so they can work in their favorite language?

That was my impression too. They don’t like JavaScript, and they would rather code in a different language.

They could have just said that instead of the nonsense about compiled code being more reliable than interpreted code!

Comment by Michael Geary — April 14, 2006

If they’re presenting their AppBuilder as a tool to take applications developed in one of these compiled languages and porting it over to Javascript then it does have merit. But I don’t think I would start developing a project in Java etc if my end target was Javascript, that’s like writing a novel in Latin that has an English end target market.

Comment by Mike Ritchie — April 14, 2006

Did you guys check the IDE?

Do you know that you can create a fully working basic database application in 2 hours? That’s right – server side, client side and database design – in 2 hours! Using not notepad, but a cool IDE with a lot of nice stuff in it. Things that regular developer can not live without. Please check them.

And yes, there might be some “nonsense” but every company “press release” has them. And they are arguable “nonsense”. But please, see the product first, see the demos and then comment.

Interpreted or compiled? Who cares? The tool rocks!

Comment by Stoicho — April 14, 2006

I don’t want to put words in anyone’s mouth, but I think an argument can be made that hand coding Javascript (and XHTML and CSS, etc.) is sort of like peeking and poking graphics in the pre-GUI-WIMP days. (See What the Commodore 64 can Teach Us About Ajax.)

While this is fine for the early days of exploring a technology, having a framework and a set of customizable widgets is the more productive way to go. I do still fiddle with bits and track mouse clicks in WinForms and Swing, but only when I’m writing a new component.

I’m on record as being a big advocate of the Echo2 framework, but there are a few other frameworks out there that are taking the component, SPI (Single Page Interface, natch) approach.

So, work in Java (or .NET, or PHP) and have the Javascript and XHTML and CSS generated for you.

Comment by dkappe — April 14, 2006

BTW, it plays a rotten game of chess and doesn’t even detect checkmate correctly.

Comment by dkappe — April 14, 2006

Silly computer moves its pinned bishop out of the way…straight path from my rook to king.

Comment by bigdog — April 14, 2006

Hmmm can’t get their site or chess game to work using Safari. Oh well… useless to me if their app will generate non-Safari code.

Comment by Sean Fousheé — April 14, 2006

While it’s true that they aren’t really compiling anything into JavaScript, it’s kind of silly to suggest that syntax/grammar and typechecking don’t make code more reliable, don’t you think? I like the fact that I’m going to have to pay less attention to every little thing that happens in every little framework with the addition of higher level tools like Atlas and Morfik. All of those details, and the inside of the database and web server engines) are about to be things that I don’t have to worry about any longer.

Comment by Aardvark Face — April 14, 2006

Sorry – and another thing – since I don’t play chess, but the source code is included, why don’t you chess masterminds fix it? I’m more interested in a bug I found in the minesweeper game anyway.

Comment by Aardvark Face — April 14, 2006

Not only does the chess engine not properly detect checkmate, it doesn’t even know to get out of check when it is in it. What’s silly about this is that they could easily have used any of a number of chess engines for this rather than write a seriously broken one. And the ajax front-end, given what it does, is poorly done — playing against the computer gives one an experience equivalent to trying to run Photoshop on a 33Mgz 68k Macintosh, circa 1994, with 16M of RAM, and the client actions aren’t recorded or even graphically displayed correctly until the chess engine has finished with its inane cogitations.

An ajax chess interface is a great idea, but honestly, shouldn’t be that hard to implement, provided that one addresses the problem directly and doesn’t get distracted by writing code generation tools/lousy chess engines.

(I must admit I’d be more positive if the engine hadn’t started to make illegal moves just as I was about to take its queen.)

Comment by Jacob Smullyan — April 14, 2006

I’ll try not to waste anyone’s time by being brief…

1st. Can you write a good application in Javascript? Yes. Could you do it in Assembler? Yes. See anyone trying to write even the most low level applications in assembler today? No. You want to continue working directly with Javascript after this technology is around? Go right ahead and waste your time.

2nd. That is not an Ajax interface/presentation for a chess application. It it is an entired chess application running inside your browser. The moves are calculated/chosen in the browser by Javascript code that was generated entierely by a compiler. THAT is what is being tested, not anyone’s ability to write the greatest chess engine in the planet. Were that the case these people would have written to IBM for a match against DeepBlue instead of the Ajaxian.

3rd. Anyone wanting to comment on a product/article should at least try to understand what it is about, before wasting anybody else’s time (in reading through the comments).

Comment by Mauricio — April 14, 2006

So, using Morfik makes for better code, because one does not need to hand-write Javascript code but can hand-write “Java, C#, Basic or Pascal” code that then will be translated to Javascript.

Looks like targeted to developers who don’t want to learn a new language.

While one can certainly create your average run of the mill web application with this (if this is what your job is about), great web applications result from perusing Javascript’s characteristics, not from supressing them. The great power of Javascript comes from its flexibility, its dynamic nature. Just ask the Ruby folks. “Hey guys, Ruby is holding you back, it is dynamic and interpreted, here looky you could write your apps in this fine static compilable Java, how about that?”

If there is something preventing people from writing great applications, it certainly is not Javascript’s feature set. And this is what the Morfik folks got fundamentaly wrong.

Comment by Martin — April 14, 2006

JavaScript works at a higher level of abstraction than Java or C#. These Morfik guys are completely off base when they imply that coding in JavaScript is a tedious, low-level task. Sorry Mauricio, but JavaScript is a far cry from assembler. JavaScript has full support for functions as first class objects, closures, and anonymous functions. It has a unique and extremely flexible system for object-oriented style programming, and it’s more dynamic features make aspect-oriented programming possible as well. JavaScript’s lack of static types is just a way to increase productivity by reducing unnecessary typing. Take a look at Python and Ruby. Anyone who’s coded in these languages will tell you that “dynamic” is the next step up and JavaScript is in the same league. The Morfik team should really check out this and maybe this too, before they waste more time on “compiling” other languages to JavaScript. Coding widgets and FX is a monotonous task in any language and that’s what libraries are for.

Comment by Brian — April 15, 2006

For whatever it’s worth here is a comment from Morfik:

Here at Morfik we don’t think ‘language X versus language Y’. Indeed all languages have their strengths and weaknesses. Our research has involved looking at the merits of interpreted languages versus compiled languages in relation to the web as well as machine/virtual machine versus interpreters.

Traditionally compiled languages are run by machines/virtual machines and interpreted (dynamic) languages are run by interpreters. Morfik is experimenting with the possibility of making compiled languages to run on interpreters. We do not see an inextricable connection between Java and its corresponding virtual machine, .NET languages and their corresponding framework and interpreted (dynamic) languages and their corresponding interpreters.

We see the current monolithic nature of browsers in their support of computer languages (JavaScript being the only supported language) as negative and as such have developed JST as a way of addressing this need. Those who are avid supporters of JavaScript should not take this the wrong way. We are also great admirers of JavaScript and are fully aware of its many wonderful and clever language features.

Comment by Aram — April 15, 2006

횽들아 체�남방� 똑딱�면 ��한가요?

Comment by 김똑딱 — April 17, 2006

Its really slow application, I dont like this..

Comment by Azer Koçulu — April 19, 2006

things are different since the last time i’ve been here, nice work. i’ll have to stop by more often.

Comment by civil war chess set — October 17, 2006

There’s an ajax chess board at http://www.chessopeningsdatabase.net that can understand all chess moves and even algebraic notation. As far as I can see it is a fully functioning chess board but it is being used as an interface to a chess openings database. That is, there is no chess engine that will suggest moves or allow you to play a game of chess. It is used for analysing openings.

Comment by SL — May 11, 2007

Leave a comment

You must be logged in to post a comment.