-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
microprograms.scroll
194 lines (130 loc) · 11.1 KB
/
microprograms.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
date 9/24/2024
tags All Programming Scroll
title Microprogramming: A New Way to Program
openGraphImage microprogramming.png
header.scroll
printTitle
mediumColumns 1
printAuthors
printDate
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. Microprogramming is putting the necessary microprograms in a petri dish, applying natural selection over time until they can beautifully and most simply solve your problem.
***
In a microprogram every line of code can be its own program.
table
printTable
data
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).
https://scroll.pub/ Scroll
https://scroll.pub/parserLeetsheet.html Parsers
https://scroll.pub/blog/teddyTalk.html breakthrough microprogramming language stack
***
If the microprogramming trend becomes as big, if not bigger, than microservices, I would not be surprised.
https://en.wikipedia.org/wiki/Microservices microservices
***
Microprogramming is inspired by microbiology.
You may know me as the creator of PLDB (a Programming Language DataBase), earth's largest database on Programming Languages, and find it relevant that I have personally studied and reviewed information on over 5,000 programming languages - nearly 100% of all publicly used languages.
https://pldb.io/ PLDB
What you might not know is that I also have a peer-reviewed track record in genomics and multiomics, and that Parsers, the language we invented that enabled Microprogramming, is built not on the patterns I found in programming languages, but instead built on the patterns nature evolved that I studied in microbiology.
The biological design is why this stack is unlike any language you have used before. You will be able to build any advanced program you could build using a traditional language, but the path to that solution may be very different. Once you've mastered this stack, I expect you will be astonished at how much you can do with so little.
The payoff from this biological approach will become increasingly apparent over time, as we continue to do things with this stack with radically less code than traditional approaches.
This is the dawn of a new paradigm shift in programming, and my job is to provide you with the truest, clearest, most concise information I have gathered over the past two decades so you can take this technology and build a better future for us all.
****
# Q & A
? yuri-kilochek asks "what is a microprogram? How is if different from a procedure?"
https://www.reddit.com/r/ProgrammingLanguages/comments/1foe9f5/comment/lop81qt/ yuri-kilochek asks
code
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."
https://www.reddit.com/r/ProgrammingLanguages/comments/1foe9f5/comment/lop94xu/ hugogrant points out
Great point! I should mention some data.
Parsers is made of ~100 microprograms.
https://sdk.scroll.pub/designer/index.html#standard%20parsers ~100 microprograms
Scroll is built on Parses and made of ~1,000 microprograms.
https://scroll.pub/cloc.html ~1,000 microprograms.
PLDB.io is built on Scroll and made of ~10,000 microprograms.
https://github.com/breck7/pldb ~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."
https://www.reddit.com/r/programming/comments/1foeaef/comment/lopaodm/ Psychoscattman asks
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://try.scroll.pub/#scroll%0A%20%2F%2F%20This%20code%20generates%20the%20homepage%20for%20BuilderNews%20-%20https%3A%2F%2Fnews.pub%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20sets%20some%20top%20matter%20information%20for%20html%20meta%0A%20title%20BuilderNews%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20sets%20some%20top%20matter%20information%20for%20html%20meta%20tags%0A%20viewSourceUrl%20https%3A%2F%2Fgithub.com%2Fbreck7%2Fnews.pub%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20sets%20some%20top%20matter%20information%20for%20html%20meta%20tags%0A%20description%20News%20for%20builders.%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20includes%20more%20scroll%20code%0A%20header.scroll%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20outputs%20a%20div%20tag%0A%20%3Cdiv%20class%3D%22container%22%3E%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20outputs%20a%20h1%20tag%0A%20%23%20BuilderNews%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20outputs%20a%20h3%20tag%0A%20%23%23%23%20Watch%20people%20try%20your%20web%20creations%20for%20the%20first%20time.%0A%20%0A%20%2F%2F%20A%2012%20line%20microprogram%20that%20reads%20a%20csv%20file%2C%20runs%20a%20dataflow%20pipeline%20and%20outputs%20html%0A%20table%20tries.csv%0A%20%20rename%20url%20creationLink%0A%20%20%20select%20rank%20creation%20creationLink%20user%20date%0A%20%20%20%20rename%20user%20tries%0A%20%20%20%20%20orderBy%20rank%0A%20%20%20%20%20%20groupBy%20rank%0A%20%20%20%20%20%20%20reduce%20date%20first%20date%0A%20%20%20%20%20%20%20reduce%20creationLink%20first%20creationLink%0A%20%20%20%20%20%20%20reduce%20creation%20first%20creation%0A%20%20%20%20%20%20%20reduce%20tries%20concat%20tries%0A%20%20%20%20%20%20%20select%20rank%20creation%20creationLink%20date%20tries%0A%20%20%20%20%20%20%20%20printTable%0A%20%0A%20%2F%2F%20A%202%20line%20microprogram%20that%20adds%20links%20to%20a%20piece%20of%20text%20and%20outputs%20html%0A%20Build%20something%20new%20to%20try%3F%20Email%20a%20title%20and%20link%20to%20one%20of%20our%20users.%0A%20%20link%20users.html%20users%0A%20%0A%20%2F%2F%20A%203%20line%20microprogram%20that%20adds%20links%20to%20a%20piece%20of%20text%20and%20outputs%20html%0A%20Download%20this%20data%20as%20JSON.%0A%20%20link%20tries.json%20JSON%0A%20%20https%3A%2F%2Fgithub.com%2Fbreck7%2Fnews.pub%2Fblob%2Fmain%2Ftries.scroll%20this%20data%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20includes%20the%20content%20of%20this%20html%20file%3A%0A%20modal.html%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20runs%20%22import%22%3A%0A%20footer.scroll%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20outputs%20an%20html%20div%20tag%0A%20%3C%2Fdiv%3E%0A%20%0A%20%2F%2F%20A%201%20line%20microprogram%20that%20outputs%20a%20javascript%20tag%0A%20tableSearch view and edit it with syntax highlighting
codeWithHeader 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
***
? redneckhatr asks "How does this work underhood? Is a microprogram an actual binary or something you load into a VM?"
https://www.reddit.com/r/programming/comments/1foeaef/comment/loyirs4/ redneckhatr asks
Great question!
That's up to the implementation. This is a design pattern that can be implemented in many ways. Even without a computer!
Requirements to implement this:
1. An environment
2. Microprogram parsers
3. Microprograms
Here's a video explanation:
youtube https://www.youtube.com/watch?v=e4mJh7TgICE
***
? loblawslawcah says "The post didn't really show or explain it all that well."
https://www.reddit.com/r/computerscience/comments/1foi2wr/comment/loqwx8v/ loblawslawcah says
Perhaps a video explanation would be better:
youtube https://www.youtube.com/watch?v=hCE_zcpNpnY
footer.scroll