6 ms·
I realize this argument is probably tongue-in-cheek, but if we were to take it at face value it would be interesting to factor in energy costs required to feed/
by wfleming 5y ago
I realize this argument is probably tongue-in-cheek, but if we were to take it at face value it would be interesting to factor in energy costs required to feed/house/etc. the programmers for the additional time it would take to implement a given system in C vs python, and how often would the code need to run to make it balance out?
- neverartful 5y agoUse Nim FTW on both fronts!
- jcelerier 5y agoyep, for instance a good benchmark would be: how long would it take to build a decent and snappy GUI operating system from scratch with a custom html/css/js engine in $LANGUAGE ? To give a data point, in 2021-era C++ it's approximately 3 years with a very large part of it being done by a single person (https://github.com/SerenityOS/serenity https://github.com/SerenityOS/serenity). How long would that take with python ?
- jhgb 5y ago> with a custom html/css/js engine That almost sounds like confusing goals with ways to me. Unless those very specific ways are your goal for some reason, if you were to "build a decent and snappy GUI operating system from scratch", you probably wouldn't end up with those things in it. You'd end up with something more similar to Oberon, Smalltalk, or VPRI's system (was it Frank or something like that?).
- jcelerier 5y agoCreating a browser engine is a very good test of how fast is it to develop in $LANG I'd say. I'm not saying to render the OS's UI in it, just to write a program that is able to load and execute a 2021 website once you've written your OS.
- jhgb 5y ago> write a program that is able to load and execute a 2021 website But I thought it was supposed to be "decent and snappy"? This requirement seems to ruin it quite a bit since 80% or so of your snappiness goes away.
- jcelerier 5y agoit seems that we are entirely talking past each other. I am talking about implementing a web browser. Writing a program that can load www.example.com and displays it, in at most a few milliseconds. Of course loading a bloated website will be bloated but that's because websites use a turing-complete language - if my web page has <script>while(true);</script> of course things won't go fast, but it doesn't matter, what matters is that we write an engine that is able to execute that "while(true)" and burns those CPU cycles as fast as possible (because then a "normal" website won't be much slower than the theoretical best it can do). It's a (semi)well-defined problem: how fast can you do network requests, how fast can you parse the DOM, can you fetch content such as images concurrently, how fast can you execute JS, which is all benchmarkable. It does not matter than it's going to be slow when loading www.facebook.com ; what matters is that it isn't slower than it should be. That's like writing a generic sort function: you care about the performance of the sort algorithm ; of course if people use a sorting predicate which does filesystem access for them it won't be fast but it is also utterly irrelevant to measuring how fast your sort is.
- andyferris 5y agoThey are talking about implementing both an OS with a snappy GUI, and a (new) web browser that runs in said OS. (These days no OS is going to succeed with end users if it doesn’t have a browser).
- omegalulw 5y agoNot really. Why would you do everything from scratch?
- jcelerier 5y agoBecause we'd have reference points to compare against at least
- bogwog 5y agoI realize this comment is probably tongue-in-cheek, but if we take it at face value, I think it’s failing to consider that the software’s enery usage is unbounded. An app, for example, may end up installed on millions of devices, or running 24/7 on a server for years.
- JasonFruit 5y agoI realize this discussion is probably tongue-in-cheek, but if we take it at face value, I think it's failing to recognize that energy supply is not unbounded. An app, no matter how widely installed, cannot consume more energy than is produced.
- yayr 5y agoand this means, any mistake in the software is also replicated to those devices. let's say e.g. buffer overflows... and then efficiency is faster gone than achieved.
- IggleSniggle 5y agoTrying, and failing, to resist the urge to bring up Zig
- Alan_Dillman 5y agoYou succeeded, right up till the last 3 characters.
- yayr 5y agodo you mean https://ziglang.org https://ziglang.org ? as a non C developer I was not aware of that. Thanks
- fabatka 5y agoI realize this comment is probably tongue-in-cheek, but if we take it at face value, I think it’s failing to consider that the logical conclusion of this argument is to write programs directly in binary.
- guerrilla 5y ago> it would be interesting to factor in energy costs required to feed/house/etc. Why would that be interesting? They'd exist and consume the same amount of energy regardless of what they worked on...
- colejohnson66 5y agoIt’s not energy/time that’s being compared; that’ll be the same. It’s total energy (energy/time * time). For example, a C++ GUI could take longer to get up and running than, say, Python. And assembly would take even longer.
- jacobr1 5y agoNot if you needed twice and many engineers, or it took twice as long due to a complexity. But that said, the overhead of the engineers energy consumption is overhead that probably turns to nothing over the life of a successful project.
- guerrilla 5y ago> Not if you needed twice and many engineers, or it took twice as long due to a complexity. I really don't understand. They'd just work somewhere else and consume energy, housing and food. There'd be literally no difference.
- uncomputation 5y agoNot OP but I think he’s assuming that programmers are on demand like temps, as in once the system is “done,” they are fired. Obviously it doesn’t actually work this way but that might be the logic.
- cozzyd 5y agoNot just fired, but executed.
- 5y ago
- LAC-Tech 5y agoIt also means that doing personal projects in language with long compile times would be worse for the environment, and interpreted ones would be better.
- asveikau 5y agoI am pretty sure in most cases you build less often than you execute.
- nostrademons 5y agoNot necessarily true in development, at least when it comes to compute cycles. Oftentimes you run it once, find a bug, fix the bug, run it again. The CPU time spent in the compiler dwarfs the time spent actually executing the program.
- asveikau 5y agoYes, but development is the anomalous circumstance. Once you deploy, it's all execution. That should dwarf development time.
- FpUser 5y agoI write backend servers in C++. From my experience using modern C++ and libraries the amount of code (line wise) is about the same as in any other high level language like Python. Amount of time to write is about the same as well. I know because I've rewritten from the scratch large Python server application in C++. Performance however is hundreds of times better for C++.
- rowanG077 5y agoThis. Honestly any large program in Python suffers from massive maintenance issues because Python is dynamically typed.