Repository navigation
Expand file tree
/
Copy pathexamples.html
More file actions
118 lines (111 loc) · 6.35 KB
/
Copy pathexamples.html
File metadata and controls
118 lines (111 loc) · 6.35 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
<!doctype html>
<html lang="en"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Examples</title>
<meta name="description" content="44 whole programs, each running identically on three engines.">
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<link rel="preload" href="vendor/fonts/figtree.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="vendor/fonts/sora.woff2" as="font" type="font/woff2" crossorigin>
<link rel="stylesheet" href="style.css">
<script src="vendor/motion.js" defer></script>
<script src="vendor/lottie.js" defer></script>
<script type="module" src="app.js"></script>
</head><body data-page="examples">
<header class="topbar">
<a class="brand" href="index.html"><svg viewBox="0 0 48 48" width="20" height="20" fill="none" stroke="currentColor" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6H39"/><path d="M24 14A13 13 0 1 0 37 27H26"/></svg><span>Grasm</span></a>
<span class="ver">v1.0.0</span>
<nav>
<a href="different.html">Why Grasm</a>
<a href="start.html">Docs</a>
<a href="security.html">Security</a>
<a href="achieved.html">Scorecard</a>
<a href="playground.html">Playground</a>
</nav>
<a class="cta" href="start.html">Get started</a>
</header>
<div class="frame">
<nav class="rail">
<a class="mark" href="index.html"><svg viewBox="0 0 48 48" width="18" height="18" fill="none" stroke="currentColor" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6H39"/><path d="M24 14A13 13 0 1 0 37 27H26"/></svg><b>grasm</b><span>a systems language</span></a>
<h2>Start</h2>
<a href="different.html">Why Grasm</a>
<a href="start.html">Getting started</a>
<a href="install.html">Install</a>
<a href="playground.html">Playground</a>
<h2>Learn</h2>
<a href="tutorial.html">Tutorial</a>
<a href="tour.html">Tour</a>
<a href="effects.html">Effects</a>
<a href="tiers.html">Ownership</a>
<a href="errors.html">Errors</a>
<a href="concurrency.html">Concurrency</a>
<a href="security.html">Security</a>
<h2>Reference</h2>
<a href="syntax.html">Syntax</a>
<a href="language.html">Language</a>
<a href="library.html">Library</a>
<a href="packages.html">Packages</a>
<a href="spec.html">Specification</a>
<a href="architecture.html">Architecture</a>
<h2>More</h2>
<a href="examples.html" aria-current="page">Examples</a>
<a href="achieved.html">Scorecard</a>
<a href="performance.html">Performance</a>
<a href="about.html">About</a>
<a href="status.html">Status</a>
<a href="roadmap.html">Roadmap</a>
</nav>
<main>
<p class="eyebrow">More</p>
<h1>Examples</h1>
<p class="lede">Not snippets. 44 whole programs, 15,536 lines, each one
checked on three engines for identical output, exit code and diagnostics.</p>
<h2>Systems</h2>
<div class="grid three">
<div class="cell"><h4>HTTP server</h4><p>377 lines. Sockets, routing, request parsing.</p></div>
<div class="cell"><h4>SQL engine</h4><p>583 lines. Parser, planner, execution.</p></div>
<div class="cell"><h4>Micro VM</h4><p>A bytecode machine.</p></div>
<div class="cell"><h4>Garbage collector</h4><p>Written in a language with no garbage collector.</p></div>
<div class="cell"><h4>DNS resolver</h4><p>Wire format, UDP.</p></div>
<div class="cell"><h4>Turing machine</h4><p>Because the tests needed one.</p></div>
</div>
<h2>Tools and formats</h2>
<div class="grid three">
<div class="cell"><h4>JSON parser</h4><p>375 lines, and a package.</p></div>
<div class="cell"><h4>Markdown to HTML</h4><p>A package too.</p></div>
<div class="cell"><h4>SHA-256</h4><p>Bit operations, byte handling.</p></div>
<div class="cell"><h4>grep</h4><p>Files, patterns, streams.</p></div>
<div class="cell"><h4>Self-hosting lexer</h4><p>Grasm, lexing Grasm.</p></div>
<div class="cell"><h4>Expression REPL</h4><p>Parse, evaluate, loop.</p></div>
</div>
<h2>Concurrent</h2>
<div class="grid three">
<div class="cell"><h4>Multithreaded scraper</h4><p>Parallel fetches, joined.</p></div>
<div class="cell"><h4>Async chat</h4><p>Many connections, one process.</p></div>
<div class="cell"><h4>Sorting benchmark</h4><p>Where the performance numbers come from.</p></div>
</div>
<h2>In a browser</h2>
<p>10 programs compiled to wasm and run in a tab with no server: a fullstack counter, user registration, a voting app, a blog dashboard, a markdown editor, an upload gallery, a chat router, a collaborative todo list, a SPA router and realtime analytics. Both the count and the list come from the tree — a program runs in a tab when there is a page beside it — because this sentence said <em>twelve</em> while naming three that have none.</p>
<p>All of them live under <code>ProjectGold/</code> in the repository, with the
expected output recorded beside each.</p>
</main>
</div>
<footer class="sitefoot">
<div class="inner">
<div class="cols">
<div class="brandcol">
<a class="brand" href="index.html"><svg viewBox="0 0 48 48" width="20" height="20" fill="none" stroke="currentColor" stroke-width="6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6H39"/><path d="M24 14A13 13 0 1 0 37 27H26"/></svg><span>Grasm</span></a>
<span>Four engines, one answer.</span>
</div>
<div class="links">
<div><span>Start</span><a href="different.html">Why Grasm</a><a href="start.html">Getting started</a><a href="install.html">Install</a><a href="playground.html">Playground</a></div>
<div><span>Learn</span><a href="tutorial.html">Tutorial</a><a href="tour.html">Tour</a><a href="effects.html">Effects</a><a href="tiers.html">Ownership</a><a href="errors.html">Errors</a><a href="concurrency.html">Concurrency</a><a href="security.html">Security</a></div>
<div><span>Reference</span><a href="syntax.html">Syntax</a><a href="language.html">Language</a><a href="library.html">Library</a><a href="packages.html">Packages</a><a href="spec.html">Specification</a><a href="architecture.html">Architecture</a></div>
<div><span>More</span><a href="examples.html">Examples</a><a href="achieved.html">Scorecard</a><a href="performance.html">Performance</a><a href="about.html">About</a><a href="status.html">Status</a><a href="roadmap.html">Roadmap</a></div>
</div>
</div>
<p>Counts here are computed from the repository as the page is written;
measurements are read from the document that recorded them.</p>
</div>
</footer>
</body></html>