Posts

Pattern Overload (And Why We Love It)

hprscript: Multi-Pattern Search Without Running grep N Times Why I built it Like many other programmers, I use AI agents for code development. A lot of the work is supervising what the agent does - reading its plans, checking its diffs, and sanity-checking the code it touches. That means a lot of grep commands, run one after another, often against the same tree. At some point I started thinking this was wasteful. Each grep invocation re-reads the files, re-compiles its pattern, and pays its own startup cost. And when an AI agent is the one driving, every separate search also re-sends the surrounding context to the model - the same conversation, the same instructions, the same tool schemas - just to ask one more question of the same codebase. Ten searches mean ten round trips, ten context replays, ten walks over the data. I knew there was a library that could match many patterns at once: Intel's Hyperscan . It compiles N regexes into a single DFA and matches them all ...

Innovation vs. Creativity (or Tactics vs. Strategy)

Nokia had the future in its drawer My first mobile phone was a Nokia. Around 2000 almost everyone's was: Nokia sold roughly a third of all handsets in the world, and at the height of the dot-com boom its market value briefly touched about €300 billion, making it the most valuable company in Europe. In 2013 Microsoft agreed to buy the entire phone business for €5.44 billion ( Silicon Canals ). How does the undisputed leader of an industry lose almost everything in a little over a decade? The usual explanation is that Nokia "missed the smartphone revolution". That is not quite true. Nokia sold its first smartphone, the Nokia 9000 Communicator, in 1996, and in 2010 it still held about a third of the smartphone market; by 2013 its share was under 3%. Nokia did not miss the smartphone. It missed a much bigger shift: a change in how a company and its community interact. Nokia understood too late that a smartphone is not a product but a platform, a place where a whole community ...

2025 - Global Demographic Transition

Image
We stand at a pivotal moment in human history, not merely facing another crisis but confronting a fundamental shift in our existence. This is not a passing storm but a transformation that demands our attention and understanding. 2025 In my previous blog post " Globalization "  I delved into the demographic research of Russian professor Sergey Kapitsa, " PARADOXES OF GROWTH: LAWS OF GLOBAL DEVELOPMENT OF HUMANITY ".  Kapitsa identified a mathematical model that accurately represents global human population growth, expressed by the differential equation: \begin{equation} \large{}\color{blue}\frac{d N}{d T} = \frac{N^2}{2*10^{11}} \end{equation}Professor Kapitsa presented human population growth not only in form of differential eqation. He also introduced formal formula for calculating human population over time.\begin{equation} \large{}\color{blue}N = \frac{2*10^{11}}{2025-T} \end{equation}where N is number of people over globe and T is year. In picture you can s...

Globalization

Image
In my previous post, " Life, Death, and 'The Winner Takes It All' " I discussed a simple differential equation that can be used to calculate population size \begin{equation} \large{}\color{blue}\frac{d x}{d t} = x \end{equation} This equation, known as the exponential function, becomes more complex when it incorporates death rates (the logistic function) and competition (the "struggle of information" model). However, the underlying principle of these models remains the same: the growth rate of a population is proportional to its current size. This principle holds true for most species, but there is one notable exception: humans. Humans are unique in that their population growth does not follow the basic principle outlined above. The study of human population size and growth rates is known as demography. Demographers collect statistics on the number of people in different areas and develop mathematical models to represent these numbers as accura...

"Life", "Death" and "The Winner Takes It All"

Image
I want to talk about how one simple differential equation became very useful mathematical model that reflect how different ecosystems (both in nature and in technology) evolve. "Life" One of most known ecosystems used for mathematical modeling is population of rabbits. We assume that next generation of rabbits will have all already living rabbits plus new born rabbits. Number of new born rabbits is proportional to number of existing rabbits. We'll take simplest case when number of additional rabbits equal to number of existing rabbits (when 2 rabbits bring 2 new rabbits). This means that change of number of rabbits equal to number of rabbits, or as differential equation: \begin{equation} \large{}\color{blue}\frac{d x}{d t} = x \end{equation} General solution for this differential equation is: \begin{equation} \Large{}\color{blue} x = e^t \end{equation}(where X is population number, T is time). This equation is known as " exponential function ". Many times thi...

Big Software Contradiction

One of the renowned books in software industry is " The Pragmatic Programmer: From Journeyman to Master ". This book offers acomprehensive set of practical guidelines for creating superior software. As I read each section, I contemplated how to implement the advise and what it would look like in practice.   The section on "The Evils of Duplication" introduced the DRY principle (Don't Repeat Yourself) - the idea of having a "single source of truth" for code functionality. My initial thought was to create functionality only once and reuse it wherever needed. This would obviously simplify maintenance and ensure changes are made in just one place if needed. The following section discussed the concept of "Orthogonality." It explained that unintended side effects can occur when fixing software code. Orthogonality means that changes over some dimension will not lead to changes in other (orthogonal) dimension. In other words we need to try to creat...