Sunday 23 February 2020

The Art of Dying

I'm a big fan of Spanish cinema. This has nothing to do with what my passport says or my feelings of identity (these feelings have changed over the last decade, but my high consideration for Spanish cinema remains the same). Spanish Dramas or Social films are well known, but there are also many pretty good terror films (and thrillers, crime, even film noir). I've recently watched for a second time (the first time was around 12 years ago) a quite unknown piece, El Arte de Morir/The Art of Dying. I remember how much I enjoyed it the first time, and this second time the experience has been similar.

The aesthetics are pretty nice (of course I very much appreciate the references to El Bosco), the pace and the story are good and the acting of Fele Martinez (this guy will always have my huge respect after his performance in Tesis) is excellent. The key element in the film that makes of this film one to be remembered for me is the concept revealed at the end, that dying can be a gradual process, same as the process of being born takes 9 months, dying could take a long time. This does not refer to how we get close to death as the time passes by and our body ages, they are talking about what happens after the moment one person is considered dead. The body has turned off for sure, but maybe it's not the same for consciousness. Maybe this awareness is not immediately switched off, it just starts to decay, it starts to lose its memories and references until the moment all of them are lost, and then the real death occurs... Well, a pretty interesting idea I think.

Sunday 16 February 2020

Extending Async Iterables

A few months ago I did a POC about extending Iterables with chainable common functional style methods like map and filter. Doing the same for Async Iterables is really simple, it's mainly a matter of replacing the internal for-of loop in each method with a for-await-of loop, and replacing [Symbol.iterator] with [Symbol.asyncIterator]!
I've put the code in a gist, I'll paste here just one section:

class AsyncExtendedIterable{
    constructor(iterable){
        this.iterable = iterable;
    }

    
    async *[Symbol.asyncIterator](){
        for await (let it of this.iterable){
            yield it;
        }
    }


    map(fn){
        //I need to use the old "self" trick, cause we can not declare a generator with an arrow function
        //so as we are using a normal function, "this" is dynamic, so we have to trap it via "self"
        let self = this;
        async function* _map(fn){
            //printDebug("_map");
            for await (let it of self.iterable){
                //printDebug("inside _map");
                
    //we can await in a non Promise value, so if we do "yield await" rather than just "yield", we are contemplating both a sync and an async fn mapping funtion
    //yield fn(it);
    yield await fn(it);
            }
        };
        let newIterable = _map(fn);
        return new AsyncExtendedIterable(newIterable);
    }

What is really sweet is that thanks to the fact that for-await-of loops work both with normal Iterables and AsyncIterables, we can use this AsyncExtendedIterable class with Synchronous Iterables. Furthermore, once our internal _map, _filter... functions have been declared as async, we can make them work fine with an async iteratee function (the function that we pass to the map, filter methods), by just adding an await to the call. This will work fine with sync and async iteratees because we can await synchronous calls without problem (the runtime just wraps the returned synchronous result in a resolved Promise). Just check the example in the gist.

Saturday 15 February 2020

The Wind that Shakes the Barley

I've recently watched Ken Loach's The wind that shakes the barley and it has shocked me and ashamed me. It has shocked me cause the story is so powerful, gripping and emotive, it's a real piece of art. There are few films that have made such an impression on me, I can think of Gattaca, Incendies... It has ashamed me because it has taken me 14 years to watch it, and because it has reminded me again how many essential parts of world's history remain unknown to me.

The story in the film is of particular interest these days, as due to the recent elections in Ireland and the important change in the power balance, with the Sinn Feinn winning the elections in votes, newspapers have been mentioning the Irish Independence War and the Irish Civil War, and how this latter still plays an important role in current politics, with allegiances that still today are inherited from those times. I think the Irish Civil war is a rather unknown conflict to outsiders, particularly if we compare it to the Spanish Civil War. It's normal, the Irish one was a local conflict, with a "relatively low" number of casualties, while the Spanish one had an international involvement as one initial step of the global war against fascism that would be unleashed immediately, caused the almost destruction of a society, and had as aftermath a dictatorship that oppressed Spaniards for 40 years. All this said, there's an element of brutality in the Irish conflict that I think we don't see in the Spanish one, people that months before had risked their lives together sharing common hopes and a common enemy, suddenly found themselves on different sides shooting each other...

I think an accurate word to define this film is brutal. First we have the terrible violence exerted by the British soldiers and their enormous despite for the Irish population. Then the strict treatment of the Irish revolutionaries to their traitors, and finally, the devastating part, the violence between brothers in arms (and real brothers) during the civil word between those that accepted the "partial independence" treaty with the British and those that rejected it, aiming for full independence, a reunified Ireland and a socialist state.

The films has also confronted me with how much I've changed in these years. If I had watched this film at the time of its release, I'm pretty sure the radical leftist that I was would have totally sided with the anti-treaty side, now, this "almost conservative", law abiding citizen that I am, understands pretty well the pro-treaty side.

When I travel somewhere I try to read as much as possible about the history of that place and watch some related movies, so bearing in mind that I was in Ireland for a few days in 2007, it feels really odd to me that I had not watched this film and had almost forgotten about the Irish Civil War. At that time I was really busy at work with a project that we had to have ready, so I guess I had not much time to do "my homework".

Thursday 13 February 2020

Grands Travaux Inutiles

Some days ago I was discussing with some people about the MetroTren Asturies project. This project involves several kilometers of underground tunnel with several stops in my town, Xixón, so many people think of it as a sort of Metro. That's the main reason why there is a common perception of it being an unnecessary project for a city of this size. People have not understood that this has nothing to do with a local Metro, but with a section of a light rail system (think of Parisian RER, Berlin s-Bahn...) for the Central Asturies metropolitan area. I think this can be a really useful project and I'm rather happy that after too many years on hold due to financial problems now the project seems to have been resurrected.

This reminded me of the Charleroi Metro, also a light-rail system that was on hold for a very long time. Reading again about this work I ended up finding one really interesting wikipedia page, the list of Grands Travaux Inutiles/Big useless projects. The French language entry contains an impressive list (nothing to do with the skinny English entry), with particularly rich sections for France, Quebec, Spain (quite expected :-) and even a separate page for Belgium. Checking that list one learns about the failed Liege Metro, that with a built tunnel reused as storage space reminds me a lot of what could have been the future of the Xixon's Metro Tunnel (but as aforementioned, hopefully the project seems to have been restarted).

It's important to note that such list of "useless projects" is not exempt from subjectivity, as it does not only contain projects that were never completed or never entered into service (or never achieved any success among users), but also projects that the green-red totalitarianism has deemed unnecessary and has managed to cancel (even if the average, not far-left-far-green citizen was in favor) like the Notre Dame des Landes Airport or the Sivens reservoir.