Talk:C (programming language)/Archive 19
From Wikipedia, the free encyclopedia
| This is an archive of past discussions about C (programming language). Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
| Archive 15 | ← | Archive 17 | Archive 18 | Archive 19 | Archive 20 |
Energy Usage
This whole section is absolutely bizarre:
Originally, C was popular mostly due to being easier to use than other programming languages.[citation needed] Currently, C is popular mostly due to speed, efficiency, low memory usage, and simplicity.[citation needed] C uses approximately one-eightieth the energy that Python, Perl, and PHP do.[17] On average, C uses less energy than Fortran, despite Fortran being faster on average.[citation needed]
But this line in particular:
C uses approximately one-eightieth the energy that Python, Perl, and PHP do.[17]
Is particularly problematic, as it gives the reader the understanding that C always uses 1/80 of the energy of the other listed languages, when in fact, it uses this while running these specific benchmarks, which have very little (if anything) to do with the real-world use of a language. Let's take Python for example. Which Python? Python 3.13? Python 2.6? CPython 3.13? Pypy 3.8? C as compiled with what? A "typical" C implementation of a given program probably does use substantially less energy than a "typical" Perl equivalent, but stating 1/80 based on some benchmarks makes no sense.
The entire section reads as something you would read on a website comparing Linux distros where it's clear the author has no idea what they're talking about. 196.211.140.249 (talk) 08:55, 21 August 2025 (UTC)
- That was added at 02:36, 18 July 2025 and should probably be removed. I doubt sites.google.com is a reliable source. Also, the WP:LEAD is supposed to be a summary of what is in the article. The lead should not be used to add ideas. Johnuniq (talk) 09:13, 21 August 2025 (UTC)
- Lets not pretend that C uses the same energy usage as Python. The Cython website claims benchmarks where Cython beat the reference implementation of Python in speed by a factor of 95. Even Cython, which few Python users use, uses more energy than typical C program equivalents. Almost all Python users use the reference implementation, which is well known for wasting CPU time, RAM, electricity, etc. Obviously, 95 is higher than the 80 times energy usage increase stated; however, the difference between 95 and 80 can be attributed to the fact that speed is not the same as energy usage.
- Somewhere else on the internet, I saw something where someone got a 75 times speedup in the training of a neural network by rewriting their Python to C, while using the same machine learning library. However, I do not remember where I saw that. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 20:07, 24 August 2025 (UTC)
- The point, which has not been acknowledged, is we don't cite user-generated sources in any instance. Remsense 🌈 论 20:11, 24 August 2025 (UTC)
- This was returned with a WP:ARXIV preprint, which is another kind of user-generated source, so that's not any better. Kindly secure agreement on this talk page before reinserting any variation of this claim. MrOllie (talk) 21:29, 24 August 2025 (UTC)
- @MrOllie, I looked via Google Scholar and thought I saw another version of the paper published somewhere on Harvard's webspace, but I clicked in and saw it was just another arXiv portal or something, whoops. Sorry for the confusion. Remsense 🌈 论 01:05, 25 August 2025 (UTC)
- MIT did a study, as well; however, the paper was paywalled. However, a table of the results was posted to facebook by MIT. https://www.facebook.com/MITCSAIL/posts/the-energy-consumption-of-different-programming-languages-vandriy-burkov-httpsbi/890853283077184/ Does this count as a reliable source? Or is it unreliable because it is on Facebook? Since it is written by an official MIT facebook account, does that override the fact that it is a social media site? Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:35, 28 August 2025 (UTC)
- I know that citing paywalled studies is against Wikipedia policy, and, thus, despite there being many reliable sources, it seems that you will not accept any of them. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:36, 28 August 2025 (UTC)
- I found a large quantity of blogs with similar statistics on the energy usage. If I have enough similar sources, can that count as reliable? Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:37, 28 August 2025 (UTC)
- So, you haven't really looked at WP:RS at all yet, unfortunately. Please do that. Could you explain how that would work, though? Why would that matter? Remsense 🌈 论 22:40, 28 August 2025 (UTC)
- The facebook post contains a dead link. As to there being
many reliable sources
, you still haven't presented one here. No number of unreliable sources such as pre-prints, social media posts, and blogs add up to a reliable source. MrOllie (talk) 22:42, 28 August 2025 (UTC)- I am 100% certain that the statistic is accurate. However, it seems that there is no way that you will accept for sourcing it. If I were to do benchmarks myself, then it would be original research. If I cite blogs with similar statistics, then they are considered "unreliable". According to Wikipedia policy, I cannot cite a paywalled study. The MIT Facebook post is "user generated", so I cannot cite that, even if it is from an official MIT account. Apparently, the similar paper on arXix is considered "unreliable" and "user generated".
- You are gatekeeping legitimate information from being on Wikipedia. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:44, 28 August 2025 (UTC)
- I am 100% certain that the statistic is accurate
- Sorry, but who the hell are you? Do you at least get that the point of these policies is so readers don't have to take a perfect internet stranger's word for everything they read? Remsense 🌈 论 22:46, 28 August 2025 (UTC)
- I am not important.
- However, I have found many sources to support the fact about energy usage. Yall are merely dismissing them all as "unreliable". Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:50, 28 August 2025 (UTC)
- No, you don't know that, because that's not true at all. You would know this if you skimmed the WP:RS policy for any amount of time, so the least you can do is not confuse others by implying you have done this when you did not. Remsense 🌈 论 22:42, 28 August 2025 (UTC)
- I have seen the fact that pay-walled studies is against policies before on Wikipedia. I do not remember where on Wikipedia.
- Besides, I do not even know where the actual study is located on the internet. A quick search is not returning any links to the pay-walled study, despite the fact that it exists. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:47, 28 August 2025 (UTC)
- The policy is to allow sourcing of things behind a paywalled stuff, per WP:PAYWALL. To be blunt, getting to grips with WP:RS is a rite of passage that many Editors go through (I know I did). So in many ways: Welcome abord. Chumpih t 23:00, 28 August 2025 (UTC)
- If the policies are to prevent needing to take an internet stranger's word, then why would pay-walled studies be citable? Pay-walled studies are not verifiable by normal people. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:52, 28 August 2025 (UTC)
- See WP:PAYWALL. You've got this backward. What are the full citation details of this paywalled study? MrOllie (talk) 22:56, 28 August 2025 (UTC)
- I am not sure about the details of the study. I found a post online that claimed that the MIT study about energy usage of programming languages was published in 2021. However, I do not know the name of the study, or where to find it. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 00:45, 29 August 2025 (UTC)
- See WP:PAYWALL. You've got this backward. What are the full citation details of this paywalled study? MrOllie (talk) 22:56, 28 August 2025 (UTC)
- I found a large quantity of blogs with similar statistics on the energy usage. If I have enough similar sources, can that count as reliable? Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:37, 28 August 2025 (UTC)
- The bitly link included in that post is directs to "Warning: This URL has been blocked by Bitly's systems as potentially harmful."
- Regardless, it's more clickbaity than anything. The premise is entirely flawed. I say this as someone who loves the C language, and has written it for well over a decade. 196.61.103.195 (talk) 11:20, 1 September 2025 (UTC)
- I know that citing paywalled studies is against Wikipedia policy, and, thus, despite there being many reliable sources, it seems that you will not accept any of them. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:36, 28 August 2025 (UTC)
- What about this, I found a paper on both https://nyuscholars.nyu.edu/en/publications/ranking-programming-languages-by-energy-efficiency and https://www.iro.umontreal.ca/~mignotte/IFT2425/Documents/RankingProgrammingLanguagesByEnergyEfficiency.pdf about the energy usage of programming languages, and it has a similar statistic. Are these reliable sources? Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 00:47, 29 August 2025 (UTC)
- Great paper, published in Science of Computer Programming and it appears to support claims for C's relative efficiency. Thumbs up from me. Chumpih t 21:25, 29 August 2025 (UTC)
- It's a good paper, but not for the claim:
That is a WP:SYNTHesised claim from the results tables. We should not be making those kinds of claims in this article. The uncontroversial conclusion, supported by that paper (despite being a primary source) is that C is among the more energy efficient languages. Saying things like "on average... Ram usage..." only speaks about an average across specific benchmark tests in a single primary source. We cannot use such numbers. Start from the source and write from there. Don't start with the headline you want to write and try to find sources that match. Sirfurboy🏄 (talk) 08:46, 30 August 2025 (UTC)Implementations tend to be much more efficient than other popular languages. For example, in the paper named "Ranking programming languages by energy efficiency", researchers found typically written Python benchmarks to use 75.88 times more electricity than the corresponding C benchmarks, while taking 71.9 times more time to complete than the C benchmarks. On average, the Python benchmarks had a peak RAM usage that was 2.39 times more than the C benchmarks.
- It is not a "SYNTHesised" claim. I said that the researchers were finding benchmarks to run faster. That is 100% supported by the source. In Table 4, the researchers computed some averages among their benchmarks, which is what I was referring to in my sentence. I never said that all benchmarks in the universe were found to run faster.
- If I say the word "people", does that mean all people in existence? If not, then why should the word "benchmarks" mean all benchmarks in existence?
- I suppose that I could make it a little more clear; however, it was correct as it was.
- Yall are acting in bad faith. You said "Don't start with the headline you want to write and try to find sources that match". I think that you should read your own writing. Yall are starting with the results that you don't want and yall are actively searching for reasons why I cannot add this to the article. For example, one person accused me of having a bad username immediately after disagreeing with me here. https://en.wikipedia.org/w/index.php?title=User_talk:Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO&oldid=1307631178
- You are making up bogus objections so that you can pretend that you are following Wikipedia policy, yet you are focused on nothing other than censoring the advantages of using C over Python. If Python was as efficient as C, then no one would use C. C is more performant. Everyone knows it, whether they will admit it or not. I think that yall are a team of Python evangelists who want to hide the fact that C is more efficient, or perhaps yall are trying to create a narrative that C is only better by a few percent in performance.
- Stop hiding the truth. Stop tricking people who do not know about software development. Most software is incredibly inefficient, by several orders of magnitude. Electron.js is used for apps that could be written in C with SDL. Python is used for machine learning, which is already computationally expensive as it is. Windows 11 is hideously bloated.
- I dual boot Windows 11 and an obscure Linux distro, and the Linux distro takes up more than 128 times less disk space than Windows 11. I would not use Windows at all if I did not have to.
- This is not a micro optimization argument trying to advocate to squeeze out a few percent improvement. Software is many orders of magnitude worst than it could be. The reason for the inefficiency is ultimately that computers are fast and software development is expensive. However, that does not make the inefficiency nonexistent, nor does it lessen it. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 13:57, 30 August 2025 (UTC)
- I replied specifically to you in your section below, where I pointed out the Wikipedia policy on use of primary sources. Please look at what I wrote, and carefully read WP:PRIMARY as I asked you. You are new here, and as has been said, handling sources is a tricky thing on Wikipedia. Even if you are used to writing academic essays, you need to realise that Wikipedia pages are tertiary, and written from WP:SECONDARY sources.Why does this matter? Because again, you are starting from the position of wanting to say Python is many times less efficient than C. Yep, that's right. But what secondary sources are making the point? Why are they starting with Python? How does C compare with peer languages? You are synthesising this subject. The source has data, but you are making it out as if this is unique to C and that Python is some kind of standard benchmark. It's not. And this page is not a comparison of C and Python.As to your comparison between Linux and Windows - you are aware, are you not, that the bulk of Windows was written in C? What is the point of all that sidetrack?Look, you have multiple editors taking issue with this addition. It is not that there is nothing we can say here. C code is efficient, and that will make the code low energy too. But quantising it against Python based on a single primary source is just not encyclopaedic writing. Sirfurboy🏄 (talk) 14:41, 30 August 2025 (UTC)
- I have started looking at WP:PRIMARY right now, and I already see "Primary sources that have been reputably published may be used in Wikipedia.". Therefore, there is no problem with me using a primary source.
- "you are aware, are you not, that the bulk of Windows was written in C?"
- I am aware of that. However, inefficient code can be written in any programming language. A good programming language enables and encourages efficient code. No language can prevent inefficient code. I was talking about the overall trend of inefficiency in all parts of software development, which I think that readers need to understand. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 14:52, 30 August 2025 (UTC)
Therefore, there is no problem with me using a primary source
- but WP:PRIMARY says, under policy:
So we have a problem. Sirfurboy🏄 (talk) 22:23, 30 August 2025 (UTC)2. Any interpretation of primary source material requires a reliable secondary source for that interpretation.
- No, since there is no interpretation in my most recent edit, there is no problem. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 22:43, 30 August 2025 (UTC)
- Your suboptimal username is immediately fixable. Fixing it does not prevent you from participating here. Wikipedia is not a battleground; nobody here is out here to get you, even if some of us have overly concise language that might seem insulting and commanding. We just think it's far more efficient collaborating if we can envision the human behind a username, which no offense, your username makes hard to do. Aaron Liu (talk) 14:57, 30 August 2025 (UTC)
- "Your suboptimal username is immediately fixable."
- I would need to give out my email address to submit the rename request form. Personally, I do not want my email address floating around the internet any more than it has to. I do not trust internet strangers with my email address.
- "nobody here is out here to get you"
- Almost everyone here are out to get me. For example, on the article "Code motion", Augmented Seventh reverted an edit of mine without even reading it merely based on the tags of my edit and edits. https://en.wikipedia.org/w/index.php?title=Code_motion&diff=prev&oldid=1296620700 After leaving a message on Augmented Seventh's talk page, Augmented Seventh was able to realize that my edit was indeed valid. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 15:58, 30 August 2025 (UTC)
That's only for the automatic software form. Requests at Wikipedia:Changing username/Simple will wait a little for someone to approve but don't need your email.People make mistakes. Every edit on every page is checked all the time, though less so at times when the Western Hemisphere isn't online. You'll notice that Augmented has no interacted with you anywhere else. Aaron Liu (talk) 20:42, 30 August 2025 (UTC)I would need to give out my email address
- I replied specifically to you in your section below, where I pointed out the Wikipedia policy on use of primary sources. Please look at what I wrote, and carefully read WP:PRIMARY as I asked you. You are new here, and as has been said, handling sources is a tricky thing on Wikipedia. Even if you are used to writing academic essays, you need to realise that Wikipedia pages are tertiary, and written from WP:SECONDARY sources.Why does this matter? Because again, you are starting from the position of wanting to say Python is many times less efficient than C. Yep, that's right. But what secondary sources are making the point? Why are they starting with Python? How does C compare with peer languages? You are synthesising this subject. The source has data, but you are making it out as if this is unique to C and that Python is some kind of standard benchmark. It's not. And this page is not a comparison of C and Python.As to your comparison between Linux and Windows - you are aware, are you not, that the bulk of Windows was written in C? What is the point of all that sidetrack?Look, you have multiple editors taking issue with this addition. It is not that there is nothing we can say here. C code is efficient, and that will make the code low energy too. But quantising it against Python based on a single primary source is just not encyclopaedic writing. Sirfurboy🏄 (talk) 14:41, 30 August 2025 (UTC)
- It's a good paper, but not for the claim:
- Great paper, published in Science of Computer Programming and it appears to support claims for C's relative efficiency. Thumbs up from me. Chumpih t 21:25, 29 August 2025 (UTC)
- In many implementations, C compiles directly to machine code that runs directly on the target procsssor. Many other languages are either JITting, or use bytecodes which are considerably less efficient. While C is far from unique in producing machine code, it is totemic in doing so, and engineers choose C for its close-to-machine output. Perhaps words should go in the lede (or elsewhere) to extol this close-to-machine benefit of the language, perhaps alongside comparisons to other compiled languages. I don't think citing 80x or similar is wise, given how context-dependent such figures will be. Chumpih t 22:48, 24 August 2025 (UTC)
- That's more or less what the third paragraph of the lead is doing. MrOllie (talk) 01:10, 25 August 2025 (UTC)
- Yes, sort of. The 'designed to be compiled' part in lede para 3 is fine, but perhaps we should have words that spell out what that implies in terms of efficiency. This would be alongside other compiled languages, and in contrast to other languages which rely on interpreters, JIT, bytecodes, etc. Chumpih t 05:21, 25 August 2025 (UTC)
- I have heard before that unoptimizing compilers tend to run approximately 10 times faster than interpreters. I do not think that a 80 times difference is that unreasonable given that consideration. Besides, the Cython Wikipedia page cites a 95 times speedup over CPython on a given benchmark, when using fixed witdth types.
- Since Cython only partially converts to C, it is never going to speed up as much as a rewrite in C would. Lxvgu5petXUJZmqXsVUn2FV8aZyqwKnO (talk) 01:28, 29 August 2025 (UTC)
- That's more or less what the third paragraph of the lead is doing. MrOllie (talk) 01:10, 25 August 2025 (UTC)