-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
231 lines (228 loc) · 20.3 KB
/
Copy pathindex.html
File metadata and controls
231 lines (228 loc) · 20.3 KB
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html><html class="default" lang="en" data-base="./"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>iridium - v0.9a</title><meta name="description" content="Documentation for iridium"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><link rel="stylesheet" href="assets/custom.css"/><script defer src="assets/main.js"></script><script async src="assets/icons.js" id="tsd-icons-script"></script><script async src="assets/search.js" id="tsd-search-script"></script><script async src="assets/navigation.js" id="tsd-nav-script"></script><script async src="assets/hierarchy.js" id="tsd-hierarchy-script"></script><style>
@media (prefers-color-scheme: dark) {
:root {
--md-sys-color-primary: #f6be46;
--md-sys-color-on-primary: #412d00;
--md-sys-color-primary-container: #5d4200;
--md-sys-color-on-primary-container: #ffdea3;
--md-sys-color-secondary: #d9c4a0;
--md-sys-color-on-secondary: #3b2f15;
--md-sys-color-secondary-container: #53452a;
--md-sys-color-on-secondary-container: #f6e0bb;
--md-sys-color-tertiary: #b2cfa8;
--md-sys-color-on-tertiary: #1e361a;
--md-sys-color-tertiary-container: #344d2f;
--md-sys-color-on-tertiary-container: #cdebc2;
--md-sys-color-error: #ffb4ab;
--md-sys-color-on-error: #690005;
--md-sys-color-error-container: #93000a;
--md-sys-color-on-error-container: #ffb4ab;
--md-sys-color-background: #1e1b16;
--md-sys-color-on-background: #e9e1d9;
--md-sys-color-surface: #1e1b16;
--md-sys-color-on-surface: #e9e1d9;
--md-sys-color-surface-variant: #4e4639;
--md-sys-color-on-surface-variant: #d1c5b4;
--md-sys-color-outline: #9a8f80;
--md-sys-color-outline-variant: #4e4639;
--md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #e9e1d9;
--md-sys-color-inverse-on-surface: #34302a;
--md-sys-color-inverse-primary: #7a5900;
--md-sys-color-surface-dim: #16130e;
--md-sys-color-surface-bright: #3d3933;
--md-sys-color-surface-container-lowest: #110e09;
--md-sys-color-surface-container-low: #1e1b16;
--md-sys-color-surface-container: #221f1a;
--md-sys-color-surface-container-high: #2d2924;
--md-sys-color-surface-container-highest: #38342e
}
}
:root[data-theme="dark"] {
--md-sys-color-primary: #f6be46;
--md-sys-color-on-primary: #412d00;
--md-sys-color-primary-container: #5d4200;
--md-sys-color-on-primary-container: #ffdea3;
--md-sys-color-secondary: #d9c4a0;
--md-sys-color-on-secondary: #3b2f15;
--md-sys-color-secondary-container: #53452a;
--md-sys-color-on-secondary-container: #f6e0bb;
--md-sys-color-tertiary: #b2cfa8;
--md-sys-color-on-tertiary: #1e361a;
--md-sys-color-tertiary-container: #344d2f;
--md-sys-color-on-tertiary-container: #cdebc2;
--md-sys-color-error: #ffb4ab;
--md-sys-color-on-error: #690005;
--md-sys-color-error-container: #93000a;
--md-sys-color-on-error-container: #ffb4ab;
--md-sys-color-background: #1e1b16;
--md-sys-color-on-background: #e9e1d9;
--md-sys-color-surface: #1e1b16;
--md-sys-color-on-surface: #e9e1d9;
--md-sys-color-surface-variant: #4e4639;
--md-sys-color-on-surface-variant: #d1c5b4;
--md-sys-color-outline: #9a8f80;
--md-sys-color-outline-variant: #4e4639;
--md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #e9e1d9;
--md-sys-color-inverse-on-surface: #34302a;
--md-sys-color-inverse-primary: #7a5900;
--md-sys-color-surface-dim: #16130e;
--md-sys-color-surface-bright: #3d3933;
--md-sys-color-surface-container-lowest: #110e09;
--md-sys-color-surface-container-low: #1e1b16;
--md-sys-color-surface-container: #221f1a;
--md-sys-color-surface-container-high: #2d2924;
--md-sys-color-surface-container-highest: #38342e
}
@media (prefers-color-scheme: light) {
:root {
--md-sys-color-primary: #7a5900;
--md-sys-color-on-primary: #ffffff;
--md-sys-color-primary-container: #ffdea3;
--md-sys-color-on-primary-container: #261900;
--md-sys-color-secondary: #6c5c3f;
--md-sys-color-on-secondary: #ffffff;
--md-sys-color-secondary-container: #f6e0bb;
--md-sys-color-on-secondary-container: #251a04;
--md-sys-color-tertiary: #4b6545;
--md-sys-color-on-tertiary: #ffffff;
--md-sys-color-tertiary-container: #cdebc2;
--md-sys-color-on-tertiary-container: #092007;
--md-sys-color-error: #ba1a1a;
--md-sys-color-on-error: #ffffff;
--md-sys-color-error-container: #ffdad6;
--md-sys-color-on-error-container: #410002;
--md-sys-color-background: #fffbff;
--md-sys-color-on-background: #1e1b16;
--md-sys-color-surface: #fffbff;
--md-sys-color-on-surface: #1e1b16;
--md-sys-color-surface-variant: #ede1cf;
--md-sys-color-on-surface-variant: #4e4639;
--md-sys-color-outline: #7f7667;
--md-sys-color-outline-variant: #d1c5b4;
--md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #34302a;
--md-sys-color-inverse-on-surface: #f8efe7;
--md-sys-color-inverse-primary: #f6be46;
--md-sys-color-surface-dim: #e1d9d0;
--md-sys-color-surface-bright: #fff8f2;
--md-sys-color-surface-container-lowest: #ffffff;
--md-sys-color-surface-container-low: #fbf2e9;
--md-sys-color-surface-container: #f5ede4;
--md-sys-color-surface-container-high: #efe7de;
--md-sys-color-surface-container-highest: #e9e1d9
}
}
:root[data-theme="light"] {
--md-sys-color-primary: #7a5900;
--md-sys-color-on-primary: #ffffff;
--md-sys-color-primary-container: #ffdea3;
--md-sys-color-on-primary-container: #261900;
--md-sys-color-secondary: #6c5c3f;
--md-sys-color-on-secondary: #ffffff;
--md-sys-color-secondary-container: #f6e0bb;
--md-sys-color-on-secondary-container: #251a04;
--md-sys-color-tertiary: #4b6545;
--md-sys-color-on-tertiary: #ffffff;
--md-sys-color-tertiary-container: #cdebc2;
--md-sys-color-on-tertiary-container: #092007;
--md-sys-color-error: #ba1a1a;
--md-sys-color-on-error: #ffffff;
--md-sys-color-error-container: #ffdad6;
--md-sys-color-on-error-container: #410002;
--md-sys-color-background: #fffbff;
--md-sys-color-on-background: #1e1b16;
--md-sys-color-surface: #fffbff;
--md-sys-color-on-surface: #1e1b16;
--md-sys-color-surface-variant: #ede1cf;
--md-sys-color-on-surface-variant: #4e4639;
--md-sys-color-outline: #7f7667;
--md-sys-color-outline-variant: #d1c5b4;
--md-sys-color-shadow: #000000;
--md-sys-color-scrim: #000000;
--md-sys-color-inverse-surface: #34302a;
--md-sys-color-inverse-on-surface: #f8efe7;
--md-sys-color-inverse-primary: #f6be46;
--md-sys-color-surface-dim: #e1d9d0;
--md-sys-color-surface-bright: #fff8f2;
--md-sys-color-surface-container-lowest: #ffffff;
--md-sys-color-surface-container-low: #fbf2e9;
--md-sys-color-surface-container: #f5ede4;
--md-sys-color-surface-container-high: #efe7de;
--md-sys-color-surface-container-highest: #e9e1d9
}
</style><link rel="stylesheet" href="assets/material-style.css"/></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="index.html" class="title">iridium - v0.9a</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><h1>iridium - v0.9a</h1></div><div class="tsd-panel tsd-typography"><pre><code><span class="hl-0">██╗██████╗ ██╗██████╗ ██╗██╗ ██╗███╗ ███╗</span><br/><span class="hl-0">██║██╔══██╗██║██╔══██╗██║██║ ██║████╗ ████║</span><br/><span class="hl-0">██║██████╔╝██║██║ ██║██║██║ ██║██╔████╔██║</span><br/><span class="hl-0">██║██╔══██╗██║██║ ██║██║██║ ██║██║╚██╔╝██║</span><br/><span class="hl-0">██║██║ ██║██║██████╔╝██║╚██████╔╝██║ ╚═╝ ██║</span><br/><span class="hl-0">╚═╝╚═╝ ╚═╝╚═╝╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝</span>
</code><button>Copy</button></pre>
<h1 id="iridium-intermediate-representation-ir" class="tsd-anchor-link">Iridium Intermediate Representation (IR)<a href="#iridium-intermediate-representation-ir" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1><p><strong>Iridium IR</strong> is the core intermediate representation used by the <strong>Iridium Static Analysis Framework</strong> for analyzing and optimizing dynamic language systems like JavaScript.</p>
<p>The IR is designed as a <strong>dynamic, closure-oriented language</strong> with first-class support for <strong>asynchronous control flow</strong>. It provides a core calculus that dynamic languages such as JavaScript can extend to encode their semantics.</p>
<p>Iridium desugars source programs into <strong>primitive operations</strong>, constructs <strong>logical stack frames</strong>, and serializes these into a <strong>Lisp-like language</strong> for further analysis and code generation.</p>
<p>This documentation outlines the major components of the Iridium IR and their respective roles in static analysis and transformation pipelines.</p>
<hr>
<h2 id="node-classifications" class="tsd-anchor-link">Node Classifications<a href="#node-classifications" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Iridium IR nodes are grouped into the following categories:</p>
<hr>
<h3 id="1-abstract-operations" class="tsd-anchor-link">1. Abstract Operations<a href="#1-abstract-operations" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Transitional nodes that require further resolution before becoming concrete. These are used to defer decisions such as binding resolution or control structure interpretation.</p>
<p>For Example,</p>
<ul>
<li>Before <strong>scope resolution</strong>, IR nodes may contain symbolic references to variables whose exact location (stack vs global) is unknown.</li>
<li>These unresolved references are represented by transitional nodes.</li>
<li>After resolution, these nodes are rewritten to concrete stack or environment accesses via the <code>Bindings</code> object, which models logical stack frames.</li>
</ul>
<hr>
<h3 id="2-calls" class="tsd-anchor-link">2. Calls<a href="#2-calls" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Nodes that represent potential invocation sites, including both user-visible and internal calls.</p>
<ul>
<li><strong>Generic Calls</strong>: Represent calls to user-defined or external functions under various calling conventions.</li>
<li><strong>VSysCalls</strong> (Virtual System Calls): Represent calls to internal VM-level abstract operations. These are not exposed to the user and serve as desugared forms of complex language constructs.</li>
</ul>
<hr>
<h3 id="3-environment" class="tsd-anchor-link">3. Environment<a href="#3-environment" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Nodes that represent and manipulate the <strong>closure environment</strong> in which operations execute.</p>
<ul>
<li>The <code>Bindings</code> object models a <strong>logical stack frame</strong>, storing local bindings and tracking captured variables (external environment references).</li>
<li>Includes operations to declare, assign, or read values from the environment.</li>
<li>Contains both <strong>primitive</strong> and <strong>non-primitive</strong> nodes for interacting with the runtime scope explicitly.</li>
</ul>
<hr>
<h3 id="4-flow" class="tsd-anchor-link">4. Flow<a href="#4-flow" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Nodes that control the <strong>execution order</strong> of a program, including both synchronous and asynchronous patterns.</p>
<ul>
<li><strong>Synchronous Flow Nodes</strong>: Represent standard control flow structures such as conditionals, loops, and early exits (<code>return</code>, <code>break</code>, etc.).</li>
<li><strong>Asynchronous Flow Nodes</strong>: Capture constructs like <code>await</code>, promises, and VM-level event handling.</li>
</ul>
<hr>
<h3 id="5-rval-right-hand-values" class="tsd-anchor-link">5. RVal (Right-hand Values)<a href="#5-rval-right-hand-values" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>Nodes that evaluate to values and are only permitted on the <strong>right-hand side</strong> of assignments.</p>
<ul>
<li>Represent primitive language values (e.g., literals, identifiers) and language-specific operations that produce a value without modifying state.</li>
</ul>
<hr>
<h3 id="6-structural" class="tsd-anchor-link">6. Structural<a href="#6-structural" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3><p>High-level structural components that define the organization of an Iridium program.</p>
<ul>
<li><strong>Compilation Units</strong>: The top-level entry points to IR programs.</li>
<li><strong>TopLevelContainers</strong>: Contain module-level declarations and metadata (e.g., imports and exports).</li>
<li><strong>Basic Blocks</strong>: Represent linear sequences of instructions for control-flow and data-flow analysis.</li>
<li>The structural nodes also capture JS module semantics, enabling potential <strong>inter-modular analysis</strong> in the future.</li>
</ul>
<hr>
<h2 id="additional-notes" class="tsd-anchor-link">Additional Notes<a href="#additional-notes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2><ul>
<li>Iridium is designed to enable <strong>precise static analysis</strong>, <strong>novel program transformations</strong>, and <strong>IR-level optimizations</strong>.</li>
<li>Its Lisp-like serialization makes it amenable to both <strong>automated reasoning</strong> and <strong>visual inspection</strong>.</li>
<li>The IR is both a <strong>compilation target</strong> and an <strong>analysis substrate</strong>, supporting end-to-end workflows from JavaScript source to transformed/optimized output.</li>
</ul>
<hr>
<p>I write the documentation quickly and have GPT beautify it, sorry if this displeases some readers 🙏</p>
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="assets/icons.svg#icon-chevronDown"></use></svg><h3>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#iridium-intermediate-representation-ir"><span>Iridium <wbr/>Intermediate <wbr/>Representation (<wbr/>IR)</span></a><ul><li><a href="#node-classifications"><span>Node <wbr/>Classifications</span></a></li><li><ul><li><a href="#1-abstract-operations"><span>1. <wbr/>Abstract <wbr/>Operations</span></a></li><li><a href="#2-calls"><span>2. <wbr/>Calls</span></a></li><li><a href="#3-environment"><span>3. <wbr/>Environment</span></a></li><li><a href="#4-flow"><span>4. <wbr/>Flow</span></a></li><li><a href="#5-rval-right-hand-values"><span>5. <wbr/>R<wbr/>Val (<wbr/>Right-<wbr/>hand <wbr/>Values)</span></a></li><li><a href="#6-structural"><span>6. <wbr/>Structural</span></a></li></ul></li><li><a href="#additional-notes"><span>Additional <wbr/>Notes</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="modules.html">iridium - v0.9a</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div><script>
try {
const generateLinkElement = document.querySelector(".tsd-generator a");
const link = document.createElement("a");
Object.assign(link, {
href: "https://github.com/dmnsgn/typedoc-material-theme",
target: "_blank",
rel: "noreferrer",
innerText: "typedoc-material-theme."
});
generateLinkElement.insertAdjacentElement("afterend", link);
generateLinkElement.insertAdjacentText("afterend", " with ");
} catch (error) {
}
</script></body></html>