Re: Energy Efficiency in Programming Languages

The Energy Efficiency benchmark has been doing its round lately on Linkedin. Quite a few languages are included, including C, C++, Ada, Rust, Lisp and many others, but not SWI-Prolog.

Curious where SWI-Prolog stands.

I guess such a measure makes sense on highly scalable servers as well as low powered edge devices.

Dan

The average energy use is probably ruined by the many “out of local stack” infinite loops that my code so often produces :sweat_smile:

I think having a sense of energy use is an interesting indicator …

I keep for example wondering about prolog on smaller devices perhaps even on embedded devices (smaller than Raspberry Pi)… where such considerations are significant.

I can really relate. I can directly gauge how well i understand recursion by how hot my MacBook gets; a lot of times i don’t need any other heating sources :upside_down_face:

Makes sense, but how does Prolog compare to the other languages – where is it positioned.

Is it closer to Lisp, perhaps, or Python.

There are ,btw, micropython interpreters running on devices as small as Arduino’s and Microbit … energy efficiencies for those micro implementation doesn’t seem to be an issue. Perhaps, also because the code tends to be short and for dedicated to perform a specific small function.

(although, even for such small devices there exist real time operating systems. to make (preemtive?) multitasking easier)

Could a micro Prolog run on such devices too and communicate via serial (or other means) with a host system?

Does it make sense to have a Prolog for typical embedded applications of the sort Arduino’s are put to use.