After an awesome longboarding session yesterday afternoon I decided to play around with infinite sequences in Haskell – it’s supposed to be one of the more (most?) powerful features of Haskell – because it’s a lazy language apparently. My first impulse of creating a primes generator was nipped in the bud by a long page [...]
Sabbatical week day 3: Raining datatypes
I’m taking a sabbatical week over the holidays. This week’s posts will serve as a sort of report of what I got up to the previous day instead of the usual schedule – wish me luck that I achieve even half of what I’d like to. As I sit here slowly sipping on my tea [...]
Learning me a Haskell
A couple of days ago I decided that doing my graduation thesis on a topic that, when suggested, brought a sparkle to my mentor’s eye and made him suggest I might want to think about picking a co-mentor just wasn’t hard enough – so I decided to do the whole thing in Haskell. I want [...]
Javascript’s lack of strftime
You know that one piece of shitty code that always makes you cringe? Something along the lines of months = ['Jan', 'Feb' ....]; dateString = date.day()+’ ‘+months[date.month()]; Yeah that piece of code. Let’s talk about that. It sucks. There is a special circle of hell for people who do it and yet JavaScript developers are forced [...]
Fun javascript feature
Not only was my nondeterministic turing machine implementationway too long at 20 lines, it was also wrong. Shortly after @dionyziz reported a bug and it took me until last night to get around to fixing it. The problem was that when I was passing tapes for each possible step into the next iteration of the [...]
A turing machine in 133 bytes of javascript
The fact it took me 20 lines of javascript to implement a nondeterministic turing machine simulatorlast week kept me up at night. All weekend. Too much code for something so simple and I kept having this gut feeling implementing a basic version shouldn’t take more than 140 bytes. Sunday afternoon I sat down for about [...]
Parsing JavaScript with JavaScript
Over the weekend I started working on llamaduck- a simple tool that aims to figure out whether your code will run on the newly released node 0.6.0. Eventually it might be able to perform other compatibility assessment tasks as well, but I’m focusing on simple stuff first. Or at least I thought it was simple. [...]
Programmers are fucking lazy
With the possible exception of philosophers, programmers are the laziest bunch of people I know. It seems like everyone else I speak to has some sort of labor intensive profession. Think about it, biologists do all those experiments … giving a drug to hundreds of mice is can’t be automated. Doctors have to physically inspect their [...]
Functional isn’t always better
For a long time now I’ve been completely in love with functional programming to the point that I write functional-style code even in run of the mill normal languages. There are many reasons I like functional code, the paper Why functional programming matters, by John Hughes sums up my opinion perfectly. A few days ago [...]
Discovered a cool javascript property
Yesterday I was playing around with javascript trtying to find the cleanest way to implement callbacks in functions. Primarily I wanted a readable way to make certain the last argument passed is a callback, withut having to rely on knowing how many arguments there are and so on. Instead I stumbled upon a pretty cool [...]
