Carbon footprint of interpreted languages

Thought from a good discussion with at François at OSDC today, what is the carbon footprint of various languages? He mentioned that the carbon footprint of a new Haskell compiler release is remarkably non-trivial due to every Haskell package in Debian needing to be rebuilt.

So, I thought, what’s the impact of something like Python? (or Perl). Every machine running the code has to do the bytecode compilation/JIT/interpretation of that code so when, say, Ubuntu ships some new version of $random_desktop_thing_written_in_python, we’re actually compiling it well over 20 million times. That’s a remarkably non-trivial amount of CPU time (and thus CO2 emissions).

So, program in compiled languages such as C or C++ as doing so will save polar bears.

3 thoughts on “Carbon footprint of interpreted languages

  1. When a hackage package like xmonad is installed, it is installed not as a source file but as a combination of object and interface files in addition to binaries, this is due to native backend of GHC being used. So, the corresponding analogy (though not a strict equivalent) in C/C++ world would be an upgrade of C/C++ runtime – in this case of glibc and gcc which necessitates rebuild of everything (including ghc ironically).

  2. Probably a bit more problematic for C++ due to std lib complexities, but there’s no real reason to rebuild every C program just because parts of the toolchain changed… binary compatibility is pretty good. Generally we rebuild everything because new versions of GCC have better optimizations or and/or warnings.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.