| ▲ | The Green Side of the Lua(arxiv.org) | |||||||||||||||||||||||||||||||||||||||||||||||||
| 46 points by radiator 3 days ago | 28 comments | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | dbdr an hour ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
This paper is relevant: Energy Efficiency across Programming Languages: How Does Energy, Time, and Memory Relate? https://greenlab.di.uminho.pt/wp-content/uploads/2017/09/pap... This is the main summary table: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Rochus 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Interesting results. Particularly they barely found a speed-up of newer compared to older LuaJIT versions (rather the contrary). Maybe they should have used the Are-we-fast-yet suite instead of the (random looking) set of microbenchmarks. I did measurements of Lua and LuaJIT some time ago based on Are-we-fast-yet and saw significant differences in LuaJIT performance (see http://software.rochus-keller.ch/are-we-fast-yet_LuaJIT_2017...). I also compared different PUC Lua versions in an earlier measurement (see http://software.rochus-keller.ch/are-we-fast-yet_lua_results...) and found similar significant differences between versions. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | vaylian 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
The nice thing about Lua is that it can easily be combined with compiled languages. If you identify the hot path in your program, you can implement them in a more efficient language. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | PaulRobinson 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Energy efficiency as a "my language is better than yours" point was not on my bingo card for 2026. JIT as an energy saver intuitively makes sense, and is probably the model most languages need to think about for "shipping to prod". I'm aware Python has started developing this, and given the install base, it's encouraging that results like this show it could have significant benefits for users. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | perilunar 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Save a few watts per device making the client-side code a bit more efficient. Spend Gigawatts running data centres for LLMs. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | winter_blue 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
I'd like to see a study that compares Python and Ruby, against (1) Rust, (2) C, (3) C++, (4) Zig, (5) Go, (6) a JVM language (like Scala or Kotlin or Clojure), and (7) the main CLR language (C#). I would imagine that all 7 of them absolutely trounce Python and Ruby. Python and Ruby have been an immense environmental (and type safety) disaster. JS though (via V8 and other engines) has been surprisingly fast. I've always wondered why Python and others couldn't copy some of the tricks V8 uses to be fast... | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | lucascdotnet 2 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Is the title "The Green Side of the Lua" a pun/parodic allusion to something? I have been compiling a list of papers that have titles with this kind of style. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | fouronnes3 3 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
Is a paper that publishes a 0.01% improvement of something at the cost of 5 times more power really an improvement? I believe that every single computer science measurement metric should have Joules or Watts in the denominator. If you are training a model I want to see performance per total energy consumed. If you are measuring inference accuracy, measure PER WATT. I've always been a bit confused by the apparent tendency of the computer science field to mostly ignore energy and power. We are too often satisfied with the idea that software and programs exist in a perfect whiteboard world of xkcd 505 abstract compute. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | misja111 an hour ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
This kind of article keeps coming back, I've seen similar articles on LinkedIn where the bottom line is to switch from Python to C. The reasoning, in a nutshell, is that if a language allows you to waste fewer CPU cycles, it is more energy efficient, hence greener. This completely ignores the fact that such a language might be more difficult to master because it uses fewer higher abstractions; CPU efficient languages tend to be closer to the machine domain and further away from the mathematical and real world. So while in theory the language lets you write very efficient code, you might well miss the opportunity and it could even be that using some off the shelve abstraction in a higher level language, your code would have been more efficient. To drive that point to the extreme: the ultimate CPU efficient language is the language of the CPU itself: assembly. Try writing an efficient highly scalable webserver in assembly alone, good luck with that. Then there is something else that all these articles conveniently ignore: development speed. Most of us write software for commercial enterprises. Product owners want the new feature tomorrow, not next year. They don't want a clever and amazingly fast application that might crash in production, they don't want security holes by missed buffer overflows. Also, most of us work in a team where colleagues come and go, including yourself. Your colleagues won't be happy with you when you leave them some amazingly cleverly and efficiently written software that nobody understands or can maintain. TL;DR; while all else being equal, the point of the article is true: it has little to no meaning in the real world. Yet, with phrasing like 'green languages', 'reduce the carbon footprint', these articles will catch on to an uninformed audience again and again. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | aa-jv 4 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
As someone who has shipped Lua as a solution to many an embedded dilemma, this is highly interesting work. I wonder if there will be motivation in the future to address energy consumption in future JIT work .. in fact I wonder whether other languages are going to face a similar optimization path. It would be grand to see progress being made on this at a more general scale. I'm looking at you, Python .. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | morgoths_bane 2 hours ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||
O lado verde da Moon. | ||||||||||||||||||||||||||||||||||||||||||||||||||