C Is the Greenest Programming Language
hackaday.com
hackaday.com
Should we factor in the additional energy and time of running the developer's machine just to implement some basic features built-in in languages such as Python?
I love writing C don't get me wrong. But it is a tricky language for modern software development, and a very big security liability.
The food it eats, the climate control it needs and the trash it exhausts on a daily basis just to write some incredibly "green code".
Sounds like green credits.
The future of critical low-level programming is a better C or just plain simple C used in tandem with code generators like F*, deductive program verification like Why3 or just good old mathematics that many are irrationaly afraid of like TLA+.
Games fall right into that category. But my hope is that one day people will write games in more secure and slightly less verbose languages, like Rust.
Most other software needs can be fulfilled by wrappping C function calls in Python or some other interpreted language.
Right now I'm working with fax machines and I have to provide a C library which is consumed by Scala services. Neither C++ nor Rust would have been an advantage as we are familiar with other methods of verification which are more battletested.
People still use fax machines? What is the use case?
The most natural evolution at this point is to develop languages that have powerful, native multi-threading support.
So far, only Rust, Go and few functional languages qualify for this.
Something like Go's channels.
It doesn't do macros.
It doesn't have all the .H files.
It doesn't default to null terminated strings
It also has a lot of nice features Begin/End make it easy to see blocks
It has clear syntax for dealing with pointers. @P is the address of P, P^ is what the pointer P points to
It makes it easy to tell assignment := from equality tests =
It defaults to passing function parameters by value, but can also pass by reference, or pointer.
It does separate compilation (units)
Strings are memory managed for you, counted, and can even have nulls in them.
Identifiers aren't case sensitive.
It now supports for .. each in loops
You can even participate in the Google Kickstart rounds in free pascal to hone your skills.As for the IDEs, Lazarus is indeed a great option, allowing for both desktop software and most other kinds of development (though admittedly Pascal's strengths don't lie in webdev): https://www.lazarus-ide.org/
Edit: I was most surprised to see Pascal on top, but that's probably due to it being very old. Back then it had to be fast by modern standards, to be usable on contemporary machines.
> We analyzed 27 different programming languages, each with roughly 10 solutions to the proposed problems, totaling out to almost 270 different cases. These solutions were developed by experts in each of the programming languages, with the main goal of "winning" by producing the best solution for performance time. While the different languages contain different implementations, they were written under the same rules, all produced the same exact output, and were implemented to be the fastest and most efficient as possible. Having these different yet efficient solutions for the same scenarios allows us to compare the different programming languages in a quite just manner as they were all placed against the same problem.
If this is their methodology, I'll give them the benefit of the doubt on their results. I'd love to see the code!
Seems there is an updated paper by same author: https://haslab.github.io/SAFER/scp21.pdf
And results table: https://sites.google.com/view/energy-efficiency-languages/re...
And results charts: https://sites.google.com/view/energy-efficiency-languages/up...
run time is far more important than build time.
Not speaking from experience, but I'd presume there are quite a few custom software projects that are designed for one single client running on a cluster of handful of machines.
But really, in most cases you aren’t running once per compilation.
C and hardware are a bit of a cyclic match of dependencies.
It doesn't have to stay this way, but it probably will.