metaprogramming and politics

Decentralize. Take the red pill.

Posts Tagged ‘politics

Going beyond codes of conduct

with one comment

When someone utters something that turns out to not be acceptable to many, what do you do? One way out is to punish, to try exclude that someone according to some pre-established rules. It’s an action that should be used sparingly and with precise reasoning as it otherwise has chilling effects and causes alienation.  You might get people to avoid certain behaviours in public but sentiments are still going to flow in private discussions.
The other possibility is to treat “incidents” as an opportunity to engage with underlying reasons and questions. Here are some of mine when it comes to the believe that one gender is superior to another, in the context of the programming communities i am connected with:

  • To begin with, why are many male programmers working 40 hours a week while their wife cares at home for children? See Traditional family models in the IT and Python world for more on this question.
  • How does it come to biases: When i imagine a “genius”, who do i think of? When i hear “keynote speaker” whom do i envision? At PyUnconf 2014 in Hamburg i discussed relations between centralized technical systems and normative thinking. Often, these norms are felt as “natural” or “true”.  But we are not only producing thoughts, our thoughts are products of cultural mass processes and less individual than they feel.
  • Who is speaking in the name of a community? Who is the “we”? And if “everyone” can participate, who actually participates? Who gets to decide, who defines what is being talked about and how? Which norms and values play a role in the communication around all these issues?
  • Why are most programming communities composed of a majority of white males? Biology? Or is it the result of centuries old patriarchies and colonialisms in action? When you try to “undo” this, do you just impose some rules by which everyone should behave? Or do you actively work to raise awareness, discuss some of the fundamentals and inherited impregnations?

Written by holger krekel

April 9, 2015 at 10:42 am

metaprogramming in Python: What CPython, PyPy, Pyramid, pytest and politics have in common …

leave a comment »

Metaprogramming in Python too often revolves around metaclasses, which are just a narrow application of the “meta” idea and not a great one at that. Metaprogramming more generally deals with reasoning about program code, about taking a “meta” stance on it.  A metaprogram takes a program as input, often just partial programs like functions or classes. Here are a few applications of metaprogramming:

  • CPython is a metaprogram written in C. It takes Python program code as input and interprets it, so that it runs at a higher level than C.
  • PyPy is a metaprogramm written in Python. It takes RPython program code as input and generates a C-level metaprogram (the PyPy interpreter) which itself interprets Python programs and takes another meta stance by generating Assembler pieces for parts of the interpreation execution. If you like, PyPy is a metaprogram generating metaprograms whereas CPython and typical compilers like GCC are “just” a metaprogram.
  • Pyramid is a metaprogram that takes view, model definitions and http-handling code as input and executes them, thereby raising code on a higher level to implement the “Pyramid application” language.
  • pytest is a metaprogram written in Python, taking test, fixture and plugin functions as input and executing them in a certain manner, thereby implementing a testing language.
  • metaclasses: in Python they allow to intercept class creation and introspect methods and attributes, amending their behaviour. Because metaclass-code usually executes at import time, it often uses global state for implementing non-trivial meta aspects.

Apart from these concrete examples, language compilers, testing tools and web frameworks all have metaprogramming aspects. Creating big or small “higher” level or domain-specific languages within Python is as a typical example of metaprogramming. Python is actually a great language for metaprogramming although it could be better.

In future blog posts i plan to talk about some good metaprogramming practise, particularly:

  • keep the layers/levels separate by good naming and API design
  • define a concise “language” for the programs you take as input
  • avoid creating global state in your metaprograms (and elsewhere)
    which can easily happen with meta-classes executing at import time

Lastly, i see metaprogramming at work not only when coding in a computer language. Discussing the legal framing for executing programs on the internet is some kind of metaprogramming, especially if you consider licensing and laws as human-interpreted code which affects how programs can be written, constructed and executed. In reverse, web applications increasingly affect how we interact with each other other, thereby implementing rules formerly dealt with in the arena of politics. Therefore, metaprogramming and politics are fundamentally connected topics.

have metafun, i. e. take fun stuff as input to generate more of it :) holger

Written by holger krekel

November 22, 2012 at 3:04 pm

Who needs censorship if you have Amazon and everydns?

with 13 comments

Yesterday Amazon stopped services for the wikileaks archive. Citing from the Amazon statement:

It is not credible that the extraordinary volume of 250,000 classified documents that WikiLeaks is publishing could have been carefully redacted in such a way as to ensure that they weren’t putting innocent people in jeopardy.

So here you have a popular cloud services provider judging their customers content in a broad manner, stating conclusion, terminate services, done. Did they allow discussion? Do journalists need to keep and control all rights of the material they are publishing? Can Amazon show any evidenceof their “jeopardy” conclusion? Would they apply the same moral standard to e.g. blogs or other (journalistic) content that called for going to the war on Iraq – causing >100.000 civilians to die? Does Amazon really want us to believe the US governments outrage and Mr. Liebermanns actions are merely a co-incidence?

Then today terminated DNS services for with a 24 hour prior notice. Citing from the everydns statement:

More specifically, the services were terminated for violation of the provision which states that “Member shall not interfere with another Member’s use and enjoyment of the Service or another entity’s use and enjoyment of similar services.”

So supposedly there was an attack on their DNS servers and they interpreted this as wikileaks doing harm to others? Is this the future of how we handle attacks against single domain names? Would the same happen if it was the site of a chinese dissident or a Poker playing site or any other customer?

As things stand this puts me off these two companies and brings me again to the thought that we need an internet that is as independent from any single company or any single country as possible – it’s in the best interest for all of us in the long run.

Written by holger krekel

December 3, 2010 at 12:44 pm

Posted in politics

Tagged with


Get every new post delivered to your Inbox.