Saturday, July 29, 2023

Energy Efficiency of Programming Languages (video script)

 Energy Efficiency of Programming Languages

Programming for Abundant and Scarce Energy Applications

Year 2023, month of July, in this video I will be discussing an academic paper from 2017 about the energy efficiency of various programming languages. The paper is called Energy Efficiency Across Programming Languages by Rui Pereira, Marco Couto, Francisco Ribeiro, Rui Rua, Jácome Cunha, João Paulo Fernandes, and João Saraiva. We often forget the science part of computer science and I am glad they more or less formally stated and tested what we all know intuitively. First off, all of these measurements depend on the compiler, and the algorithms being implemented. Generally compiled languages are more efficient, followed by virtual machine languages like the JVM, and interpreted languages are more energy intensive. Measuring for energy, the physics concept of a joule, C, Rust, C++, and Ada top he list, followed by Java which takes about twice as much energy as an equivalent program in C. Interpreted languages like Ruby, Python, and Perl are all at the bottom of the list consuming 70 to 80 times more energy. The results are similar for time consumed and memory consumed, although Pascal, a language even older than C rises to the top and Go makes an appearance as well for memory efficiency. The paper also remarks that programming language paradigms can also be ranked by efficiency in all of these measurements and as you would expect imperative programming languages are more efficient, followed by Object-Oriented, and dead last is the elegant looking functional programming paradigm. From this research we can conclude that there will always be a role for very simple pointer-based languages like C and Pascal when energy consumption is a consideration for the application. Perhaps it runs on cheap batteries for example. The creator of Pascal is still alive by the way, Niklaus Wirth. He’s nearly 90. In an energy abundant future we can used interpreted languages. Will the future in general be energy abundant or energy scarce? Well, we’ll see. Let’s be prepared for both possibilities . 

No comments:

Post a Comment