Category Archives: Programming

Closed-Form Expression to Calculate n-th Fibonacci Number

A more interesting way to find nth Fibonacci number.

Fibonacci sequence is a prime example in teaching recursion to newcomers, and a great opportunity to brag if your language supports Tail Call Optimization, but it often goes unnoticed that there is a closed-form expression which lets us find the nth Fibonacci number with great ease and in much faster way. This article will present the expression, and explain -step by step- its derivation using high-school mathematics.

Continue reading

Using LLVM’s IR for semi-compiled packages

As many other things that comes into my mind between 1-3 AM, this is also a bit blurry.

I was thinking about the possibility of utilizing LLVM’s Intermediate Representation to pre-compile packages into an intermediate language which is high level enough, and yet with its dense bitcode representation, can easily shorten compile times by reducing the time that is spent on parsing, analyzing and intermediate code generation.

Distros such as Gentoo can benefit from to a great extent I believe, but as I don’t know how their system works, I can not elaborate about the details. Also any open source project, that doesn’t provide pre-built packages, can at least use this method to shorten build times of their users.

I’ll think about it, to come up with an idea.