avatar

amaccis.me

Yet another wannabe software development blog.

Size matters

Since I was curious about PHP Foreign Function Interface, after the release of PHP 7.4.0 I decided to write the library PHP Stemmer, a simple PHP interface to the Snowball stemming algorithms. After some time I thought I could take advantage of that experience for having some more fun, so I thought that writing another interface to the Snowball stemming algorithms (this time with another technology, Node.js) could be the right choice and I wrote Node Stemmer.

TAI and PHP

The first time I’ve dealt with TAI (Temps Atomique International/International Atomic Time) was a few years ago, when I was looking for a “disappeared” email through qmail logs. My first reaction was like: these guys (the ones who set up the logs like that) are nuts! Don’t get me wrong, TAI is awesome as means of time-keeping, because it is extremely precise (atomic clocks deviate only 1 second in up to 100 million years) and we can also consider it very nerdy, just think that one TAI second is defined as the duration of 9.

Trying to learn Haskell - Pattern matching

The first time I read about Haskell pattern matching, Python slicing syntax came to my mind. If you are not familiar with Python slicing, it’s easier than you think. Imagine you have a list of n items, and you want to get a subset of that list, let’s say you want all the items of the original list except for the first one. Python solves the problem in a simple and elegant way.

Trying to learn Haskell - Recursion

It’s a fact that we, bad programmers, avoid the recursion as much as we can. Maybe it’s a practice you absorb when you program with imperative languages or, somehow you’re pushed to think about optimization (iterative algorithms are often faster than recursive ones) or you tell yourself that recursion produces code hard to read, to debug and to maintain, but the fact is that whenever you can apply loops (almost always) you do it.

Trying to learn Haskell - List comprehensions

Every time I tried to learn functional programming, I hated it and I did not achieve any appreciable result. Probably it will go the same way this time too, anyway I thought to give functional programming, and in particular Haskell, one more chance. For this reason I’ve just started reading a beautiful book: Learn You a Haskell for Great Good!. I thought I may write down all the interesting (or weird) things I find out, trying, if possible, to compare them with other things I already know.

About

I’m a nerd from Sardinia and I write code for a living. That’s it.