bluetech
Joined 17 years ago
Joined 17 years ago
The docs https://pkg.go.dev/context#Context suggest a way to make it type-safe (use an unexported key type and provide getter/setter). Seems fine to me.
> What if you just use a custom struct with all the fields you may need to be defined inside?
Can't seamlessly cross module boundaries.
If you look at the Hardened Javascript example:
const makeCounter = () => {
let count = 0;
return harden({
incr: () => (count += 1),
decr: () => (count -= 1),
});
};
The "counter object" here is mutable. I think that's what they mean.The report discusses this, and mentions two reasons against doing that:
- What happens if you do it, and then the referendum votes against joining? You're screwed from both ends.
- Due to the previous reason, there will be extreme pressure to vote for joining in the referendum, making it not very democratic.
First, under this system, long-term speculation is not really viable, due to the high tax. So the buyer must have some reason for paying higher than the price you set, which you don't see, i.e. you under-utilize the asset. Google/Facebook ads work this way - every slot is always up for auction. Also similar dynamics in partnership agreement's "shotgun clauses", etc.
Second, you can always factor in your sentimentality into your price, then the buyer will buy your neighbor's house instead. But you have to pay for it in the form of a higher tax. This is like a penalty for obstructing economic efficiency.
Third, this system pretty much does away with the strict idea of private property, into what they call "partial common ownership". It's basically a way to have shared ownership (as in communism) without the central planning, i.e. in a way that might actually work. (In fact, it quite reduces the role of government.)
I'm not advocating for this system, but I think it's fun to think about.
Every citizen and especially corporation would self-assess the value of assets they possess, pay a roughly 7% tax on these values and be required to sell the assets to anyone willing to purchase them at this self-assessed price.
The gist is:
Rule #1: All instance variables must be private
Rule #2: No mutable static state or statically accessible authority
Rule #3: No mutable state accessible across thread boundaries
Here is an interesting proposal on how to possibly get there in JS with import maps: https://guybedford.com/secure-modular-runtimes
Deno uses ambient permissions for the entire process and unfortunately missed the opportunity to do it right.