HNHacker News
TopNewBestAskShowJobs

randbox

45 karma · joined January 14, 2022

submissionscomments
randbox··on Choosing Nim out of a crowded market for systems programming languages
> Because the GC is infectious. As soon as your dependency needs it (and IIRC even parts of the standard library did/do), it becomes painful if not impossible for you to avoid it.

Isn't this the same for Nim? The standard library doesn't provide pure functions for parsing strings, it provides functions which generate exceptions. Exceptions use the heap, it's hard to get programs to compile with the garbage collector turned off, so everyone just recommends using ARC.

randbox··on Arch Linux turns 20: Small, simple, great documentation
Pacman works when updating all packages simultaneously. However when updating only a requested package it can break by failing to pull in other packages which need to be updated simultaneously. For instance, pacman can break pacman and sudo by updating OpenSSL to a newer version than the currently installed version of pacman and sudo expect.
randbox··on Arch Linux turns 20: Small, simple, great documentation
Pacman will happily break pacman and sudo without warning if the user requests updating openssl without upgrading the entire system. When updating a package it does not pull in all of the other packages which will break if not updated simultaneously.
randbox··on Economic Pessimism Growing in U.S.
With economic rents the dilemma is not simply between doing stuff and having stuff. It's between having something which others can have as well (through reciprocal property rights) vs. claiming to own things which actually belongs to someone else (surplus labor resulting from enclosure of the commons) and then pledging what you don't own as collateral for loans.
randbox··on Economic Pessimism Growing in U.S.
The annoying part is that there are many changes which federal & state governments can make to the financial system to ensure wage growth better tracks inflation without sacrificing growth. Such as capping federally backed mortgages at 150% of the labor replacement cost of material fixtures whenever that's lower than the comparable sales price. Or replacing federal payroll and income taxes on earnings under $100,000 with a national excess property tax on property comparable sales values minus 50% of fixture labor replacement costs. Or provide local public banks which appraise excess property values separately from labor replacement costs and spending publicly collected interest payments back into circulation on public works.
randbox··on Modern programming languages require generics
The only preprocessor code required for writing 'static inline' header functions is "#pragma once". Inline functions look like normal functions.
randbox··on Modern programming languages require generics
If both the comparison function as well as the sort function which the comparison function is passed to are declared 'static inline' and available in a header, the compiler is smart enough to figure it out and inline the code, provided optimizations are turned on.
randbox··on Modern programming languages require generics
It's not necessary to use macros. Just make both the sort function which the comparison function is passed to, as well as the comparison function itself, both "static inline". The compiler is smart enough to figure it out.
randbox··on Tether Required Recapitalization in May 2022
> The problem isn't getting loans on one's crops. It's transferring the price risk to someone else. When a farmer plants, they want a guaranteed profit. Loans don't address that problem. Futures do. (It's why they were invented, in the 17th century, by the Dutch and Japanese.)

The problem is excess credit available to financial firms engaging in leveraged speculation and financial services investment, resulting in financial sector employment and compensation that is super-proportionate to any real savings generated for non-financial producers. This leverage is enhanced by the lack of free (zero-fee) public alternative for basic banking services. It is not necessary for public banks providing basic banking services to guarantee profits for farmers. Provide savings, transfers, and liquidity loans at present values at what an option to sell existing previously planted crops would be worth might be sufficient to reduce deposits held by banks engaging in leveraged speculation. Providing basic banking as a public utility is the middle way the parent commenter advocated because it does not require banning anything.

randbox··on Tether Required Recapitalization in May 2022
Material production still requires accounting, installation, transportation, delivery, disposition, optimization. Financial parasitism more clearly occurs when someone pledges something to lenders which they do not actually own. For example in the 19th century when JP Morgan lent to planters on security of chattel slaves, the planters pledged the bodies of other people as collateral. Arguably loans should only be issued on security of personal property which does not deny the personal property rights of others. This might exclude leveraged lending of money on security of money (arguably lending on security of state property) and excess real values due to land scarcity (arguably lending on security of common property).
randbox··on Tether Required Recapitalization in May 2022
> There is a middle ground between banning and a free for all.

Providing basic banking as a public utility so most deposits by individuals, local governments, and small businesses are not stored with investment banks engaged in speculation. Public banks can be limited to originating loans on 100% security of material personal property such as crops, livestock, cheese, gold, lumber, steel and prohibited from originating loans on security of state property such as money (which might be obtained via leveraged loan from another lender) or on security of common property such as excess real estate values attributable to land scarcity.

randbox··on Parmigiano Reggiano makers embedding tiny trackers in rind to fight cheese fraud
Those are all different things and different forms of borrowing though.

When someone borrows against cheese they are borrowing against existing personal property for which labor has already been supplied rather than borrowing against future earnings. The lender does not need to verify income and credit, just inspect the purity of the cheese. With a home loan, the owner is borrowing against the personal property in the building, as well as the common property in the land and the future earnings of other people such as their tenants.

Additionally in the case of a co-op, the interest charges the organization collects on the debt are usually reinvested locally for the benefit members.

randbox··on Germany: Crypto held for more than a year will not get taxed
No other species has the recorder of deeds \ title registrar \ court system to enforce claims over territory in absentia without the continual presence of the beneficiary. Even among humans most of Earth's territory is considered common property and not excludable or conveyable personal property when considering the ocean. Practically speaking something is only an asset in a financial context when ownership can be conveyed on paper and pledged as collateral for a loan.
randbox··on The ACLU Has Lost Its Way
Yes, the level-headed take is that an organization has not taken a "hard-left turn" unless they are calling for redistributing the land and cancelling the debt.
randbox··on America’s Javelin missile is second to none (2021)
Ukraine's domestically manufactured Stugna-P has longer range, remote controls, and is only $20,000 per missile.

Wikipedia cites unit costs of Javelin closer to $200,000 than $80,000.

Longer range + tripod + remote control seems safer for operators. The Javelin might be second to Stugna-P.

randbox··on Elon Musk to join Twitter’s board of directors
So it's amazing at miseducating and misinforming politicians in impoverished countries?

In industrial economies money is credit and countries issue their own money by setting up a banking system to lend it into existence on security of domestic tangible capital to promote wealth formation and create liquidity for domestic employers to make payroll. Since the early 1700s western governments have known how to create stable money from nothing without any gold, private banks, or external investors by lending it into existence through land loan office system.

It looks like El Salvador didn't create its own money before and was just using US Dollars sent back by emigrants though.

randbox··on What is money, anyway?
> It is not surprising that there are no historical documents outlining this, for it would likely pre-date even the written word by centuries or millennia.

Huh? During the 17th and 18th century European colonization of North America there was no existing standard of payment which all settlers had access to. Before the circulation of paper money by colonial assemblies, tax and wages for public servants shifted to tobacco due to the liquidity of the export market.

> There are many historical accounts of monies being displaced when new, superior forms of money enter into economies, which is an extension of Menger's thesis (Also known as Thiers' Law). If a society is using a form of money which for whatever reason becomes much less saleable, and a new commodity enters the market which is more saleable, the more saleable commodity will eventually displace the old money

In the American colonies, commodity money based on farm products was replaced by paper credit money loaned by governors on security of property. Gold and silver were skipped over as official forms of money because they were not in large supply, and because activists such as Benjamin Franklin argued that if people invested time in digging for Spanish gold and buried treasure they would be poorer than if they spent time plowing fields.

> for silver would remain the most saleable commodity for millennia until it would be later displaced by gold

What's important is not simply salability but liquidity. In industrial countries the value of credit money is secured by the value of the assets of borrowers, they have to collect money back in same unit of account after investing or spending it to avoid default and foreclosure. In America the colonies tobacco-money or farm-product money was displaced by paper money with no metallic backing. Metal-backed money was imposed by Great Britain.

randbox··on What is money, anyway?
In America during the late 1600s through early 1700s fiat currency was placed into circulation as the loan or mortgage held by the governor secured by the property of the borrower. There was no promise, advertisement, or intention to pay in metal. In a public land loan office system, the value of the currency is backed by the value of the property which the borrower does not wish to lose if they fail to collect back currency in the same unit of account after spending and investing to avoid default or foreclosure.

The promise which governors and colonial assemblies made to the borrowers was primarily that the government would continuously spend the revenues brought in by interest payments back into circulation on local infrastructure, and that new loans would be regularly issues at low interest rates of 3-4%, so that the money needed by borrowers to repay their debts was easy to come by, and that the debt would not be held or sold to private lenders engaged in usury.

So accepting the scheme was a good deal to borrowers, and provided immigrant farmers with cash & credit which would not otherwise be available to them without borrowing form European lenders at high rates. The government acted as a public bank and the money was a public utility.

randbox··on What is money, anyway?
> Historically, a number of cultures have attempted periods of paper currency, issued by the government and backed by nothing. Often it was the result of currency that was once backed (a gold standard or silver standard), but the government created too much of the paper due to war or other issues, and had to default on the metal backing by eliminating its ability to be converted back into the metal upon request.

In the late 1600s and early 1700s, the American colonial assemblies directly issued paper money to provide liquidity for farmers, so they did not have to barter with commodity crops such as tobacco. There was no prior government currency backed by gold, farmers paid tax in farm products.

> In that sense, currency devaluation becomes a form of tax and/or wealth confiscation. The public holds their savings in the paper currency, and then the rug is pulled out from under them.

There was no substantial devaluation or inflation of paper money in the colonies which emitted money using the public land-loan office system with no gold or commodity backing. In Pennsylvania the currency held most of its value for the 45 years the colony was permitted to issue it. It only declined 20% over its entire life time relative to the metal backed British Pound despite new currency continually being placed into circulation for immigrant farmers at low interest rates of 3-4%.

> Fiat currency is interesting, because unlike the history of commodity money, it’s a step down in terms of scarcity. Gold beat out all of the other commodity monies over centuries of globalization and technological development, and then gold itself was defeated by… pieces of paper?

In Poor Richard's Almanic, Benjamin Franklin explains the labor theory of value, and how if farmers spend their time digging holes to search for Spanish gold they will be poorer than if they had spent their time plowing their fields.

> Fiat money, if you like, is backed by men with guns.

When money is issued as credit, the value of the money is backed by the personal property and assets which the borrower stands to lose if they do not collect back money in the same unit of account after spending and investing it so that they can avoid a default or foreclosure.

> The answer is that it doesn’t have to, but it wants to. By issuing its own currency, it profits from seigniorage, which is the difference between the face value of the money and the cost to produce and distribute it.

In the land-loan office system, the government profits from interest. When it places new money in circulation by issuing credit to create liquidity it is acting as a public bank. The interest on loans which place new currency into circulation acted as a tax spent on infrastructure and public services, which was paid to the state rather than a private financial sector, which even Adam Smith admitted in the Wealth of Nations was sufficient to for most of the expenses of the state.

It's always surprising when American authors omit a discussion of American colonial money from a discussion of the history of money, given that American colonies were the first western governments to issue paper money and conduct extensive experiments on the subjects.

randbox··on Inflation and the housing question
The fraction of average income paid to landlords is partially due to the concentration of land ownership and political culture of the ownership class.

Historically in 18th century rents were 1/3 of farm product in England, 1/2 of product in Milan, up to 3/4 product in China. Citizens in countries with low rents developed wealth quicker and in countries with high rents were quite poor.

randbox··on Why America can’t build quickly anymore
>Paying 2x-4x for some piece of land is still waaaaaaaay cheaper for society than drowning in decades-long quagmire while infrastructure falls apart everywhere.

Eminent domain is not only used to acquire owner occupied homes for infrastructure. In some cities it is used to purchase poorly maintained properties from slumlords.

Landlords get what rent they can and don't invest anything in upgrades because they know they can cash out with the city government or public land bank. Promising to pay 2-4x may make the problem worse.

If a building is nearly fully depreciated, and has $0 building value, and the landlord invested closed to $0 in maintaining it, but the land is worth $200K, why should they get 4x whatever they claim the gamed comparables are and $800K from the public for doing nothing?

Maybe 150% of the building replacement cost for owner occupied homes makes sense, but ideally absentee investors holding depreciated properties and vacant lots wouldn't get paid a dime for the land value.

randbox··on How to Prepare for a Recession
A credit bubble may pop due to loss of confidence, but the loss of confidence is not purely non-deterministic psychological phenomena, it is due to the interest owed on the debt held by speculators which bought financial assets on credit exceeding the expecting asset price gains from buying or holding more assets. When speculators stop buying more assets on credit, asset gains dry up, and those which bought assets on credit or by slowing payments on other debts in hopes of making gains still have to make payments decreasing quantity of money in market causing sell off.
randbox··on How to Prepare for a Recession
The quantity of money in the system doesn't stay the same. Speculators buy financial assets such as stock and real estate on credit. This increases valuations and causes more speculators to buy financial assets on credit, or at least stop paying back their other debts as fast so they can hold more assets, to capture asset price gains. When the process slows down eventually the expected asset price gains will be lower than the interest owed on the debt, causing a sell off.

That's the basics of how a credit bubble works.

randbox··on Are you sure you want to use MMAP in your database management system? [pdf]
There can be a data race any time a processor loads a value, modifies it, and writes it back. Without an atomic update operation like compare_exchange() generally you need to lock the database file against other processes and threads. The typical solution is to only have one process update the file, only have one thread perform the writes, and combine it with a TCP server.

Suppose you have a big data file and want to mark which pages are occupied and which pages are free. Suppose a writer wants to read a bit from an index page to the stack to check whether a data page is occupied, modify the page bit in the stack to claim the data page if another process hasn't claimed it, and write the updated value back to memory to claim the data page to store the data value if another process hasn't claimed it.

If each process read()s the index bits, they can both see that page 2 bit in the index is unset and try to claim it, then write() back the updated index value. The updates to the index will collide, both writers will think the claimed page 2 when only one should have, and one of the data values written to that page will get lost.

randbox··on Are you sure you want to use MMAP in your database management system? [pdf]
A user process doesn't have the information it needs to do a good job of coordinating updates from multiple writers to database pages and indices. With MMAP, writers have access to shared atomics which they can update using compare-exchange operations to prevent data races which would be common when using read() and write() without locks.
randbox··on Are you sure you want to use MMAP in your database management system? [pdf]
How do you implement lockless atomic updates for multiple writers across multiple threads & processes without mmap?

With mmap it is straight forward for processes to open persistent arrays of atomics as a file, and use compare and exchange operations to prevent data races when multiple threads or processes update the same page without any file locks, advisory locks, or mutexes.

With manual read() and write() calls, the data may be overwritten by another writer before the update is committed.