News for hackers. Stuff that matters.

tmoertel

Re:Novellas with Groff on Monday November 02, 2026 @09:20AM (#50337170)
One potential weakness with using groff for professional publishing is that, according to its current mission statement (2014), its line-layout algorithm is limited and well behind the times:

Groff currently uses a greedy algorithm to format paragraphs one line at a time, but the Knuth-Plass algorithm, implemented in TeX, Heirloom troff and elsewhere, optimizes linebreaks throughout whole paragraphs and achieves a more uniform typographic grey. One of the most exciting challenges facing groff will be implementing an improved formatting algorithm, the most likely candidate being Knuth-Plass. It’s a big job, but with groff’s clean codebase and helpful community of experts, it is hoped additional developers will step forward and contribute their programming skills.

Equally important will be instituting native support for TrueType, Open Type, and other non-Type1 PostScript fonts, and improving Unicode support.

Source: https://www.gnu.org/software/groff/groff-mission-statement.h...

Re:Novellas with Groff on Sunday November 01, 2026 @10:17PM (#50332755)
That PDF is for proofreading and review, so I just used U.S. Letter size to make it easy to print on my home printer. For actual publication, I would use the page size for, say, a trade paperback.

For epubs, right now I'm using Pandoc: https://pandoc.org/epub.html. But, again, that's just now for the writing and proofing stages. For final output, I'll consider my options. (I may still go with Pandoc, but right now I'm using it because I was already using it for typesetting and so it was a low-friction choice.)

Re:Novellas with Groff on Sunday November 01, 2026 @07:30PM (#50331501)
That's right. From the colophon of 1989's Nutshell Handbook on Using C on the UNIX System:

> The text of this book is set in Times Roman; headings are Helvetica; examples are Courier. Text was prepared using the troff text formatter and the devps PostScript filter. Figures are produced with a Macintosh. Printing is done on an Apple LaserWriter.

Re:Novellas with Groff on Sunday November 01, 2026 @11:15AM (#50326981)
Indeed. One irresistible temptation for coders who go into writing is to bikeshed their pipeline. I know I have spent many hours tweaking my writing pipeline when I should have been writing. I mean, why just write when you can create a Containerfile to build a hermetically sealed image that houses your typesetting system and a dozen carefully chosen fonts, and then you can write scripts managed by a Makefile to launch containers from the image and inject into them your source text and extract from them the typeset PDFs? I mean, surely all of that is essential work on the critical path to getting your writing done. Right?
Re:Novellas with Groff on Sunday November 01, 2026 @11:05AM (#50326872)
One thing I have noticed about S-tier writers is that most of them have an established routine and stick to it. Why risk breaking something that works? With an established routine, you settle into it, and muscle memory puts you into writing mode. Start mucking with the routine, and that is how you get writer’s block.
Re:Novellas with Groff on Sunday November 01, 2026 @10:48AM (#50326743)
I think it’s fascinating to see all the different ways that techfolk who write fiction set up their writing pipelines. Some people go with a bare-bones coding editor like Vim; others use “pro” tools Scrivener. And then there’s the typesetting pipeline. Using troff is pretty out there.

When I started writing fiction, here’s what I came up with. I write in Google Docs because it’s lightweight, works everywhere, and can easily export to Markdown format. From there, I manage the Markdown source in Git and Emacs. For typesetting—I cannot abide crappy word-processor output—I used to use Pandoc to generate LaTeX markup and run LuaLaTeX to produce PDFs. But that took several seconds. Now, I use Typst to go straight from Markdown to PDF files. It’s pretty much instant.

If you want to see what the output looks like, here’s the first chapter of my current project:

https://drive.google.com/file/d/1Wl4k_rdYGFZp-r5nq864r5CNzD1...

(Notice: This is a typesetting sample, not a writing sample. It’s my W40k-adjacent fanfic, so you have been warned.)

It’s set in 12pt Erewhon, which is an enhanced version of Andrey V. Panov’s Heuristica font family, which extends Robert Slimbach’s Utopia font family. Slimbach is a sublime type designer—he created Minion—and Utopia is one of his early works that is especially spirited.

Re:HackerTube: YouTube built from videos recommended by HN on Sunday November 01, 2026 @12:10AM (#50322628)
Tired of low-effort YouTube clickbait slop? Just click on the Subscriptions heading to go to https://www.youtube.com/feed/subscriptions. You'll see only videos from the creators you have subscribed to. This one-click trick boosts the signal-to-noise ratio dramatically.
I'm curious: With your approach, how do you make sure your code is secure? For example, how do you show that it isn't riddled with XSS or other injection vulnerabilities?
Re:The Trouble with 'Ntile()' on Wednesday September 23, 2026 @02:30PM (#49820417)
If it is "cursed" for a function to do what it is clearly documented to do, instead of what someone mistakenly imagines it to do, then what function isn't cursed?

> Not being able to specify how ties are handled (and choosing, as far as I can tell, a fairly useless definition) fits the bill.

Actually, you can completely specify how ties are handled—and should, in any study designed to be repeatable. The docs for dplyr::ntile tell us that:

> To rank by multiple columns at once, supply a data frame.

So, repeatable, completely specified tiebreaking is as easy as adding a tiebreaker column to the dataset, using whatever strategy makes sense for your study. For example, if we wanted random tiebreaking using R's built-in `runif`, all it takes is one extra line of code:

    data_table |>
      dplyr::mutate(
        tie_breaker = runif(dplyr::n()),
        ntile_bin = dplyr::ntile(tibble::tibble(partitioning_key, tie_breaker), n = 4))
Almost 100% of the original author's problems could have been avoided by just reading the docs.
Re:The Trouble with 'Ntile()' on Tuesday September 22, 2026 @08:12PM (#49809981)
Tl;dr: The trouble with ntile seems to be that, when the author of the post imagined what it did based solely on its name and she imagined wrong, she ran with her imaginary version way too long before checking the docs, which was very clear about its behavior:

> Unlike other ranking functions, ntile() ignores ties: it will create evenly sized buckets even if the same value of x ends up in different buckets.

Re:Divide by Depth for Instant 3D on Tuesday September 22, 2026 @09:39AM (#49801140)
You don't need to use homogeneous coordinates to represent a series of linear transformations as a single matrix. That's just basic linear algebra: any series of linear transformations is itself a linear transformation, and any linear transformation can be represented as an equivalent transformation matrix.

But you do need homogenous coordinates if you want to include translations (fixed distance shifts, such as moving the camera) in the set of operations you can represent as linear transformations and thereby gain all the benefits of linear algebra, including the benefit of being able to include them in a series of operations that you can represent with a single transformation matrix.

Re:Divide by Depth for Instant 3D on Monday September 21, 2026 @11:30PM (#49796503)
No, the 2d x-y plane in your example cannot pass through the 3d space’s origin because that would imply that you fixed the z coordinate at zero. The plane must be fixed at some nonzero z because you need to be able move x and y values by some scaled version of z to make translation happen. If z is zero, that scheme does not work.

Consider a transformation f where we wish to move x-y coordinates s units to the right. In 2d, we could express it as:

f(x, y) = (x + s, y)

But that transformation is affine not linear. There is no way to generate the value s as a linear combination of the inputs x and y. So, our workaround is to embed the x-y plane into 3d space at z=1. Then we can move (x,y,1) points in that plane s units to the right using this transformation:

f(x, y, z) = (x + s*z, y, z)

This new transformation is linear: it maps (0,0,0) to itself. But it maps our embedded 2d plane's origin (0,0,1) to (s,0,1), shifting it right by s units, as we want.

The matrix form of that transformation is:

    [[1 0 s]
     [0 1 0]
     [0 0 1]]
The same scheme would work if we had embedded the plane at any fixed z=r for nonzero r. We would only have to rescale the s in the matrix to s/r. Again, however, if r=0, this scheme will not work, as 1/r has gone to infinity.
Re:Divide by Depth for Instant 3D on Monday September 21, 2026 @09:09PM (#49795612)
The explanation of "What's that extra 1 for?" in the column representation of 3-d coordinates (x y z 1) could benefit from mentioning that translation—moving things—is not a linear transformation (the origin is not mapped to itself) but an affine transformation. Therefore, you cannot represent translation in 3-d space with a 3x3 matrix. What you can do, though, is embed that 3-d space within a 4-d space fixed at some coordinate on its 4th dimension, typically w=1. Then, a translation in the original 3-d space can be represented as a linear transformation in the 4-d space and thus can also be represented by a 4x4 matrix multiplication. So the extra 1 is actually what allows all common 3-d operations, including translation, to be done via linear algebra and thereby harness the brutal power of matrix multiplication on modern computing devices.
Re:Asking Authors About Their Own Papers on Sunday September 20, 2026 @10:53AM (#49776471)
But the public is still made a victim by being deceived about the authorship and hence the value and reliability of the work.
Another is Kalmia latifolia, the mountain laurel, the state flower of Pennsylvania. According to records at the Carnegie Museum of Natural History [1], "Benjamin Smith Barton (an American botanist in the late 1700s) wrote that in the autumn and winter of the year 1790, many people died in Pennsylvania from the effects of wild honey, collected from Kalmia plants."

[1] https://carnegiemnh.org/collected-day-1959/

Re:Things I want in a modern relational query language on Sunday August 23, 2026 @11:35AM (#49409676)
The problem with alternative query languages is that the people who have the most knowledge about creating queries and of the relational domains underlying their businesses are all experts in SQL. Introducing something else, then, means your most natural user base must migrate away from something they understand how to use well, and that's a hard sell.

So, until the ultimate query language is developed, I'll take SQL with pipes. It's an easy sell and good enough to eliminate 90% of my gripes about SQL.

Re:The Golden Rule for Becoming a Better Writer on Sunday August 23, 2026 @10:56AM (#49409340)
> Please please suggest me some books where language and style of speaking sentences takes the crown rather than the story being the selling point.

I will give you approximately twenty delightful novels where the prose and the stories are both excellent: Patrick O’Brian’s Aubrey–Maturin series.

I avoided these books for the longest time because I didn't believe I was the kind of person who would read “books about tall ships.” But so many people recommend these particular books because of the masterly writing that I tried the first, Master and Commander. Immediately, I was taken by O’Brian’s writing: vivid, lively, and engaging, while also utterly precise.

Give that first novel a try. It’s not easy, but it is oh so rewarding.

Edited to add some examples from the first novel:

“I have never yet known a man admit that he was either rich or asleep: perhaps the poor man and the wakeful man have some great moral advantage.”

“Where there was no equality there was no companionship: when a man was obliged to say ‘Yes, sir,’ his agreement was of no worth even if it happened to be true.”

“He held up two fingers, in case a landman might not fully comprehend so great a number.”

“But you know as well as I, patriotism is a word; and one that generally comes to mean either my country, right or wrong, which is infamous, or my country is always right, which is imbecile.”

Re:Scrap on Saturday August 22, 2026 @11:25PM (#49405851)
> I also think that we should have mercy for people who’ve made mistakes.

Yes. When people make mistakes, they sometimes fall into holes that are hard to climb out of. It is in society’s interest to place ladders in these holes so that these unfortunate people can climb out and become productive members of society.

Instead, we have self-interested parties who have figured out how to extract rents from keeping people trapped in holes. Some of these parties are preventing ladders from being built. Others are destroying existing ladders. Others still are even inventing deeper, stickier holes—crypto scams, ubiquitous gambling, addictive gas-station drugs, dopamine-hit apps—to trap even greater numbers of their fellow human beings.

When a society allows the suffering of others to become a profitable business model, good things rarely follow.

Re:Scrap on Saturday August 22, 2026 @07:08PM (#49404744)
I'm not who you asked, but I moved to Pittsburgh for a job, figuring I would earn money for a few years then move to real city. That was over thirty years ago. Turns out, I love the place.

Pittsburgh has most of the benefits of a larger city without most of the problems. Its infrastructure is in many ways over-provisioned, being built for past industry and a larger population (but the maintenance burden is catching up). Its unusually hilly and berivered geography has allowed its neighborhoods to escape homogenization and retain their individual ethnic characters. And the setting, with rivers, bridges, trails, forests, is beautiful. Plus the airport recently got overhauled to meet the region’s actual needs, making it way more convenient.

Oh, if you're in to sports, Pittsburgh has some great teams and a great fan base.

Yeah, I like the ’Burgh.

Re:Scrap on Saturday August 22, 2026 @05:53PM (#49404229)
Yeah, most people probably underestimate the effect that several things have on where they end up in life: education, self discipline, hard work, making good decisions, persistence, and, especially, chance. If you screw up majorly on any the factors under your control, you dramatically reduce your chances of “the good life.” But, even if you do all of them right, you are still at the mercy of chance. Get born in the wrong year or at the wrong place or into the wrong family or with the wrong genetics and that's all it takes to set you up for a hard life.

The tragedy is that we could have a society that gives people more opportunities to escape the downward pull of chance gone wrong early in life. Maybe someday we'll get there.

Re:People of ACM – Russ Cox on Friday August 21, 2026 @05:59PM (#49394239)
It's available online for free: https://abseil.io/resources/swe-book

And, yep, it's worth a read.

Re:Blog about things you don't understand yet on Friday August 14, 2026 @12:29AM (#49294765)
> Please, no. Don't blog about things you don't understand yet.

Do you really mean this? Or do you mean "When you blog, be honest. Don't pretend to understand things you don't."?

Blogging about things you are learning about, especially if you invite feedback, is a great way to learn and to build a shared understanding within a larger community.

But I agree 100% on the fake-it-till-you-make-it posts on blogs and LinkedIn. That stuff is a blight on the web.

ADDED a concrete example: Consider this post: https://blog.moertel.com/posts/2026-07-23-on-the-nature-and-.... Do you think that posts like this are useful? Or net harmful?

Re:Blog about things you don't understand yet on Thursday August 13, 2026 @11:54PM (#49294575)
You raise an interesting point. I agree that discussing a subject with a knowledgeable mentor, AI or otherwise, is a great way to learn. But I think back-and-forth discussions are limited as a means of testing your mastery of a subject. Especially with complex and nuanced subjects, being able to organize them in your mind is an essential part of mastery. You will not know if you have mastered them unless you can generate a clear and coherent description of them entirely on your own. With a mentor prompting you, step by step, you are relying in part on the mentor’s understanding of the subject to guide your thinking.

It is like the difference between multiple-choice and essay exams. In the former, the questions you are asked reveal much about the structure of the subject to be explored and of the relative importance of its facets and the many nuances within. In the latter, you are on your own: you must conceive of a coherent map, render its form onto a blank sheet, and populate it with what is important, with everything being sensibly connected.

Re:Blog about things you don't understand yet on Thursday August 13, 2026 @09:55PM (#49293934)
One of the best ways to clarify your thoughts about a subject is to write about it, and one of the best ways to prove to yourself that you understand it is to be able to write about it clearly. Indeed, my primary motivation to write is to order my thoughts and better understand the universe I live in.

It is surprisingly difficult work, but so is lifting weights. That is precisely why I insist on doing it myself. If I let an AI write for me, it would be the same as letting a robot lift weights for me. Yeah, it would be easier, but I would not get stronger, nor would I gain the confidence and self discipline that comes from doing hard things.

Re:Discovery Loop on Wednesday August 05, 2026 @04:36PM (#49188667)
They do not call attention to this aspect of their new company, but it is implicit in their business model:

https://xcancel.com/JeffDean/status/2085034604172603724

In short, they are in the business of using AI to automate the discovery of useful knowledge, not to sell general-purpose AI capabilities that could be directly used in troubling ways.

Re:Discovery Loop on Wednesday August 05, 2026 @02:17PM (#49186738)
Do you believe that securing cyberspace is problematic solely because it has military implications? I mean, everything has military implications. That fact doesn't imply, however, that those things are bad for society.
Re:Discovery Loop on Wednesday August 05, 2026 @02:04PM (#49186537)
Note that Jeff and crew have cleverly structured their company to avoid problematic uses of AI (e.g., weapons or tracking humans). I suspect that many top researchers will want to work there for this reason, and to work with other top researchers who have a history of delivering results.

Older »