Regenerate the world

  • no
  • Hjem
  • Om
  • Posts

Posts

November 16, 2023

The Climate Crisis Post 6

Better late than never. Phasing out fossil energy is vital.

Climate

October 2023 2023 is on track to be the warmest year https://climate.copernicus.eu/2023-track-become-warmest-year-after-record-october

Hear Johan Rockstöm explain the tipping points in the climate system here https://youtu.be/7KfWGAjJAsM

The world must phase out 240 coal-fired power stations a year to meet the climate targets. https://www.naturpress.no/2023/11/14/verden-er-totalt-bakpa-ma-fase-ut-240-kullkraftverk-hvert-ar-framover/

Oil

Oil states are planning new oil that is more than twice the world’s climate budget. https://www.theguardian.com/environment/2023/nov/08/insanity-petrostates-planning-huge-expansion-of-fossil-fuels-says-un-report?

Equinor is considering selling off the Rosebank field. Uncertainty and pressure have increased. https://www.transitmag.no/2023/11/09/kilder-til-reuters-equinor-vurderer-a-selge-seg-ned-i-rosebank/

read more
November 6, 2023

The Climate Crisis Post 5

New week more climate crisis. New week, new climate crisis post.

Climate news

What will it take for climate policy to gain wider acceptance? https://energiogklima.no/to-grader/ekspertintervju/rapport-slik-far-klimapolitikken-ikke-aksept/

A new report from Oil Change International looks at how the structural power of the oil industry is distributed in Norway. Central is the organization Konkraft, which secured the generous tax packages for the oil industry during COVID-19. https://priceofoil.org/2023/11/01/first-ever-norwegian-oil-and-gas-industrys-influence-mapped-exposes-fossil-fuel-sway-in-multiple-sectors/

New report shows that lawn treatment in the USA has a greater climate effect than road transport. https://grist.org/technology/lawn-equipment-pollution-report/

read more
October 30, 2023

The Climate Crisis Post 4

New week more climate crisis

When evil is allowed to compete with good, evil has an emotional populist appeal that wins out unless good men and women stand as a vanguard against abuse.

Hannah Arendt

temperature September 2023 is breaking all records

Climate news

The government’s climate committee calls for an oil phase-out and a halt to oil exploration https://e24.no/energi-og-klima/i/ve25om/klimautvalg-ber-regjeringen-lage-en-plan-for-nedphasing-av-olje

Why nuclear power is better for getting rid of fossil energy completely than renewables alone and why the fossil fuel industry doesn’t want us to realize it. https://www.salon.com/2023/06/18/why-big-oil-loves-the-renewable-energy-industry/

read more
October 23, 2023

The Climate Crisis Post 3

New week more climate crisis

The result of a consistent and total substitution of lies for factual truth is not that the lie will now be accepted as truth, and truth be defamed as lie, but that the sense by which we take our bearings in the real world - and the category of truth versus falsehood is among the mental means to this end - is being destroyed.

Hanna Arendt

read more
October 16, 2023

The Climate Crisis Post 2

New week more climate crisis

The sad truth is that most evil is done by people who never make up their minds to be good or evil.

Philosopher Hannah Arendt

Climate news

We are about to lose everything if we don’t stop the fossil fuel industry, warns NASA scientist Peter Kalmus https://www.newsweek.com/sadly-its-not-just-another-summer-we-must-end-fossil-fuel-industry-opinion-1832188

The green transition has not even started, according to the DNV report https://e24.no/energi-og-klima/i/bgvPdk/dnv-omstillingen-i-det-globale-energisystemet-har-ikke-startet

The climate crisis is a major threat to democracy https://klassekampen.no/artikkel/2023-10-10/demokratitrusselen/BeVu

read more
October 9, 2023

The Climate Crisis Post 1

Why is the expansion of the oil sector a crime against humanity and what can we do to stop it?

Climate news

Leaks from gas power plants are not taken into account enough, research shows https://www.bloomberg.com/news/features/2023-09-29/the-climate-sleuth-uncovering-methane-leaks-for-the-united-nations

Fracking is taking lives: https://www.nrk.no/dokumentar/xl/brennepunkt-har-undersokt-equinors-risikable-frackingverskott-i-usa-1.15274533

20 countries’ fossil fuel plans, Norway included, are leading us towards climate chaos: https://priceofoil.org/2023/09/12/planet-wreckers-how-20-countries-oil-and-gas-extraction-plans-risk-locking-in-climate-chaos/

The Ugandan climate activist Vanessa Nakate hammers away at Equinor and Norway for the opening of the Rosebank field

It is absurd that authorities in rich countries such as the UK and Norway call themselves climate leaders when you lie and continue to expand (the use of) fossil fuels. Not only are you leading your own population astray by smashing your own climate goals, but you are also depriving them of reasonable green energy. You are throwing fuel on the climate crisis fire from which we are already suffering, says Vanessa Nakate midway through her speech.

read more
October 2, 2023

The Climate Crisis Post 0

This is the zeroth edition of the weekly climate crisis post where I collect important research, news, myth busting, recommendations, calls and hopefully some good news too.

Climate news

The Rosebank field leads to demonstrations against Equinor all over the world (I was there) and lawsuits https://www.transitmag.no/2023/09/27/britiske-myndigheter-godkjenner-equinors-rosebank-felt-klimaaktivister-varsler-soksmal/

Stop Rosebank

Norway is being sued for lack of climate action in several cases before the European Court of Human Rights. https://www.transitmag.no/2023/09/27/norge-pa-anklagbenken-historisk-stor-klimasak-opp-for-den-europeiske-mensnerettsdomstolen/ This is in addition to a separate lawsuit against Norwegian oil developments and the new climate lawsuit: https://www.greenpeace.org/norway/klimaendringer/klimasoksmal/nytt-klimasoksmal-2023-dette-ma-du-vite/

read more
November 4, 2021

Building C libraries in Nix

Nix is a great tool for deterministic, and soon properly content addressed, builds. However my experience is that it is really hard to go beyond the trivial usages of nix. I had to compile some C code using nix and I wrote this expression:

# A very simple setup to compile C and C++ code
{ pkgs, system, lib }:
with builtins;
let
  inherit (pkgs) legacyPackages;
  inherit (legacyPackages.${system}) stdenv;
  joinArgs = lib.concatStringsSep " ";
  pathOfLib = dep: dep.libPath or "${dep}/${dep.libName or dep.name}";
  protoBuildCLib = lib.makeOverridable
    ({ name
     , src
     , static ? false
     , libExtension ? if static then "a" else "so"
     , libName ? "lib${name}.${libExtension}"
     , cc ? stdenv.cc
       # A function that can update the cc options.
     , updateCCOptions ? a: a
     , sourceFiles ? [ "*.c" ]
     , debug ? false
     , extraDrvArgs ? {}
     # Static libraries that wil be included in the resulting lib
     , staticLibDeps ? []
     # Shared libraries to link to
     , sharedLibDeps ? []
     }:
      let
        defaultOptions = [ "-Wall" "-pedantic" "-O3" (if debug then "-ggdb" else "") ];
        commonCCOptions = updateCCOptions defaultOptions;
        libs = map (drv: "${drv}/${drv.name}") staticLibDeps;
        linkerOpts = map (drv: "-L${drv}") sharedLibDeps;
        objectFiles = [ "*.o" ];
        buildSteps =
          if static then
            [
              "${cc}/bin/cc ${joinArgs commonCCOptions} -c ${joinArgs sourceFiles}"
              "ar rcs ${libName} ${joinArgs objectFiles}"

            ] else
            [
              "${cc}/bin/cc ${joinArgs commonCCOptions} -c ${joinArgs sourceFiles}"
              "${cc}/bin/cc ${joinArgs commonCCOptions} -shared -Wl,--whole-archive ${joinArgs libs} ${joinArgs objectFiles} -Wl,--no-whole-archive ${joinArgs linkerOpts} -o ${libName}"
            ];
      in
      stdenv.mkDerivation ({
        inherit src system;
        name = libName;
        buildInputs = with legacyPackages.${system}; [ cc clib ] ++ staticLibDeps;
        NIX_DEBUG = 1;
        buildPhase = pkgs.lib.concatStringsSep "\n" buildSteps;
        installPhase = ''
          mkdir -p $out
          cp ${libName} $out
        '';
      } // extraDrvArgs));

  # type: {a = b;} -> (a -> b -> c) -> [c]
  forEachRow = attrset: f: lib.zipListsWith f (attrNames attrset) (attrValues attrset);
  forEachRowJoin = attrset: f: lib.foldl (acc: c: acc // c) { } (forEachRow attrset f);
  # Extend an overridable function with the given overrideArgs.
  extendOverridableFn = (f: overrideArgs: args:
    let
      self = f args;
      newProps = forEachRowJoin overrideArgs (name: attrs: { ${name} = self.override attrs; });
    in
    self // newProps
  );
  # Property extensions. Each generation inherits the properties of the last.
  propertyGenerations = [
    {
      debug = { debug = true; };
    }
    {
      staticLib = {
        static = true;
      };
      sharedLib = {
        static = false;
      };
    }
  ];

  # Add additional properties in sequence
  buildCLib = lib.foldl extendOverridableFn protoBuildCLib propertyGenerations;
in
buildCLib

Things I noticed is that nix tooling has a long way to go before there will be a really smooth developer experience. The new flakes interface is very nice and I use it all the time. I’m really looking forwards to when typed nix projects like Nickel or DHall become mature.

read more
July 14, 2020

A quick look at the Formality language

After reading this article I got excited. Apparently it is possible to create a proof language that is both performant, total and reliable. This is one of the things that drew me to Haskell - the idea that the language and compiler should be able to enforce strict rules of correctness. It does not support dependent types though and therefore cannot prove most theorems. Dependent types allows for value level computations at compile time and makes it possible to constrain types arbitrarily. This is because there is no native types and types are at the same level as values and can be used as values.

read more
July 14, 2020

How I moved my homepage to IPFS

I just moved my homepage over to IPFS! The Inter Planetary File System has been around a while, but I didn’t hear about it until recently. Hosting your static home page on ipfs is not so difficult, but the guides can be a bit confusing. So here is a short summary of what I did.

ipfs

Adding the site

I installed the ipfs cli following the instructions. First I needed to launch the ipfs daemon with

read more
July 14, 2020

Making a game in Haskell

Making a game in Haskell

During my vacation I’ve been working on making a game in Haskell called HexTech. It has been really fun and inspiring and I’ve learned a lot of new things. The game is a sort of turn-based strategy game on a hexagonal grid. It is mostly a hobby project and it has taken more time than I wanted, but I have been making steady progress. I’m using several tutorials as a guide: this guide for working with hexagonal grids and this one which really gave me a kick start. A lot of my source is based on a rewrite of that game code.

read more
October 30, 2019

Fumbling with Functional Programming

Fumbling with Functional Programming

I love functional programming. It’s just much more beautiful than imperative programming. The down sides usually comes from wanting things done and access to public libraries. I will argue here why FP is worth the effort and reflect around some of the issues in the communities.

For many programmers functional programming can be seen as nothing more than a curiosity. After all, you can seemingly do the same things with imperative languages like Java or C++. Functional programming is a paradigm first and foremost; not restricted to particular languages. Instead of just making “code that works” you should try to emulate the pure mathematical structure lurking behind every problem. This is not something that comes for free. You have to really understand the problem, but then you can write particularly elegant solutions that you can trust.

read more
  • ««
  • «
  • 1
  • 2
  • 3
  • »
  • »»
© Regenerate the world 2025