Sunday, 27 January 2019

Soundtrack Second Half 2018

As I explained in a recent post, in the last months I've gone back to my musical roots, listening to tons of screamo (the darker the better) and some (neo)crust. Some of these bands have made me enjoy of music as I had not done in years, with some songs being real jewels. I'll put up here a selection of bands that have become the soundtrack to these last months. The order is mainly random, it's not meant as a sort of classification.

  • Ojne. This Italian band is just incredible. They don't play the kind of ultra-dark screamo that I'm particularly into, indeed one could say that for my taste they live in the calm zone of the genre, though with some very intense fragments, very powerful vocals and melodies that are plain beautiful. Tredici, the first song in their last Lp is just shocking, a piece of pure beauty.
  • Mihai Edrisch. This French band from Lyon existed at the time when I was mainly stopping to listen to Screamo (and other HxC-punk derivates), so their name was familiar , but had not really paid them attention at the time. Wow, they have some of the most desperate vocals I've ever listened to, and the instrumental is deeply dark and powerful.
  • Ampere. I was for sure a big Orchid fan (and I am again), so when checking now, so many years later, if their members had given the world some other similar band, I was pretty delighted to find Ampere. Dark, short and intense songs, not much more to say.
  • June Paik. As you can see in that previous post, One Eyed God Prophecy and Uranus are 2 of my favorite bands. Though profoundly influential, it's not easy to find bands that are really similar to them, well, June Paik has the most OEGP's like sound that I can think of.
  • Drein Affen. This trio from Torrelavega, one ugly small town 3 hours far from my Asturian hometown, creates one of the most intense crusty screamo sounds in the current world. I recently saw them live, and they just kill it.
  • Potence. French band from Besancon. While one could say that French bands shaped the screamo world for at least 1 decade (between 1995 and 2006), I can hardly think of any interesting crust band (Opstand, but that was more Powerviolence), so Potence has been a really nice surprise. Catchy modern crust with an excellent sound.

Starting in 2001 I think and lasting a few years Galicia (particularly A Coruña) produced [1] [2] some the best neocrust bands on Earth. Ekkaia has become a cult band, and Madame Germen gained a good bunch of recognition, same as Ictus. I've recently discovered or rediscovered some of the not so well known bands of that Galician School:

  • Das Plague. Though part of that same scene, you'll find no crust influences in their ep. They played beautiful and intense emotional hardcore. I don't call them screamo cause the vocals do not fit in the classical screamo model for me (they're strong, but not screamed).
  • SlS3. No crust influences from my point of view either. Screamo of the highest and purest intensity, with some songs that make me think of OEGP and the Canadian sound.
  • Asedio. Just the inverse for this band, no emo influences at all, pure, high quality headbanging crust (with some rock&crust influences)

Saturday, 19 January 2019

Void as a Generic Type

TypeScript allows you to use void as a generic type. I mean, you can declare a Promise<void> (the Promise resolves to no value) or an Observable<void> (the Observer gets called with no value). I first made use of this feature copy/pasting and adapting some code, so did not give it much importance, but later on when writing code from scratch it's when I realised that this <void> thing was indeed something new to me as it does not exist in C# (the main language with generic types that I work with).

In C#, where void as a generic type is not allowed, we have 2 different types, Task<TResult> and Task. Task<TResult> is used for returning a value (it has a Result property) while Task is used when no value is going to be returned (it lacks a Return property). So I saw myself with the confusion of whether my TypeScript function returning a Promise that resolves to no value should return just a Promise or a Promise<void>. Well, both compile OK, but Promise<void> has a much clearer semantic.

//promise resolving to no value
let p = new Promise((res, rej) => res()); 

let p1 = new Promise<void>((res, rej) => res()); 

//promise resolving to string
let p2 = new Promise((res, rej) => res("hi"));

let p3 = new Promise<string>((res, rej) => res("hi"));


//this one, compiles OK, it's supposed to resolve to a string but I resolve to no value
let p4 = new Promise<string>((res, rej) => res());

 //but this one gives a compiler error
//let p5 = new Promise<void>((res, rej) => res("hi"));

Thing is slightly different for Observables. For those sending no value to their Observers we have to use Observable<T>. The TypeScript compiler does not allow us to use a non generic Observable type. Seems a bit odd to me, Obviously at JavaScript level we have an Observable class, but it seems like the type definition file for Observables has been done only for Observable<T> and not for Observable.

function f1():Observable<void> {
    return of();
}

//compiler error
// function f2():Observable<void> {
//     return of("string");
// }

function f3():Observable<string> {
    return of("hi");
}

function f4():Observable<string> {
    return of();
}

Nullable References

Reading about the new features that C# will delight us with I felt a bit surprised with the Nullable References one. If you enable the feature, references will be considered as not nullable, unless that you explicitely state the contrary by defining it like this: MyType? mt;. Trying to assign a null value to a reference not declared as nullable will cause the compiler to throw a warning. There are no runtime verifications, it's all at compile time, and it won't prevent your code from being compiled, as I say it will just throw a warning. This warning should be enough to make you review your code and save you many potential problems at runtime.

I pretty much liked the feature and it seemed like something totally new to me, but indeed something almost identical exists in TypeScript since version 2.0. Non-nullable types can be enabled with the --strictNullChecks compiler option. Using this feature will make the compiler throw an error (but well, it's TypeScript, so the code will still get transpiled into JavaScript) each time you try to assing a "null like value"m that is, null or undefined. If when using the feature you want one reference to accept any of those values you'll have to define it like this:

let y: number | undefined;
let z: number | null | undefined;

Notice that this TypeScript feature has nothing to do with the ? optional properties that you can define in types and that so nicely play with the TypeScript structural typing nature.