HNHacker News
TopNewBestAskShowJobs

jklowden

250 karma · joined April 22, 2011

submissionscomments
jklowden··on Usability Improvements in GCC 15
Yup, COBOL is that overnight sensation 4 years in the making. GCC COBOL is foremost an ISO COBOL compiler, with some extensions for IBM and MicroFocus syntax. We also extended gdb to recognize COBOL, so the GCC programmer has native COBOL compilation and source-level debugging.
jklowden··on Repairable Flatpack Toaster
If the economics make no sense, it’s only because the economics do not account for the cost to the environment. If the retail cost included reclamation, so that there was no waste at all, this kind of toaster would be the cheapest.
jklowden··on Historically, 4NF explanations are needlessly confusing
Perhaps TFA could explain what happened to math between 1977 and 2024. Because the meaning of "atomic" didn’t change, nor did the meaning of 1NF. The author pretends to explain 4NF, but never actually begins. He calls himself an "historian", which he might be. But he betrays very little knowledge of the relational model.

Repeating fields, which he proclaims as some kind of innovation, violate 1NF. They’re not atomic. Maybe the easiest way to understand it is that the list of languages can’t be used in SQL. If one teacher speaks Italian and French, SQL won’t find WHERE LANGUAGE = ‘FRENCH’. Nor will SQL join two teachers on that column.

SQL doesn’t recognize repeating fields in a column because it already has a way to represent them: as rows. That a teacher speaks two languages is not one fact, but two; not surprisingly, those two facts appear in two rows. ‘Twas true in in 1977. ‘Tis true today. Thus ‘twill ever be.

jklowden··on Sensible SQLite Defaults
It’s unreliable on any network for good reason: SQLite relies on the kernel for state information on the file system. Two machines sharing one file over a network have two unsynchronized versions of that state. One machine’s write does not update the other’s in-kernel image.
jklowden··on $8k Suzuki from India received a 5-star crash test rating
Funny thing: during the pandemic, when no one was driving, New Delhi’s air cleared so much that the Himalayas could be seen for the first time in decades.

If pollution is caused by "crop burning", why is it that the worst pollution is in cities?

jklowden··on COBOL has been “dead” for so long, my grandpa wrote about it
www.cobolworx.com. Always on the lookout for places to talk about our work.
jklowden··on COBOL has been “dead” for so long, my grandpa wrote about it
COBOL is still running where it’s running because those old applications 1) work and 2) are very expensive to rewrite. Unimportant programs were abandoned. Simple one were migrated to Java decades ago. The useful-and-complicated — and often badly designed — are what remain.

If you’re a bank, you run COBOL. Estimates are 95% of ATM transactions go through a COBOL program.

But it doesn’t have to run on a mainframe! We’re adding COBOL to the GNU Compiler Collection. www.cobolworx.com.

jklowden··on Giving C++ std:regex a C makeover
So bad is the performance of gcc std::regex that I reimplemented part of it using regex(3). Of course, I didn’t discover the problem until I’d committed to the interface, so I put mine in namespace dts, just in case one day the supplied implementation becomes useful.

As it stands, std::regex should come with a warning label. It’s fine for occasional use. As part of a parser, it’s not. Slow is better than broken, until slow is broken.

jklowden··on 'Logical, beautiful, perfect' WordStar rises again
Oh, please. Wordstar is nothing but an insignificant pre-GUI editor with roughly zero useful modern printer drivers.

For a comparable but better experience, choose any text editor — emacs, for example — and groff. You get the control-keys of your choice (wordstar should you so choose) and world class typesetting capable of anything, including books.

jklowden··on Half a century of SQL
The only reason we live with Sql in 2024 is that the industry has stagnated. Not only the vendors: the users, too.

SQL was designed for a purpose it never fulfilled and never will: end user queries. The promise was that users would write their queries so IT staff would have to write reports. But the only users of SQL today are those same programmers, many resentfully or disdainfully. Every online database discussion is rife with misinformation or silly advice ("write SQL sentences"); rare is any discussion about the relational model or first order predicate logic.

And that brings us to the user-led stagnation, as it were. If more programmers using SQL understood the fundamentals, perhaps there would be some innovation. Instead we live through the constant reinvention and rediscovery of what SQL can do, and a perennial effort to make it "easier" with ORMs and such. Actual ease, using a better language, is never discussed.

The right language to express relational algebra IMO is Lisp. I don’t mean Lisp-over-SQL. I mean Lisp over data, where tables are fundamental Lisp objects, and modifying those objects updates the database. Lisp solves all of SQL’s deficiencies: verbosity, orthogonality, composability.

The would-be inventor of a better database query language faces a daunting problem, however: there is no free relational engine. No C library implementing relational algebra over a data store. So, not only does the language need invention, but the database engine itself needs to be engineered. Nothing has happened in this area since Berkeley DB, which is barely a start and has anyway been hijacked by Oracle.

The nearest thing to a free modular database framework isn’t very close. The original Berkeley Ingres DBMS is nominally free software. But it hasn’t been portable to, say, OpenBSD for decades, and the proprietary owners are understandably not motivated to make their product a toolbox for tinkerers.

So, it seems we’re doomed to another 50 years of SQL. We have met the enemy, and he is us.

jklowden··on You'll regret using natural keys
You think your surrogate key will save you? It will not. The world has an external reality that needs to be reflected in your database. If the unique identifier for your object — VIN, CUSIP, whatever — if it changes, the world will henceforth refer to it by both. You will need to track both. Adding a synthetic key only means you have to track all three. Plus you have to generate a meaningless number, which is actually a choke point in your data throughput.

The natural key forces you to think about what makes the row unique. What identifies it. Sometimes, it makes you go back to the SME and ask them what they mean. Sometimes it makes you reconsider time: it’s unique now, but does it change over time, and does the database need to capture that? In short, what are the boundaries of the Closed World Assumption? You need to know that too, to answer any "not exists" question.

To use our professor’s car’s example, we actually do not know the database design. It could well be that the original identifier remained the primary key, and the "new id" is entered as an alias. The ID is unique in the Car table, identifying the vehicle, and is not in the CarAlias table, where the aliases are unique.

Oh, you say, but what if the bad old ID gets reused? Good question. Better question: how will the surrogate key protect you? It will not. The reused ID will be used to query the system. Without some distinguishing feature, perhaps date, it will serve up duplicates. The problem has to be handled, and the surrogate key is no defense.

Model your data on the real world. Do not depend on spherical horses.

jklowden··on Serious flaws in SQL (1990)
> It's just as easy to make your own surrogate key in the case where there aren't enough natural identifiers

A row with no natural is misdesigned. Proof: what does the row _mean_ if its values don’t distinguish it uniquely in the real world?

jklowden··on What makes concurrency so hard?
Three words: Communicating Sequential Processes.
jklowden··on Why New York City Can't Fix Its Ugly Scaffolding Problem
The simple truth is that scaffolding commandeers a public good for private purpose. Developers may say scaffolding protects pedestrians, but it’s really there to protect the construction firm from liability.

And what does the public get in exchange for the usurpation of its property? Nothing. The greatest cost is erecting the scaffolding and taking it down. It stays up until there’s no chance it will be needed again, because capitalism.

The solution, obviously, is to charge rent. The scaffolder should pay a monthly fee for the privilege of using the sidewalk. Moreover, that rent should double periodically, perhaps every 90 days. At some point, we’d see scaffolding removed because it’s uneconomical to leave in place.

jklowden··on Complexity is a source of income in open source ecosystems (2019)
IBM did not spend the money it did to replace its premier database product, IMS, with another DBMS, DB2, just to enable "simple database queries". Yes, SQL was influenced by other "4th generation languages" of the era. But IBM judged -- correctly, on the evidence -- that most programmers would not take the time to master first order predicate logic or set theory.

So they came up with something that implemented the Relational Model in a simple way, one that would attract new converts. SQL has plenty of warts and defects, but its success at extinguishing every other database query language can't be denied.

jklowden··on Complexity is a source of income in open source ecosystems (2019)
A lot can be said in favor of R, but "straightforward" is a debatable description. The semantics of R were never really designed, and were only recently "discovered", post hoc. See "Evaluating the Design of the R Language" (http://janvitek.org/pubs/ecoop12.pdf).
jklowden··on The Lonely Life of a Yacht Influencer
In what sense does the citizen of the Central African Republic share any economic interest with the American? Legal system and political system are entirely separate.

You seem to think that if some Americans are richer than sone Africans, then it’s fine for some Americans to be richer than other Americans. Conversely, if some Americans want to tax some other Americans, why aren’t they willing to surrender 90% of their wealth to the globally impoverished?

It’s not about guilt, and it’s only partly about fairness per se. It’s about what kind of society we want to live in. Unequal wealth is unequal power. Extremely unequal wealth is extremely unequal power. If you don’t believe me, you don’t have to stop with Citizens United. Consider the French Revolution.

Your examples consistently attribute (exaggerated) returns to virtue, never allowing for chance. Did Bill Gates foresee the PC revolution? Maybe, but so did a lot of other people. Was he smarter? To a degree, perhaps. But he was late to the Internet party, much less did he predict it. He couldn’t know how the courts would decide the rights to the WIMP model developed by xerox. He couldn’t know how the AT&T divestiture would work out. He couldn’t know how copyright would be extended in Microsoft’s favor. He couldn’t foresee the toothlessness of antitrust enforcement.

Could the worker taking a job in a Ford factory in 1980 be expected to predict the US trade policy that would foreclose his career? Did the college graduate joining a bank that year have any idea how important finance would become? One was whipsawed, the other saw a windfall. Where does that fit into your ant-and-grasshopper parable?

jklowden··on Closed-door meetings on unions preceded Amazon's withdrawal
No, that’s not “why” Silicon Valley got started. And you’ll note that neither taxes nor unions are especially rare in California.

Silicon Valley owes its existence to Stanford University and the Department of Defense. Spending on research, and on technology at such places as Hewlett-Packard gave the Valley its start.

jklowden··on Why Create a New Unix Shell?
Finally? You don’t need a new shell. Write select(1). Job done.
jklowden··on It Was Bad UX, not a “Wrong Button” in Hawaii
No one stopped caring. What we stopped doing was pretending the civilian population could be protected against nuclear holocaust.

The bomb that obliterated Hiroshima was a toy next to a thermonuclear bomb, which is 1000 times as powerful. If one lands on Oahu, there won't be anyone to pass out iodine pills in Hawaii, or anyone to pass them out to.

Hawaii is just stupid to spend a nickel on an early warning system. The only reason it exists is that too many people don't understand what they're supposedly being warned, or that they are utterly defenseless.

Sometimes, the only protection is prevention. This is one.

jklowden··on Ajit Pai is right
The article attempts to make logical arguments from false premises.

* What makes evaluating regulations so difficult is that the benefits are usually readily apparent ... but the costs are much more difficult to quantify Why should that be so? The actual costs of implementing and conforming to a regulation are easier to measure than the benefits. The benefit of NN is harder to quantify than the cost of enforced nondiscrimination.

future innovations ... are far more difficult to calculate Predictions are hard, especially about the future. If some future innovations are difficult to predict consequent to a regulation, others are hard to predict in its absence.

* regulation always has a cost far greater than what we can see at the moment it is enacted Why should that be so? Because we can't know the future? If that's the case, it's equally true for benefits: we can't know the full benefit of a regulation, either, because not all the behaviors it forestalls have been invented yet.

It has been estimated that many EPA regulations have benefits worth 100 times their cost. Those benefits far exceed EPA's original estimates.

A regulation is a law. We hear a lot about them as "bad" because corporations have the money and time to complain about them in the press and to congress. They say the problem is costs, but when it comes to intangible goods like banking and communications, the "problem" is often the regulator's interference with the corporation's ability to exploit imperfect information. If you don't think your phone company or credit card is two steps ahead of you, read your terms of agreement sometime.

Good regulations squeeze out bad actors. Worldcom did significant damage to AT&T and their customers: by publishing fraudulent financials, it pushed AT&T to make deep cuts to services that -- by honest accounting -- were profitable and competitively priced.

A good contemporary example is airline pricing. Not long ago, the price you paid for you ticket was the price for getting from A to B. Then the airlines started charging for drinks, then food, and now bags. The real price can be $100 more than the published price. When searching for fares, there's no way to look for an "all in" price, so all airlines are forced into this deceptive model. Only regulation could successfully return us to a normal system where the price is the price.

The Internet exists because of taxpayer-sponsored research to create standards and place them in the public domain. Anyone who used MCI Mail or Compuserv or Prodigy knows what a privatized Internet would look like.

The idea that the telephone company (or cable company) should be allowed to determine, in any way, how we use their service or what we use their service for has no analog in any other industry, which is why every supporting argument is specious or disingenuous or just false.

jklowden··on The left's nuclear problem
Before you decide nuclear power has any place in the future of producing electricity, consider two facts:

1. Worldwide, not a single nuclear plant was built with private funds. All were underwritten with public funds.

2. US law protects nuclear plants from liability. The risk of any harm they pose is borne by the government, not the utility.

Nuclear power is and always was uneconomical. It exists out of a combination of mid-century faith in progress, and to have a nuclear industry to provide infrastructure and technical expertise (or maybe camouflage) for nuclear weapons. Behold the military-industrial complex.

Like "clean coal" there are always supposedly designs on the drawing board. I say, assume full liability, and raise funds on the private market. While I'm waiting, I'll bet in wind and solar.

jklowden··on “Oracle laid off all Solaris tech staff in a classic silent EOL of the product”
Oracle lives in a market protected by high barriers to entry and low customer expectations. Protecting corporate databases from corruption and unauthorized access is crucial to any IT department. Incentive to change the DBMS vendor is nil compared to the expense and risks of converting. And no one, from CTO to DBA, makes any demand to substantially improve the product, such as by rectifying theoretical problems with SQL that have been recognized for decades.

It's no different with SQL Server or DB2. Each vendor has its captured market, with very little power to enlarge its share and commensurately little need to innovate. Customer demands amount to operational window dressing. Why spend money on engineering when customer and vendor are both satisfied?

jklowden··on We should kill the 40-hour work week
The problem with that theory is that it's wrong on the facts. The federal government has consistently been about 19% of GDP since the 1950s. Your wages are no more eaten up by bureaucracy than was your grandfather's.

See epi.org. Wage income has been flat for the median earner since 1979, despite 128% productivity growth. Nearly all benefits to increased productivity went to the top 10%; 80% of that went to the top 0.1%. Return on capital is doing nicely. Return on labor, not so much.

For the 2/3 of the workforce with no college degree, real wages since 1979 fell 28%. Before you start feeling smug about getting on the right side of that divide, remember they vote, too. Ergo: President Trump, the man who promised to restore their jobs (and wages).

How to let everyone participate in a prosperity so unevenly distributed is the central problem of our time. The solution will not be found in flexible work hours. It will require a lot of work, starting with understanding that the capitalists will not give up their winnings easily.

jklowden··on Let's compile like it's 1992 (2014)
Remember, Wirth designed Pascal as a teaching language. One-pass compilation, no forward declarations, built-in I/O. Turbo Pascal could compile to a .com file, 64KB max, 16-bit pointers. I'm not sure there was a linker; the first executable instruction was the first byte in e file.

The neat trick was debugging. Instead of tagging to object code with source-code line numbers, to break on line N, Turbo Pascal simply recompiled the source up to line N, and used the size of the output to match the instruction pointer in the debugged image. Move to next line? Compile one more line, and stop at the last produced instruction.

But these were tiny programs, written ab initio. No readline, no X, no network, no database. Hardly any filesystem. To do something akin to readdir(3) meant writing a bespoke function to call the DOS interrupt. Putting a menu on the screen required positioning the cursor in the video buffer and putting each character in successive locations, allowing for the attribute byte.

If Turbo Pascal was simple, it was also primitive. Much bigger C programs compile in the blink of an eye today. Complex programs take a long time to build today, yes. They did then, too.

jklowden··on H.R.899 – To terminate the Department of Education
We won't mention that our elected bureaucrats have an 18% approval rating.
jklowden··on H.R.899 – To terminate the Department of Education
Ah, but the facts contradict ye. Look at private school tuitions. Look at the cost of daycare. They're not publicly subsidized, and they've risen just as fast as private college tuition.

You're also overlooking the rising value, and rising recognized value, of a college degree. Since 1979, only college-educated workers have seen median wages rise. A high school diploma earned a -27% real return over the same period. Is it any surprise young people are encouraged and willing to pay anything, anything for a shot at economic opportunity? (Further information at epi.org.)

The rise in public university tuition is largely explained by reduced subsidies. Year after year, states "hold the line" on higher education spending, leaving ever more of the cost to students (and students' families, of course). To the point that California famously once spent more on college than prisons, and now spends more on prisons than college.

jklowden··on How companies should treat their most enthusiastic customers
That's one way of looking at. Another way of looking at is that Microsoft derives material value from MVP contributions, and rewards them with trinkets. Or are MVPs sometimes awarded stock?

Maybe the MVP program partly explains Microsoft's decades-old policy of ignoring standards and promulgating proprietary technology to commoditize the public domain. How to add some tweak to .Net is in the domain of acceptable discourse. When to support C11 or Posix, not so much.

It's been a few years since I had to deal with Microsoft's development environment. If you're taking suggestions, I think it would be nice if F1 once more showed the function's documentation instead of searching the Web. Intelligent development of the development environment never would have subordinated a useful albeit rickety documentation technology to a mindless webby one, no matter the marketing imperatives.

jklowden··on Make for hipsters
Simplified: (no color, no grep)

    help:
        @awk -F ':.*##' '$$0 ~ FS \
                {printf "%15s%s\n", $$1 ":", $$2}' \
                        $(MAKEFILE_LIST) | sort
jklowden··on Teaching C

    struct { char name[30]; } tgt, src = { "Einstein" };
    tgt = src; 
Since there are no strings, it cannot be true that strings are pointers. They can be arrays, and array sizes are known at compile time. It's just a 40-year old cop-out that we can't copy by assignment all types based on their `sizeof` size.
← PreviousPage 2 of 3Next →