<>

Microprogramming: A New Way to Program

by Breck Yunits

September 24, 2024

All jobs done by large monolithic software programs can be done better by a collection of small microprograms (mostly 1 line long) working together.

Building these microprograms, aka microprogramming, is different than traditional programming. Microprogramming is more like gardening: one is constantly introducing new microprograms and removing microprograms that aren't thriving. Microprogramming is like organic city growth, whereas programming is like top-down centralized city planning.

In a microprogram every line of code can be its own program.

Type Files Lines Of Code Programs
Programming 1 1000 1
Microprogramming 1 1000 200-300

Microprogramming requires new languages. A language must make it completely painless to concatenate, copy/paste, extend and mix/match different collections of microprograms. Languages must be robust against stray characters and support parallel parsing and compilation. Languages must be context sensitive. Languages must be homoiconic. Automated integration tests of frequently paired microprograms are essential.

Microprograms start out small and seemingly trivial, but evolve to be far faster, more intelligent, more agile, more efficient, and easier to scale than traditional programs.

Microprogramming works incredibly well with LLMs. It is easy to mix and match microprograms written by humans with microprograms written by LLMs.

These are just some initial observations I have had so far since our invention of a breakthrough microprogramming language stack. This document you are reading is written as a collection of microprograms in a language called Scroll, a language which is a collection of microprograms in a language called Parsers, which is a collection of microprograms written in itself (but also with a last mile conversion to machine code via TypeScript).

If the microprogramming trend becomes as big, if not bigger, than microservices, I would not be surprised.

Q & A

yuri-kilochek asks "what is a microprogram? How is if different from a procedure?"

comment Good question! This line is a microprogram. commentParser comment This block is also a microprogram pattern comment string* comment Microprograms are 1 or more lines that are as easy to move around and concatenate as legos. It is accurate to model them as functions that take zero or more parameters. Each line/block is a function definition or application.
*

hugogrant points out "That's a lot to claim without any data."

Great point! I should mention some data.

Parsers is made of ~100 microprograms.

Scroll is built on Parses and made of ~1,000 microprograms.

PLDB.io is built on Scroll and made of ~10,000 microprograms.

*

Psychoscattman asks "But what is micro programming? This blog is just a collection on observations but doesnt explain at all what microprogramming is or how it works."

Great question!

Microprogramming is using languages where every single line is capable of being a microprogram.

Below is an example of microprogramming. This is the code that generates the homepage for BuilderNews https://news.pub . I annotated everyline to explain it in the terminology of microprogramming.

You can also view and edit it with syntax highlighting.

https://github.com/breck7/news.pub/blob/main/index.scroll
// A 1 line microprogram that sets some top matter information for html meta title BuilderNews // A 1 line microprogram that sets some top matter information for html meta tags viewSourceUrl https://github.com/breck7/news.pub // A 1 line microprogram that sets some top matter information for html meta tags description News for builders. // A 1 line microprogram that includes more scroll code header.scroll // A 1 line microprogram that outputs a div tag <div class="container"> // A 1 line microprogram that outputs a h1 tag # BuilderNews // A 1 line microprogram that outputs a h3 tag ### Watch people try your web creations for the first time. // A 12 line microprogram that reads a csv file, runs a dataflow pipeline and outputs html table tries.csv rename url creationLink select rank creation creationLink user date rename user tries orderBy rank groupBy rank reduce date first date reduce creationLink first creationLink reduce creation first creation reduce tries concat tries select rank creation creationLink date tries printTable // A 2 line microprogram that adds links to a piece of text and outputs html Build something new to try? Email a title and link to one of our users. link users.html users // A 3 line microprogram that adds links to a piece of text and outputs html Download this data as JSON. link tries.json JSON https://github.com/breck7/news.pub/blob/main/tries.scroll this data // A 1 line microprogram that includes the content of this html file: modal.html // A 1 line microprogram that runs "import": footer.scroll // A 1 line microprogram that outputs an html div tag </div> // A 1 line microprogram that outputs a javascript tag tableSearch
*

loblawslawcah says "The post didn't really show or explain it all that well."

Perhaps a video explanation would be better:

Built with Scroll v133.3.0