Category Archives: programming

Tail call optimisation in Javascript

I just happend across this old link

Basically it’s a (surprisingly elegant) way of creating tail call optimised functions in javascript.

There’s a slight subtlety with it unfortunately – you can’t simultaneously have a function call itself in a non-tail recursive manner. If you do it will break things.

It claims to support mutually recursive functions, and I think this is true, but I bet you’ll find there are some finicky details which can cause the stack to grow unboundedly before the optimisation kicks in, and I think you might have trouble properly optimising mutally recursive calls in this manner.

Still, very cool.

This entry was posted in programming and tagged , on by .

Viral XKCDing

Pardon me while I maliciously subvert a viral marketing campaign. :-)

THE ALGORITHM CONSTANTLY FINDS JESUS
THE ALGORITHM KILLED JEEVES
THE ALGORITHM IS BANNED IN CHINA
THE ALGORITHM IS FROM JERSEY

This entry was posted in programming on by .

Blatant and malicious evil

From freenode ##java:

10:13 < DRMacIver> cybereal: Oh, I figured out how to work around the Java type system to make my generators work. It requires a bit of a rearchitecture though.
10:13 < DRMacIver> It’s blatant and malicious evil I’m afraid. :)
10:13 < cybereal> That seems to be the way of things for you lately

This entry was posted in programming and tagged , on by .

More JTypeBuilder

No further work done on it at the moment, but that’s because I’m rethinking its architecture.

Rather than building a DSL, I think it’s much more sensible to use abstract Java classes as the templates, with the generated classes subclassing a user defined abstract class and the abstract methods and annotations defining which methods are going to be generated.

This will let me switch to a more APT centric approach. I’ll probably start using apt-jelly for this, as it works quite well with the existing freemarker based approach.

This entry was posted in programming and tagged , on by .

Job applications

It has occurred to me that this blog is eminently findable when starting from my name, and that consequently the companies who I’m interviewing with at the moment will no doubt see several rather annoyed rants on computer related subjects attached to said name.

Rather than retract these, I wish to quote the words of a great man on this subject:

Fuck that shit

(Hotlinking done with permission)

I do hope the existence of these rants doesn’t put you off. If it does, then we’re probably not compatible anyway. Sorry.

David

This entry was posted in programming and tagged on by .