I know this could be accomplished using a license, however impossing additional restrictions raises issues with compatibility, hesitancy to use the software and finally makes the resulting license not free or not opensource.
So I am looking for alternatives to a license based solutions, as they fail to be practical.Do you have any ideas (or examples of something like this being done) how to discourage the use of code i own for military, collonialist, statist, ... purposes?
Edit:
I currently live in a sufficiently free country with a functioning state and I don't suspect that such interest are going to knock on my door soon.
Ultimately, one cannot. Censorship and secrecy would slow down a recreation, of course. So would intentionally misleading tidbits. I recall, but cannot source now, reading about the Americans doing that back in the day, fudging numbers on isotope mass or something like that which they published. Though, I imagine it must have been hard to come up with both plausible numbers, that usefully misled, without derailing nuclear physics itself a bit as a science.
Maybe an odd thought, and I could be wrong -- but I don't believe the Cold War would have turned out any different, even if the USA had published complete plans of everything they built as they went. In the end, the danger is not the knowledge. Even a full set of plans with the manuals and whatever, would not let you do anything without least some personnel, and the resources, to build a weapon like that. That is where the problem is, the domain of people and politics and infrastructure.
You are not the first to ask this question, not by far. Sometimes the discussion is deep and thoughtful. But I have not run into a good answer yet for something practical one could do, to keep freely-available tools out of the hands of the misguided and malevolent.