Re:Energy Efficiency in Programming Languages
by melling on Saturday September 16, 2017 @10:36AM
(#15264808)
Does this mean for mobile devices like phones, tablets. watches, VR/AR headsets, etc, would should prefer compiled languages?
[ Parent
| on HN ]
Re:Energy Efficiency in Programming Languages
by majewsky on Saturday September 16, 2017 @10:46AM
(#15264843)
On a broad scale, yes. But it also proves that the efficiency of particular languages depends on the problem at hand. For example, if your problem is searching for a pattern in large strings, a simple Perl program using the builtin regex support will easily beat a C/C++ program that hand-rolls pattern matching, because Perl's regex engine has been optimized for over two decades.
On the topic of mobile devices, I recall the Nokia N900, which ran mostly C and C++ software. Its UI performance was comparable to contemporary smartphones even though it only had 256 MB RAM and a single-core 600 MHz CPU. (Of course, a major part of today's phones' slow UI is all the bullshit and spying that apps are doing in the background.)
Re:Energy Efficiency in Programming Languages
by nv-vn on Saturday September 16, 2017 @10:43AM
(#15264835)
If your primary metric for good software is {speed,memory use,energy efficiency} then yes.
Re:Energy Efficiency in Programming Languages
by darkhorn on Saturday September 16, 2017 @10:47AM
(#15264848)
Linux and Darwin is written with C. They are the OSs of Android and iOS.
But would be nice to have some mobile apps written with C.
Re:Energy Efficiency in Programming Languages
by mpweiher on Saturday September 16, 2017 @01:23PM
(#15265560)
Lots of mobile apps are written in Objective-C, and Objective-C is C. A superset of C to be exact.
Since it's a single hybrid language, it's trivial to remove slower features fro, performance-intensive parts.
See my UIKonf talk https://www.youtube.com/watch?v=kHG_zw7%205SjE&feature=youtu...
Or my book: https://www.amazon.com/gp/product/0321842847/ref=as_li_tl?ie...