Knowledge Updates

Observations while developing web applications and creating great software.

  • Writing an x86 operating system in Rust ↗

    Philipp Oppermann:

    This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code, so you can follow along if you like.

    See also: Build a RISC-V operating system in 1,000 lines by Seiya Nuta and Compiler Explorer by Matt Godbolt.

  • Just use SemVer ↗

    Changing public APIs is okay. Accept you will not get it right the first time. Very thankful so many developers just use Semantic Versioning.

    As a solution to this problem, we propose a simple set of rules and requirements that dictate how version numbers are assigned and incremented. These rules are based on but not necessarily limited to pre-existing widespread common practices in use in both closed and open-source software. For this system to work, you first need to declare a public API. This may consist of documentation or be enforced by the code itself. Regardless, it is important that this API be clear and precise. Once you identify your public API, you communicate changes to it with specific increments to your version number. Consider a version format of X.Y.Z (Major.Minor.Patch). Bug fixes not affecting the API increment the patch version, backward compatible API additions/changes increment the minor version, and backward incompatible API changes increment the major version.

    We call this system “Semantic Versioning.” Under this scheme, version numbers and the way they change convey meaning about the underlying code and what has been modified from one version to the next.

    Ignore calls for vanity versioning.

  • rr-next-routes ↗

    Vincent Niehues created this library for using Next.js style routes in a React Router 7 application.

    import { type RouteConfig } from "@react-router/dev/routes";
    import { generateRouteConfig, appRouterStyle } from "rr-next-routes";
    
    const autoRoutes = generateRouteConfig({
        ...appRouterStyle,
        print: "tree",
    });
    
    export default [
        ...autoRoutes,
        route("some/path", "./some/file.tsx"),
    ] satisfies RouteConfig;

    React Router’s routes.ts file allows for creating your own route generator functions and merging them with other routes, including React Router’s fs-routes or anything you want.

  • The Process Predicament (2002) ↗

    The wildfires around Los Angeles are heartbreaking and preventable.

    Here’s the U.S. Forest Service back in 2002:

    Unfortunately, the Forest Service operates within a statutory, regulatory, and administrative framework that has kept the agency from effectively addressing rapid declines in forest health. This same framework impedes nearly every other aspect of multiple-use management as well. Three problem areas stand out:

    1. Excessive analysis—confusion, delays, costs, and risk management associated with the required consultations and studies;
    2. Ineffective public involvement—procedural requirements that create disincentives to collaboration in national forest management; and
    3. Management inefficiencies—poor planning and decision-making, a deteriorating skills base,
      and inflexible funding rules, problems that are compounded by the sheer volume of the required paperwork and the associated proliferation of opportunities to misinterpret or
      misapply required procedures

    These factors frequently place line officers in a costly procedural quagmire, where a single project can take years to move forward and where planning costs alone can exceed $1 million. Even noncontroversial projects often proceed at a snail’s pace.

    Forest Service officials have estimated that planning and assessment consume 40 percent of total
    direct work at the national forest level.

    That would represent an expenditure of more than $250 million per year. Although some planning is obviously necessary, Forest Service officials have estimated that improving administrative procedures could shift up to $100 million a year from unnecessary planning to actual project work to restore ecosystems and deliver services on the
    ground.

    Things have not gotten better since.

    Isaiah Taylor on X:

    In 2007 the Sierra Club successfully sued the Forest Service to prevent them from creating a Categorical Exclusion (CE) to NEPA for controlled burns (the technical term is “fuel reduction”). The CE would have allowed the forest service to conduct burns without having to perform a full EIS (the median time for which is 3.5 years).

    In 2021 the outgoing Trump BLM was served with the […] notice of intent to sue by the Center for Biological Diversity for their fuel reduction plan in the Great Basin. BLM backed away from the plan after the transition.

    Earlier today, the mayor of Los Angeles refused to answer questions from a reporter about her decision to cut the funding of the Los Angeles Fire Department by $17.6 million last June.

    Via X

  • Demonstrable, undeniable, awe-inspiring progress ↗

    David Heinemeier Hansson:

    This is exactly the kind of willing the future into existence that leaps of progress depend on. Who cares whether all these incredible ambitions arrive right on time or not.

    Because ambition this crazy is only likely to emerge from someone equally and sufficiently nuts. And I mean that in the most admirable way possible. Musk is nuts. He’s one of the crazy ones. A true original. Easy to hate, impossible to ignore.

    And that’s what gets me. Everyone find it easy to nod in agreement with Jobs’ ode to To The Crazy Ones. Everyone wants to believe that they’d support “the misfits, the rebels, the troublemakers”. That they too would cheer for those who are “not fond of rules. And… have no respect for the status quo”.

    But they won’t and they don’t. Most people are either aggressively or passively conformist. They squirm when The Crazy Ones actually attempt to change the world. They don’t see genius as often as they see transgressors.  A failure to comply and comport. And they don’t like it.

    I like it. Not crazy for the sake of crazy, but crazy for the sake of progress. Demonstrable, undeniable, awe-inspiring progress. And that’s what Mr Musk has brought us and continues to bring us.

    Watch on X