L’applicazione per Mac di Slack è basata su Electron, il che significa che non è nativa e che ogni volta che scaricate Slack scaricate, anche, una copia di Google Chrome. Lo stesso vale, fra le tante, per il client di posta Nylas, l’applicazione per prendere appunti Simplenote, e l’editor di codice Atom (per Spotify il discorso è un po’ diverso, ma il risultato lo stesso). Chrome è fatto da circa 15 milioni di linee di codice, non è proprio piccolo insomma: per dimensioni è simile al kernel di Linux.
Questo significa che ogni volta che scaricate un’applicazione basata su Electron scaricate anche un sacco di roba che non serve a nulla, ma che l’applicazione si porta appresso:
You can think of slack as a small javascript program running inside another operating system VM (chrome), that you have to run in order to essentially chat on IRC. Even if you’ve got the real chrome open, each electron app runs its own, extra copy of the whole VM.
And its not a stretch to call chrome an OS. By lines of code, chrome is about the same size as the linux kernel. Like the linux kernel it has APIs for all sorts of hardware, including opengl, VR, MIDI. It has an embedded copy of SQLite, memory management and its own task manager. On MacOS it even contains a userland USB driver for xbox360 controllers. (I know its there because I wrote it. Sorry.)
Does slack contain my code to use xbox controllers? Does the slack team know? Does anyone know? I mean, the slack app is 160 megs on disk.
La conseguenza è che queste applicazioni — nonostante alcune siano semplici: una chat, un editor di testi, etc. — pesano molto, sono lente, consumano tanta batteria e risorse per funzionare.