Thursday, March 12, 2015

Jython compiler

Quote from site :
Playing around with it since yesterday, from what i have noticed, the jythonc compiler is missing in 2.5.x version of jython. But on doing a quick search i found a java based jython compiler scripts ( here and here ). Also there don't seem to be any jython compiler scripts in jython, perhaps i maybe looking at wrong place. So i wrote up a quick script which tries to do that.

Roll your own server in 50 lines of code

This article explains how to dispatch requests to python modules.
Where nice way to organize code.

Catch “before/after function call” events for all functions in class

Very nice tip :

Monday, January 26, 2015

Discovering Monads

There is  plethora of tutorials on Monads.
What if for the initiation, simply expose the code without naming anything, neither
Let us, just read the code and try to understand.

function init(v) {
  return function() {
      return v;

function bind(wv, fn) {
    return fn(wv())

function addOne(x) {
    return x + 1

function mul2(x) {
    return x * 2

function sqrt(x) {
    return Math.sqrt(x)

function lift(f) {
    return function (val) {
        return init(f(val))

function execute(lstf, value) {
    var nlstf =
    return (nlstf.reduce(bind,init(value)))()  

var result = execute([addOne,sqrt,mul2],5)