Go and green tech - how do you use Go to save the environment?

This “app” is fetching a hundred of rows from a Go REST API (using Postgresql). So far less impact on the environment. https://crud.go4webdev.org

1 Like

At my employer we develop software for renewable power company clients, and we also write code in Go (albeit among other languages). I don’t personally work on the products for those clients.

2 Likes

Hi,
although its not Go yet and a dodgy prototype I wrote a community heating management system in Ada 2012 and using the distributed system annex personality with polyorb. Now we have Golang I am keen to convert it to golang once I have apis to zwave and zigbee etc. The thing about fuel poverty is there are two issues.

  1. A lack of money
  2. A lack of ability to use heating controls.
    Also I was making use of a couple of stats 49 percent of UK energy is used in heating housing.
    30 per cent of energy can be saved by zoning houses.
    The prototype you can see is at github.com/tonygair/kushtibot I really want to start again in Go though. I’m still learning with that german phrase in mind …learn through trying!
2 Likes

This is a really interesting line of thought! Reminds me slightly of the stated Notepad++ goal (emphasis mine):

Based on the powerful editing component Scintilla, Notepad++ is written in C++ and uses pure Win32 API and STL which ensures a higher execution speed and smaller program size. By optimizing as many routines as possible without losing user friendliness, Notepad++ is trying to reduce the world carbon dioxide emissions. When using less CPU power, the PC can throttle down and reduce power consumption, resulting in a greener environment.

One of my current clients is using a Go-based app as an e-learning platform that allows aspiring clinicians to get observation hours online where they would previously have to drive to sessions and observe them. Trying to be vague here since I’m not sure how specific I can be without permission. I’m not sure about the carbon emissions of data centers, but I’m assuming that if we save hundreds of thousands of trips, it more than offsets our server emissions.

Also, just comparing my go-based APIs to other stacks I’ve used, they absolutely sip memory and are very performant (in my professional experience). So, we are able to ship products with less infrastructure costs, which is a carbon win. I just shipped another app on Google Cloud Run which is very efficient, for example. And I am consistently surprised by how small of an instance I can use to run my Go-based services.

Anyway, I hope people chime in with actual green software they are working on. This is an excellent conversation starter, Christoph, and I would love to hear about people who are actively making the planet better and using Go to do it. Bonus points if somebody is using tinygo in an embedded system to do something awesome like make their solar panels track the sun. :wink: I’d contribute some free time to a project like that.

1 Like

Hello @Dean_Davidson I am actually new on this forum as I’m just starting my #GoLang journey trying to write my first Hello World, buh I’m having some issues. Any help would be great.

I have attached a screenshot to get a complete view. Each time I run my Go Run Go, the string to it is giving some error

Thank you

Here you need to save your main.go first. It seems as if it is still empty on disk.

You need to run go mod init.

Also you really should prefer a verbal description and copied code and error in the post over a screenshot.

The text would have been able to carry the same or even more information in much less that than 5 kiB, your picture is 35!

Okay thank you, I’d do that, I’d send the code for better clarity

And I did run the go mod init buh I dunno what happened.

1 Like

Very valid and insightful observations, @Dean_Davidson. Indeed, there is a ton of different ways of contributing to the fight against climate change.

  • Highly resource-efficient software (that delivers highest throughput with low resource consumption
  • Software that eliminates resource-intensive tasks (like traveling to in-person meetings)
  • Software that runs on low-level hardware, like
    • old systems (thus reducing waste)
    • systems designed to be low on energy consumption (Pi zero, microcontrollers,…)
  • Software that helps locating energy-intensive process steps or infrastructure
  • Software that helps managing energy consumption
  • etc
  • etc

There are so many possibilities, and I am seriously considering starting a project for collecting all those ways of contributing to addressing the world’s most pressing problems.

I only have no clear plan yet…

1 Like

Hi @christophberger ,

Science tells us climate change is not “the biggest challenge for the global society” but merely one of the many problems we have to deal with long term.

Other than that, here is how we use Go for climate purposes: every code review of an algorithm asks “can it be done with less electricity” (instead of the “can it be done with a better CPU complexity”).

Somehow thinking about electricity consumption makes developer to be more motivated about their algorithms. I have seen this at work multiple times.

Hi @telo_tade,

Thanks for sharing your approach. I think this is the single most important question for reducing the climate footprint of software. And although the question sounds simple, there are many different aspects behind it:

  • Is there an algorithm with a better time or space complexity available than what we use now?
  • Do we use these data structures efficiently?
  • Can we save energy by powering down the VM between requests? (a.k.a scale-to-zero or wake-on-request)
  • Shall this regular task run every second? Or is once every 10 seconds sufficient?
  • and so on…

Climate change is indeed only one of many problems of this planet. Unfortunately, the big problems are all intertwined on multiple levels. Climate change, depleting energy supplies, warfare, growing social injustice, concentration of wealth, and fascism and ruthless dictatorship in more and more countries—all these problems influence each other.

I don’t claim to have any ideas on how to save the world, but as Gophers, we can do our share within the scope of our profession to help make this world a bit better.

1 Like

Another two questions:

  • are we synchronizing caches/datasources too often ?
  • how would an ideal solution look like ? ← making people think about the compromises their solution had to make
1 Like

Please, you should always remember that human-related CO2 emissions are just a tiny fraction of natural emissions, which do cover more than 95% of all CO2 emissions.

Secondly, the climate has always been changing and for example the temperature changes in a long term have been so much more both up and down than the currently registered change of ca. 1 degree, which is too low to be drawn any conclusions of, the scientific fact being that no information can be derived from a signal, which is under the noise level!

Third, you cannot do anything for even a single volcano and there are a few hundreds of them. In addition, there are several other factors of climate change, which are (luckily!) completely out of our reach like, for example, the Sun, the Earth’s orbital changes, the oceans, the enormous production and effects of algae, methane releasing substances, chemical reactions and bacteria in soils and the biosphere etc. etc.

Therefore, it is of extreme importance for the humans to try doing something that they really can do instead of stupidly imagining that they could govern the whole world. The number one subject should be to launch an obligatory one child family policy in each and every country in order to stop pollution and degeneration of all living things! It will not take more than 7 generations to reduce the number of humans by 99%.

Then, everybody will have clean water and good land as much as they need. And the nature will recover and fill most parts of the world for everybody’s benefit. So, that we can do our best to reduce suffering and to adapt to the much bigger changes of climate, which are going to happen in the distant future.

@Tiitu,

I do not want to go into discussing fundamental ecological topics here, as I would only be able to repeat here what scientific researchers across the world have found out. This is a forum about Go, so let’s focus on the IT aspects. Even if the measures discussed in this thread are not relevant for climate, they certainly help saving energy, which is a valuable goal on its own.

I agree with you that there are a lot more things on this planet that go topsy turvy and have to be addressed better sooner than later.
Why not find out together how Go can help there, too!

1 Like

I agree. On the other hand, saving energy is not the solution, but consuming (and, producing!) less.

What is the actual difference? :slight_smile:

You can save 99% of energy without reducing the pollution elsewhere a bit, for example. Or you could save 99% of the energy, but still increase the energy consumption during the years and in the end consume more than ever no matter how effectively you are producing and using the energy.

2 Likes

None of the problems the world faces today can be seen in isolation.

  • Climate change causes migration
  • Ruthless dictatorship causes migration
  • Migration causes the rise of extremism
  • Unbridled capitalism increases the gap between the rich and the poor
  • The increasing gap between rich and poor causes the rise of extremism
  • Unbridled resource consumption causes pollution and exploitation of nature
  • Pollution causes diseases
  • Exploitation of nature causes climate change
  • and so forth

Hence the required actions have to be manifold.

  • Consume fewer resources - energy, raw material, land/soil,…
  • Move towards a circular economy
  • Move towards social justice
  • and more

Software cannot solve all these problems, but it can help in many ways. We are Gophers, so what we can do is do what we are good at.

We can write energy-efficient software to reduce our carbon footprint.

We can write software that brings people together and enable them to take action where it is needed.

We can write software that can efficiently run on older hardware that would otherwise be tossed on a garbage dump in some 3rd-world country that lacks the money, the laws, and the political will to enforce environmental protection.

We can help more people learn how to program by teaching them a language that is neither too complicated nor a mere toy language.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.