-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ptcri.scroll
93 lines (61 loc) · 3.32 KB
/
ptcri.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
date 5/31/2024
openGraphImage ptcri.png
tags All Programming Scroll ScrollPapers
title PTCRI: An Equation about Syntax Potential
header.scroll
printTitle
HTML | TXT
class scrollDateline
style text-align: center;
ptcri.html HTML
link ptcri.txt TXT
printAuthors
mediumColumns 1
Yesterday, on a plane, I found an equation I sought for a decade.
dateline
br
center
katex
P = {T^{C^R}}^I
br
endSnippet
PTCRI describes the potential of a programming syntax.
PTCRI says the number of possible programs *P* is equal to the number of tokens *T* raised by the number of columns *C*, raised by the number of rows *R* (aka lines), raised by the number of indentation levels *I*.
If you view the source code of this post, you will see *T, C, R, and I* in action.
https://github.com/breck7/breckyunits.com/blob/main/ptcri.scroll source code
***
PTCRI explains the simplicity and power of Particles^treeNotationNameChange. Four concepts, three syntax rules support a vast universe of concise programs. Another syntax(es) might be found with superior metrics, but I have yet to see it.
https://scroll.pub Particles
PTCRI also explains why _nearly_ flat structures work so well: a little nesting goes a long way. If you set T and C and R to 3, changing I from 1 to 2 increases the amount of possible programs from 7,625,597,484,987 to 58,149,737,003,040,060,000,000,000.
// Math.pow(Math.pow(3, Math.pow(3, 3)), 1) vs:
// Math.pow(Math.pow(3, Math.pow(3, 3)), 2)
***
59 days ago I announced the decade long Particles research endeavor over with a negative result.
treeNotationFinalReport.html announced
It looks like I was wrong again. There was something special about Particles, and PTCRI explains what that is.
***
_It shouldn't be possible to represent all programs in all programming language with such a minimal set of rules! Particles doesn't even have parentheses!_
And yet, the experimental evidence kept piling up.
scrollsets.html experimental evidence
The evidence hinted at some important natural formula, and now we have a name for it: PTCRI.
****
# Notes
^treeNotationNameChange Particles was originally named Tree Notation.
***
Thank you to Marc Forward and Inconstant_Moo for feedback and helping me add the T.
https://www.youtube.com/@origineering Marc Forward
https://www.reddit.com/user/Inconstant_Moo/ Inconstant_Moo
***
It may help to explain from another angle. Imagine your boss comes up to you and says "We are giving you a special assignment. We want you to come up with the best possible syntax for all programming languages." What do you come up with?
You can present them with Particles, and explain how it supports a vast universe of programs, $P = {T^{C^R}}^I$, with just three syntax rules:
- lines split into columns via bits, characters or words
- groups of lines joined to each other via newlines
- scopes established via the indent trick (aka the "Offiside Rule", popularized by Python, HAML, et cetera)
***
- Does PTCRI also describe S-Expressions? S-Expression work. Particles _barely_ works.
- All mistakes are on me, and credit goes to the people who have supported this effort with me.
- I think this equation is pretty interesting, so I really hope a lot of people on the Internet tell me how stupid it is and that it was discovered 100 years ago.
- Now, back to my vacation.
# Related Posts
printRelated ScrollPapers
footer.scroll