Archive for June, 2009

stateless

06/12/2009

Being pure functional programmer and anarchist, I hate the state and class hierarchies.

javascript & call/cc

06/08/2009

Consider simple example:
function foo() performs a simple AJAX call bar() (web method in ASPX terminology), that returns a value.
Something like:

function foo()
{
   return pageMethods.bar();
}

The code above is wrong, of course. Ajax call is asynchronous; it does not return value immediately. Instead, it takes a callback function as a parameter:

function foo()
{
   calback=function(result)
   {
     alert(result);
     return result;
   }
   return pageMethods.bar(callback);
}

But we still have a problem, because foo returns immediately, and alert is called only later. foo returns nothing.
Call-with-current-continuation could solve this problem, but javascript doesn’t have it.
Of course, there is (more than one) way to solve this, but I don’t know any nice way to do it.

I’ve another blog that talks about continuations and javascript: http://marijn.haverbeke.nl/cps/

book

06/04/2009

Today I got Real World Haskell book

geek plans

06/02/2009

Things I would do if I had more time:

Haskell

Prolog

  • finish course & write a project (probably poddavki or amazons).
  • submit missing items to shootout

General, Libraries

Open-Source

  • continue with tng development.
  • write a plugin for Firefox that uses Knuth’s mathematical spacing algorithm for text formatting.
  • Tabs support for gvim.
games
  • improve my chess
  • improve my go skills
  • write (javascript?) maxit