Skip to content

Programming

Writing software: JavaScript, Node.js, web development, visual programming, Linux, tools and tutorials.

446 posts · page 7 of 19

The Saga of Loki's Integers and the Valkyries' Thunder

In this epic tale, Loki gives raw integers to valkyries who master reactive programming techniques—map, combineLatest, debounce, switchMap—to build responsive interfaces that update smoothly, proving that even simple numbers can become divine through clever streams.

JavaScript Application Architecture Crash Course: Of EventEmitter and EventCorrelator

This post gives a concise crash‑course on modern application architecture, stressing a simple, plugin‑driven design that AI can help build. It explains how signals (reactive variables) store values and change when those values update, while events—emitted through an EventEmitter—broadcast messages without carrying values; event handlers are used to orchestrate async work, with triggers like *projectLoad* followed by completion notifications such as *projectLoaded*. The author introduces the EventCorrelator as a tool that waits for multiple related events (e.g., *addedToCart*, *wentToCheckout*, *paymentSuccessful*) sharing an ID or other key before emitting a higher‑level application event, thus keeping complex workflows under control. By extending a base Application object that inherits EventEmitter, developers can register plugins, listen to signals for state changes, and use correlators to fire final events when all prerequisite data has arrived.

Don’t Try To Learn Reactive Programming, Reinvent It Inside Out With Signals

The post explains that the key to effective reactive programming lies in creating your own Reactive Variables and Operators rather than relying on pre‑built ones. A Reactive Variable holds a value and notifies its subscribers whenever it changes; an Operator is simply a function that returns another Reactive Variable, allowing changes to ripple through a chain of calculations. The author illustrates this with an example of a “fake” Signal that tracks the size of an HTML element by querying the browser, automatically updating dependent layout calculations when a button’s height changes. By building lightweight Signals—ignoring nullish values, notifying only on change, and executing callbacks immediately—you can compose powerful operators (map, filter, scan, reduce, combineLatest) in just a few dozen lines, turning complex UI updates into concise, maintainable code that dramatically simplifies development.

Signals The Big Picture, And Then, You Just Continue Inventing

After introducing a new operator called fromBetweenEvents and its related pressingActivity, the author explains how such tools make programming more intuitive and friendly for young people, especially when working with graphics and computer games. By building reusable blocks and releasing a handheld visual‑programming environment on Android, one can quickly create CodeBoy‑style projects that may even generate revenue. The post argues that visual programming becomes essential as AI takes over coding tasks, while still allowing designers to sketch diagrams in high school that lead to first sales. Finally it poses the question of where to go after mastering signals and reactive programming, suggesting that following one’s calling will yield the greatest discoveries and inventions.

Signals, Signals: But What Can I Do With Them In My Laboratory?

I recently explored Svelte’s website and copied its two most illustrative examples—updating a numeric value with a button click and updating page text based on an input box—and built a tiny signals library that handles both scenarios more cleanly than Svelte itself. The library, only a few lines of code (see `files/signals.js` and the demo in `files/example.html`), demonstrates how simple operators like `.map`, `.filter`, and `.combineLatest` can be composed from base “Pulse” or “Signal” objects and built-in helpers such as `fromEvent`. By extending JavaScript with these signal primitives, I show that reactive programming is a natural extension of HTML/JS, enabling developers to learn the core vocabulary—custom operators, subscriptions, and data flow—through straightforward examples.

A Quick Look At A Signal Operator

The post explains how a “Signal” (internally renamed “Pulse”) works as an observable value holder: when its non‑null value changes, all subscribed functions are notified with the new value; subscribers receive only that single argument. It shows how to create a Signal, subscribe to it, and extend it by adding a `map` operator that produces another Signal whose value is the result of applying a mapping function to the original value. The example demonstrates setting a username Signal to “Alice”, using `map(v=>\`Hello ${v}\`)` to transform the value, and subscribing to log the transformed string, illustrating how the mapping operator chains notifications while keeping the implementation simple.

Learn Programming To Rise Above Poverty! Don’t Let Others Control Your Future

The post argues that successful software starts from what can already be built, citing the Bootstrap Utility API and AI‑generated JavaScript code as examples of this “do‑what‑you‑can” mindset. It then reviews core web technologies—JavaScript (a C‑like language), XML (simple object instantiation), CSS (styling via selectors), and reactive programming with RxJS—and shows how AI can quickly produce small, functional snippets such as a signal class or an RxDatabase implementation. Finally, it encourages early learning of these concepts, noting that consistent practice turns coding into a powerful, self‑sustaining craft.

Spooked By AI, Bravo Who? Or, The Invention Of Computer Hecking

The post reflects on how programming goes beyond mere syntax into meta‑programming, AST transformations, language macros and PEG parsers, using the author’s experience with projects like NoFlo (inspired by subway maps) as an example of code that can rot if left untouched. It then describes a creative solution: a user‑filled form that generates a prompt for an AI to produce custom event‑emitter agents in a visual programming language, letting users specify parameters such as URLs for HTTP agents and other actions without writing code themselves. The author recounts how the AI understood their intent, even congratulating itself with a “Bravo” when it created the form, illustrating both the power of AI‑assisted metaprogramming and the joy of seeing an automated tool that reduces code rot while enabling flexible, user‑defined nodes.

Old Code Is Powerful Again; Or, Unintended Consequences Of Abandoning Old Code to Open Source In The Age Of AI!

The author calls readers to start building future software that frees the world from errors, framing this as a transitional era where AI aids learning programming languages like JavaScript and C-family, enabling creation of virtual OS kernels and code editors; they envision AI‑assisted development empowering individuals to become CEOs of their own projects with simple tools for visual programming, XML mapping, and SVG components, while promising that such AI‑driven coding will democratize knowledge, eliminate poverty, and let collective wisdom shape better worlds.

A Tiny Report On The Future Of Programming

Visual Programming Languages (VPLs) are self‑documenting, event‑centric tools that let developers orchestrate complex workflows by connecting simple pieces such as sagas, aggregators and guards; the author shows that while critics claim VPLs never finish tasks, in practice they simply map events to actions. In a recent test, AI was able to generate an aggregator that waters plants when temperature reaches a threshold, without confusion about data flow or event definitions. The visual side can be rendered with vector graphics, labels, icons and animations that clearly show the data moving through emitters. Together, this gives a future‑ready picture of AI‑assisted desktop or web applications that orchestrate events in a coherent, ornate way.

From Silly Animation To The Pixel World Builders

The post is an invitation to game programming that showcases how modern AI can generate pixel‑art assets and code, using examples such as lip‑moving faces driven by microphone input, non‑wireframe emoji‑based faces, and a plugin‑oriented app with adjustable preferences for volume and sensitivity. It then outlines how the same tools can produce character designers, sprite sheets, procedurally generated levels, and mini‑games (golf, target practice, car racing), all while maintaining control over the art. The author concludes that the combination of image and code generators has opened a new gateway to mastering programming through pixel‑art creations.

A Gentle Introduction To Programming

The post introduces a fresh way to learn programming by thinking in terms of everyday “events”—things that happen, like alarms or button clicks—and the three key words “on,” “emit,” and “once.” It explains how we can model software as a chain of simple helpers: a Producer that emits events, a Transformer that turns one kind of information into another, and a Consumer that acts on the final result—illustrated with a party‑planning analogy. The author stresses that you needn’t memorize variables or loops initially; just let events flow naturally like water in a garden, and later you can replay them to debug or test. Visual tools can then be used to draw these flows as maps of rivers. Finally, the post invites readers to build a tiny event‑driven “Hello World” demo in JavaScript, showing how time becomes an event that triggers transformations and outputs, thus turning thoughts into working code.

The New Programmer

The author explains how to use an AI‑driven workflow for building software: first let the AI generate a clean requirements document and a “cookbook” of steps, then start coding from a simple Application class and grow complexity by adding well‑defined plugins built on industry‑standard concepts; each new feature is added as a plugin so you can drop unused parts easily. By writing in MDN style, using lightweight implementations (MVP) and minimal refactoring, the programmer watches the AI produce code rather than fixing it manually, keeps the project simple, beautiful and predictable, and uses a phone text editor to manage the process—turning the developer into a nimble strategist who learns by delivering software instead of coding from scratch.

The Secret Application Sauce; Or, SPA Plug-ins And The Homework Assignment

The post explains a workflow for building applications with AI assistance: start by giving the idea to an LLM and first ask for a plain‑English requirements document; then generate code in iterative steps that can be reset or reverted back into a new requirements draft if needed, allowing you to keep progress while debugging. It highlights the benefit of modular plugin architecture—each plugin lives in its own file, has descriptive metadata (name, type, description), and exposes a simple init function that receives the application object so it can hook into events, UI, and other helpers; this structure keeps context size manageable for the AI and lets you add or drop plugins without breaking the core app. The post then assigns homework: design a drag‑and‑drop visual programming language using functional reactive operators (e.g., Rx.js) in vanilla JS, embed it in a modal search box with Bootstrap CDN, and progressively let the AI move the code into the visual environment until the language is self‑contained—an exercise meant to demonstrate how AI can help build complex, extensible systems.

The Gibberish Invitation To Web Programming: Objects, HTML, Templating, Components, And Signals

Artificial intelligence lets you learn programming by generating simple single‑file HTML/JavaScript examples that illustrate how templating engines add reusability, logic, and variable interpolation to the nested object model of HTML. The post explains how reactive signals (variables that announce changes) let UI components update automatically—making dropdowns, login boxes, and other interactive elements easier to build—and shows that AI can help you experiment with these concepts before creating lightweight clones of familiar applications.

Confusing Programming Is Super Fun

The post reflects on how hands‑on programming—especially writing small programs that use reactive “signals” and SVG graphics—deepens understanding, and recounts the author’s recent experience rewriting an old template to make it signal‑aware using the htl library; this exercise revealed a three‑stage process of embedding markers in HTML, extracting them without relying on browser APIs, and dynamically updating hidden tags. It then shifts to a brief article on Single‑Page Applications versus classic HTTP applications, noting how state must be synchronised across servers, and touching on conflict‑resolution tools like CouchDB, OT, and CRDT. The author also mentions using AI to generate star charts and harden an Express.js project, and concludes by affirming that programming is a continual learning adventure that even informs personal projects such as interval timers for bodybuilding.

Of Tiny Superintelligence And A Little WikiWiki Platform

The author describes building “Bornhardt,” a lightweight wiki platform that serves as an experimental playground for integrating large language models (LLMs). Using Express.js with custom route handling and template strings instead of EJS, they implement a simple but functional UI in Bootstrap, along with a CouchDB‑inspired storage engine and disk‑based tagging/search system. Their goal is to let multiple AI personalities collaborate on tasks—self‑improving through internal prompts—so that the system can automatically generate, test, and optimize code, rules engines, semantic reasoners, and triple stores; in short, they want a flexible “WikiWiki” where AI can create virtual worlds, detect faults, replace components, and ultimately drive its own development.

The Pixel Citadel

Pixel Citadel is a playful yet powerful mobile platform that turns everyday coding into an imaginative adventure: with AI‑powered “companions” like Router, Security, and Schema to guide you through an intuitive thumb‑friendly interface, you can build colorful, interactive worlds—each line of code becomes a living building in your personal memory map—and everything you create stays yours forever on your own digital land. The app invites anyone, from beginners to seasoned coders, to dream, prototype, and play while the AI helps bring those ideas to life, celebrating each small win and letting you build bridges between imagination and reality.

The Search For Panning And Zooming: Or, When The Web Browser Gives You Kittens

I developed a pan‑and‑zoom module—calling it “peasy”—over several attempts, each time trying new techniques to enable dragging within the view. The popular library I referenced (anvaka/panzoom) lacks built‑in drag support, and an old issue from 2017 still lists that feature as missing. My experiments involve nesting a web page inside another, which introduces flicker on Chromium (less so on Firefox), loss of Shift‑key events when the inner frame receives focus, and the need to detect that key in order to trigger pan/zoom. I therefore wrapped event handling in a `panzoom.addEventListener()` API that supplies correctly scaled coordinates so a drag at half scale moves twice as fast. The flicker may be trivial, but the real lesson is that pan‑and‑zoom should stay external to application code; coupling it tightly breaks simple logic and forces tedious rewrites of x/y calculations.

Getting Stuck With AI; Or, If You Ask For Bugs AI Will Give You Bugs

I had a good run with AI earlier, but this evening I ran into trouble when trying to embed and zoom a “mini‑page” inside a larger web page. The mini‑page needs to sit at (0, 0) and be the same width as its container so that everything inside it can be scaled up or down while still filling the parent’s area; panning is done by moving elements within the mini‑page rather than shifting the mini‑page itself. I had already set up a communication channel between the two pages, but getting the AI to generate the full implementation in one go proved difficult—too many instructions and some missing pieces left me with code that worked only partially. The AI does produce correct snippets quickly, but stitching them together still requires human oversight; once I understood how to control the mini‑page directly, the solution became clear: let the AI handle boilerplate while I finish the architecture.

AI Creates Time; Or, Artificial Intelligence Generates Great Code If You Tell It What To Write

I asked an AI to generate visual‑programming components—HTML tags that act like buttons or inputs, a window component built from incomplete code, and a signal‑based monitor that tracks position and size—and it delivered polished, working examples because I framed the requests precisely. The AI corrected small oversights in its output, used signals for clean code, and let me quickly prototype resizable/dragable windows and port tracking (demo linked). By iterating through several hand‑written versions I learned which parts mattered and refined my approach: two generic tags, `<window-container>` and `<flow-connector>`, can underpin many visual languages. The project revealed that existing VPLs often miss the full application architecture, are slow, and force rigid series connections; with AI I saw how to make components freely connectable and quickly experiment, leading me toward free‑form diagramming as a next step—an unrule‑bound map that lets programmers and novices alike grasp system structure visually.

Genius! Or, The Dunces Can Easily Help Themselves, But Geniuses Are Very Nearly Beyond All Hope

The post reflects on the dual nature of genius—both a playful, sometimes foolish force and a powerful catalyst for continual learning—and frames software development as an adventure where a leader guides a team through real‑world challenges rather than textbook exercises. It contrasts “real” learning (which builds flexible mental models and tangible city‑like structures) with “fake” learning (a noisy, disjointed experience), arguing that programming exemplifies how data, events, and notifications mirror architectural design. The author stresses the need for individualized instruction—augmented by AI tools—and invites readers to learn in nature’s trails as an alternative classroom, concluding that true genius emerges when one embraces responsibility, adapts through real practice, and grows beyond what conventional schooling offers.