RSSAmplifier

Blog

Blog — alganet

Technical articles on software development

alganet.github.ioRSS feed ↗15 posts

Latest posts

Bash for Browser Frontend

The title is bait. It is also, annoyingly, true. If you have a terminal within reach, run this: What comes back is not a screenshot of the site and not a dump of its text, but the site itself, made navigable, so that the arrow keys scroll it, Tab steps between its links, Enter opens a post, and the...

POSIX Is Not A Shell

When someone says "write it in POSIX shell for portability," they mean well. POSIX is a specification. Not a program. The thing that actually runs your script is bash, dash, ash, ksh, yash, or one of a dozen others. They each implement POSIX with their own gaps, extensions, and historical accidents.

Teaching AI to Verify Its Sources

LLMs confidently cite documentation that doesn't exist. “According to MDN, Promise.allSettled() returns a promise that resolves when all promises have completed.” That sounds right. But MDN actually says “fulfills when all of the input's promises settle”. Different verb, different...

The Universal Plug: Connecting Containers to Callables

PSR-11 solved an important problem in PHP: it gave us a universal socket for dependency containers. Any framework, any library, any application can expose its services through ContainerInterface, and any consumer can pull from it without caring about the implementation. But there's a gap. You have...

Feng Shui Refactoring

If you've worked on a large codebase long enough, you've probably seen a certain kind of refactoring that feels productive but doesn't actually improve the system. Some files get renamed, functions move around, directories and namespaces are reorganized, but nothing changes. The diff is large, the...

Leveraging Attributes With Respect\Validation and Laravel

The full example for this blog post is available on GitHub. Validation logic often ends up distributed across request rules, controller checks, model helpers, and serializers. In that arrangement, constraints for the same field can diverge over time. This example uses a single domain object as the...

Bootstrapping Is Not Security Paranoia

Bootstrapping compilers are often discussed from the same angle: security paranoia. In this framing, their only purpose is to defend against the class of attacks described in Ken Thompson’s Reflections on Trusting Trust. If a compiler is compromised, it can perpetuate that compromise...

Building a Modular Application with apywire and starlette

This blog post explains how to use apywire to build a modular, dependency-injected starlette application. We’ll go step-by-step to wire up services, handlers, and a database using a declarative config.yaml. The complete code for this tutorial is available at github.com/alganet/apywire-starlette....

Validating Markdown Structure in a Single Declarative Expression

Back in 2010, I started this little project called Respect\Validation. At first glance, it's a cute little library that uses fluent interfaces to validate simple values: However, that's just the tip of the iceberg of what this library can actually do. Over the years, I've used it to not only...

The Five Levels of PHP 8.5 Pipes

PHP's pipe operator unlocks a very readable, functional style. Below I walk through five conceptual "levels" of using pipes: from the simple production line to composed functor objects. You can use these as templates that you can extend upon in your own projects. Each step transforms the value in...

How To Make Good Code Reviews

Good code reviews are an art. It takes years or sometimes decades to learn how to do them well. The most important thing, our prime directive, is to be kind and constructive. Soft skills are one of the key ingredients for a sustained good code review practice. The other ingredients are technical...

A true 'hello world' LLM pipeline

For a while now, I've been searching for the simplest, useful LLM pipeline example. Some kind of hello world that beginners can quickly understand and iterate upon. I also want something for software engineers, not data scientists. Software engineers are a different breed, and although they need...

How Developers Stole "Dry Runs" From Machinists

If you’ve ever run a command with a --dry-run flag, you probably knew what it did. It ran the thing, but not the whole thing. More specifically, a dry run runs all but the irreversible parts of an operation. For example, let's say you have a command-line program called cleanup-database: When you...

Polyglot Makefiles

While Unix-like systems typically use GNU make, Windows environments based on Microsoft toolchains, traditionally use nmake. Although alternatives like GNU make on Windows exist (MSYS2, MinGW, WSL), many projects still need to support native nmake workflows. Unfortunately, GNU make and nmake are...

Hello Blog

For a while now, I've been wanting to start a technical blog. I decided to transform this simple, hand-crafted HTML website into a platform for it. It is as close as pure HTML as you can get. I create posts by writing the HTML by hand, and there is a 80-line (at the time of writing) shell script...