-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
759 lines (611 loc) · 40.1 KB
/
index.html
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Informal - Next Gen Programming">
<title>Informal</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:wght@500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans&display=swap" rel="stylesheet">
<link href="static/css/base.min.css?v=1" rel="stylesheet">
</head>
<body class="leading-tight">
<!--
Hello, curious hackers!
If you're reading this, I assume you want to know more about how this website is built.
It's mostly handwritten HTML with no JS frameworks. The CSS is built on top of tailwind utility classes.
Fonts are Libre Franklin for that clean, modern sans look and IBM Plex Sans for a bit of retro flair.
-->
<header>
<nav role="navigation" class="flex bg-white items-center flex-wrap py-6 px-8 justify-between">
<div class="w-full max-w-6xl relative mx-auto">
<div class="logo md:px-16">
<img class="block h-12" src="static/images/informal_logo.png" alt="Informal logo" />
</div>
</div>
</nav>
</header>
<section class="max-w-6xl relative mx-auto px-8 md:px-16 py-16 md:py-32 md:pb-24">
<div class="inline-block pt-8 pb-16">
<h1 class="headline inline-block max-w-3xl font-heading font-bold pb-6 fg-red">
A fluid programming language for rapid development.
</h1>
<br>
<h2 class="text-xl md:text-2xl lg:text-3xl max-w-xl inline-block font-body">
Informal is a new kind of form based visual programming language for web applications and data science.
</h2>
</div>
<div>
<a class="btn btn-secondary" href="https://github.com/Feni/informal/blob/main/Documentation/Guide/tutorial.md" target="_blank">
Learn More
</a>
<a class="btn btn-primary" href="https://github.com/Feni/informal" target="_blank">
Get Started
</a>
</div>
</section>
<!--
The symbols here are a reference to the curry-howard-lambek correspondence.
-->
<section class="max-w-6xl relative mx-auto px-8 md:px-16 py-8 md:py-16 bg-fade-in">
<section class="grid grid-cols-1 md:grid-cols-3 gap-4 showcase">
<div class="bg-gray-900 shadow-lg rounded p-3">
<div class="group relative fg-white float-right">
<h1 class="text-5xl font-body">⊢</h1>
</div>
<div class="p-5">
<h3 class="text-white text-lg">Simple</h3>
<p class="text-gray-400">
Adapt to your problem domain with declarative patterns that express logic, functions and objects.
</p>
</div>
</div>
<div class="bg-gray-900 shadow-lg rounded p-3">
<div class="group relative fg-white float-right">
<h1 class="text-5xl font-body">Δ</h1>
</div>
<div class="p-5">
<h3 class="text-white text-lg">Flexible</h3>
<p class="text-gray-400">
Interactively develop in the browser and compile to efficient, safe WASM you can run anywhere.
</p>
</div>
</div>
<div class="bg-gray-900 shadow-lg rounded p-3">
<div class="group relative fg-white float-right">
<h1 class="text-5xl font-body">λ</h1>
</div>
<div class="p-5">
<h3 class="text-white text-lg">
Safe
</h3>
<p class="text-gray-400">
Prototype quickly and gradually add expressive type constraints as your codebase evolves.
</p>
</div>
</div>
</section>
</section>
<section class="max-w-6xl relative mx-auto px-16 py-16 bg-yellow">
<b>Free-form</b>
<h2 class="text-4xl font-heading font-bold">
Create it any way you choose.
</h2>
<p class="text-lg max-w-xl">
Visual or textual. Functional or object oriented. Fully dynamic or type checked.
Informal is distilled from concepts proven in languages like Python, Haskell, Smalltalk, Prolog, Elixir, APL and
Clojure.
Choose the style that's right for your project, so you can focus on the problems that really matter.
</p>
</section>
<!--
JS-free radio-button based tabs.
Code-sections were written in a highlighter, and extracted as
HTML so we don't need to ship a whole editor for the landing page.
-->
<div class="bg-yellow-white-radial">
<!--
Image credit: https://en.wikipedia.org/wiki/File:Rieger-Nishimura.svg
CC-3.0. Original by EmilJ.
-->
<div class="img-rieger py-32 pb-32 ">
<section class="tabs bg-purple shadow-lg md:rounded-r fg-white max-w-6xl">
<input type="radio" id="tab-1" name="tab-group-1" checked>
<input type="radio" id="tab-2" name="tab-group-1">
<input type="radio" id="tab-3" name="tab-group-1">
<div class="tab-navs bg-gradient-to-bl from-purple-900 via-pink-800 to-red-500">
<label onclick="selectTab(this);" class="tab-nav active" for="tab-1">
An instant connection.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-2">
Just say what you need.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-3">
It's patterns all the way down.
</label>
</div>
<div id="content-1" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Experience live coding that instantly reacts to your changes</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span class="cm-def font-bold text-xl">greeting </span><span role="presentation"></span> </pre>
<div class="grid grid-cols-6">
<div class="Signature col-span-1 flex">
<span class="cm-variable">locale</span><br>
<span class="text-gray-500 float-right" style="display: flex; align-items: flex-end;">String</span>
</div>
<div class="Body col-span-4">
<table class="greeting-table">
<thead>
<tr>
<th></th>
<th>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">isMorning</span>(<span class="cm-variable">now</span>())</span></pre>
</td>
</th>
<!-- <th><pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span class="cm-variable">isEvening</span>(<span class="cm-variable">now</span>())</span></pre></th> -->
<th>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">else</span></span></pre>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">locale</span> <span class="cm-operator">==</span> <span class="cm-string">"en-US"</span></span></pre>
<td>
<pre class=" CodeMirror-line "><span><span class="cm-string">"Good Morning!"</span></span></pre>
</td>
<td>
<pre class=" CodeMirror-line "><span><span class="cm-string">"Hello!"</span></span></pre>
</td>
</tr>
<tr>
<td>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">locale</span> <span class="cm-operator">==</span> <span class="cm-string">"ml-IN"</span></span></pre>
</td>
<td>
<pre class=" CodeMirror-line "><span><span class="cm-string">"സുപ്രഭാതം"</span></span></pre>
</td>
<td>
<pre class=" CodeMirror-line "><span><span class="cm-string">"നമസ്കാരം"</span></span></pre>
</td>
</tr>
<!-- <tr>
<td></td>
<td>
</td>
<td>
</td>
</tr> -->
</tbody>
</table>
</div>
</div>
</div>
<div id="content-2" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div class="CodeMirror-code" role="presentation" style="">
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Declaratively order exactly $15.05 worth of appetizers</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">appetizers</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"Mixed Fruit"</span>: <span class="cm-number">2.15</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"French Fries"</span>: <span class="cm-number">2.75</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"Side Salad"</span>: <span class="cm-number">3.35</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"Hot Wings"</span>: <span class="cm-number">3.55</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"Mozarella Sticks"</span>: <span class="cm-number">4.20</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"Sampler Plate"</span>: <span class="cm-number">5.80</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">Order</span>: <span class="cm-variable">String</span> <span class="cm-keyword">in</span> <span class="cm-variable">appetizers</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">total</span>(<span class="cm-variable">orders</span>: [<span class="cm-variable">Order</span>, <span class="cm-number">1</span>..<span class="cm-number">8</span>]): <span class="cm-variable">sum</span>(<span class="cm-variable">appetizers</span>[<span class="cm-variable">order</span>.<span class="cm-variable">item</span>])</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// We'd like exactly $15.05 worth of appetizers please...</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">print</span> <span class="cm-variable">order</span> <span class="cm-keyword">where</span> <span class="cm-variable">total</span>(<span class="cm-variable">order</span>) <span class="cm-operator">==</span> <span class="cm-number">15.05</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// In fact, give me all of those orders</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">for</span> <span class="cm-variable">order</span> <span class="cm-keyword">in</span> <span class="cm-variable">orders</span> <span class="cm-keyword">where</span> <span class="cm-variable">total</span>(<span class="cm-variable">orders</span>) <span class="cm-operator">==</span> <span class="cm-number">15.05</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">print</span> <span class="cm-variable">order</span></span></pre>
</div>
</div>
<div id="content-3" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div class="CodeMirror-code" role="presentation" style="">
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Define the pattern for a valid Date</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">daysPerMonth</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"January"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"February"</span>: <span class="cm-number">28</span> | <span class="cm-number">29</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"March"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"April"</span>: <span class="cm-number">30</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"May"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"June"</span>: <span class="cm-number">30</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"July"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"August"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"September"</span>: <span class="cm-number">30</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"October"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"November"</span>: <span class="cm-number">30</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"December"</span>: <span class="cm-number">31</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">type</span> <span class="cm-def">Year</span>: <span class="cm-variable">Integer</span> <span class="cm-keyword">in</span> [<span class="cm-number">1901</span>..<span class="cm-number">2038</span>]</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">isLeapYear</span>(<span class="cm-variable">year</span>: <span class="cm-variable">Year</span>): <span class="cm-variable">year</span> % <span class="cm-number">4</span> <span class="cm-operator">==</span> <span class="cm-number">0</span> </span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Functions can match on patterns</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">dateRange</span>(<span class="cm-string">"February"</span>, <span class="cm-variable">year</span>: <span class="cm-variable">isLeapYear</span>): <span class="cm-number">29</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">dateRange</span>(<span class="cm-string">"February"</span>, <span class="cm-variable">year</span>): <span class="cm-number">28</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">dateRange</span>(<span class="cm-variable">month</span>, <span class="cm-variable">_</span>): <span class="cm-variable">daysPerMonth</span>[<span class="cm-variable">month</span>]</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Types define the pattern for structure</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">type</span> <span class="cm-def">Date</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">year</span>: <span class="cm-variable">Year</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">month</span>: <span class="cm-variable">String</span> <span class="cm-keyword">in</span> <span class="cm-variable">daysPerMonth</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">day</span>: <span class="cm-variable">Integer</span> <span class="cm-keyword">in</span> [<span class="cm-number">1</span>..<span class="cm-variable">dateRange</span>(<span class="cm-variable">month</span>, <span class="cm-variable">year</span>)]</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
</div>
</div>
</section>
</div>
</div>
<div class="max-w-6xl mx-auto md:grid grid-cols-2 md:grid-cols-3 gap-4 relative">
<canvas class="mx-auto" id="lorenz" width="1200" height="800"></canvas>
<section class="col-span-2 mx-auto px-16 py-16 evolution-content">
<b>Transform</b>
<h2 class="text-4xl font-heading font-bold fg-purple">Designed to evolve with you.</h2>
<p class="text-lg">
From prototype to production, Informal adapts to the ever-changing requirements of a growing project.
Add contractual guarantees to your program with gradual types, isolate complex functionality with independent
modules or even transform the language itself with macros.
</p>
</section>
</div>
<div class="py-16">
<div class="shadow-lg md:rounded-l max-w-6xl margin-left">
<section class="tabs bg-yellow">
<input type="radio" id="tab-4" name="tab-group-2" checked>
<input type="radio" id="tab-5" name="tab-group-2">
<input type="radio" id="tab-6" name="tab-group-2">
<div class="tab-navs bg-gradient-to-br from-red-300 via-orange-200 to-yellow-200 ">
<label onclick="selectTab(this);" class="tab-nav active" for="tab-4">
Quick prototype to production ready.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-5">
Scale across the cores. Seamlessly.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-6">
Extensible at every layer by anybody.
</label>
</div>
<div id="content-4" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div>
<div class="CodeMirror-code" role="presentation" style="">
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">simpleDifference</span>(<span class="cm-variable">start</span>, <span class="cm-variable">end</span>): <span class="cm-variable">end</span> <span class="cm-operator">-</span> <span class="cm-variable">start</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// The return type can be inferred</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">typedDifference</span>(<span class="cm-variable">start</span>: <span class="cm-variable">Integer</span>, <span class="cm-variable">end</span>: <span class="cm-variable">Integer</span>): <span class="cm-variable">end</span> <span class="cm-operator">-</span> <span class="cm-variable">start</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Enforce constraints with types</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">fn</span> <span class="cm-def">safeDifference</span>(<span class="cm-variable">start</span>: <span class="cm-variable">Positive</span> <span class="cm-variable">Integer</span>, <span class="cm-variable">end</span>: <span class="cm-variable">Integer</span> <span class="cm-variable">and</span> <span class="cm-variable">start</span> <span class="cm-operator"><</span> <span class="cm-variable">end</span>) <span class="cm-variable">Positive</span> <span class="cm-variable">Integer</span> : </span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">end</span> <span class="cm-operator">-</span> <span class="cm-variable">start</span></span></pre>
</div>
</div>
</div>
<div id="content-5" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div class="CodeMirror-code" role="presentation" style="">
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// A concurrent file line counter by file type</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">class</span> <span class="cm-variable">LineCounter</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">LineCounter</span>(<span class="cm-variable">counter</span><span class="cm-operator">=</span><span class="cm-number">0</span>)</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-keyword">fn</span> <span class="cm-def">process</span>(<span class="cm-variable">contents</span>: <span class="cm-variable">String</span>):</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-variable">counter</span> <span class="cm-operator">+=</span> <span class="cm-variable">contents</span>.<span class="cm-variable">lines</span>().<span class="cm-variable">length</span>()</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-keyword">fn</span> <span class="cm-def">report</span>(<span class="cm-variable">fileType</span>: <span class="cm-variable">String</span>): <span class="cm-variable">print</span> <span class="cm-string">"$fileType : $count"</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-keyword">fn</span> <span class="cm-def">report</span>(<span class="cm-variable">default</span>): <span class="cm-variable">print</span> <span class="cm-string">"Other : $count"</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">counters</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"html"</span>: <span class="cm-variable">new</span> <span class="cm-variable">LineCounter</span>()</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-string">"js"</span>: <span class="cm-variable">new</span> <span class="cm-variable">LineCounter</span>()</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">default</span>: <span class="cm-variable">new</span> <span class="cm-variable">LineCounter</span>()</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">for</span> <span class="cm-variable">file</span> <span class="cm-keyword">in</span> <span class="cm-variable">Directory</span>(<span class="cm-string">"."</span>):</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">_</span>, <span class="cm-variable">filetype</span> <span class="cm-operator">=</span> <span class="cm-variable">file</span>.<span class="cm-variable">extension</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-comment">// Send a concurrent message (<-) to process the file.</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">counters</span>[<span class="cm-variable">filetype</span>]<span class="cm-operator"><-</span><span class="cm-variable">process</span>(<span class="cm-variable">file</span>.<span class="cm-variable">read</span>())</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">for</span> <span class="cm-variable">fileType</span>, <span class="cm-variable">counter</span> <span class="cm-keyword">in</span> <span class="cm-variable">counters</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">counter</span><span class="cm-operator"><-</span><span class="cm-variable">report</span>(<span class="cm-variable">fileType</span>)</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
</div>
</div>
<div id="content-6" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div class="CodeMirror-code" role="presentation" style="">
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// From syntax, to compiler, to the editor...</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-comment">// Every layer of the language is extensible.</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-keyword">class</span> <span class="cm-def">Article</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-variable">Article</span>(<span class="cm-variable">title</span>: <span class="cm-variable">String</span>, <span class="cm-variable">author</span>: <span class="cm-variable">String</span>)</span></pre>
<pre class=" CodeMirror-line " role="presentation"><span role="presentation"> </span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-keyword">fn</span> <span class="cm-def">render</span>():</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-comment">// An embedded HTML syntax block.</span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-keyword">#html</span>:</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">div</span><span class="cm-tag cm-bracket">></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-tag cm-bracket"><</span><span class="cm-tag">h1</span><span class="cm-tag cm-bracket">></span>${ <span class="cm-variable">title</span> }<span class="cm-tag cm-bracket"></</span><span class="cm-tag">h1</span><span class="cm-tag cm-bracket">></span> by <span class="cm-tag cm-bracket"><</span><span class="cm-tag">p</span><span class="cm-tag cm-bracket">></span>${ <span class="cm-variable">author</span> }<span class="cm-tag cm-bracket"></</span><span class="cm-tag">p</span><span class="cm-tag cm-bracket">></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"> <span class="cm-tag cm-bracket"></</span><span class="cm-tag">div</span><span class="cm-tag cm-bracket">></span></span></pre>
<pre class=" CodeMirror-line " role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">a</span> <span class="cm-operator">=</span> <span class="cm-variable">Article</span>(<span class="cm-variable">title</span><span class="cm-operator">=</span><span class="cm-string">"On <blink>Escaping</blink>"</span>, <span class="cm-variable">author</span><span class="cm-operator">=</span><span class="cm-string">"R Morris"</span>)</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span class="cm-variable">print</span> <span class="cm-variable">a</span>.<span class="cm-property">render</span>()</span></pre>
<pre class=" CodeMirror-line "
role="presentation"><span role="presentation"><span cm-text=""></span></span></pre>
</div>
</div>
</section>
</div>
</div>
<div class="bg-fade-out">
<section class="max-w-4xl relative mx-auto px-16 pt-16 pb-32 ">
<b>Platform</b>
<h2 class="text-4xl font-heading font-bold fg-red">
Let's build it together.
</h2>
<p class="text-lg">
Software development is a collaborative process.
Informal gives you the tools to create great software together across the internet.
</p>
</section>
<div class="max-w-4xl mx-auto rounded-lg shadow-lg">
<section class="tabs bg-white">
<input type="radio" id="tab-7" name="tab-group-3" checked>
<input type="radio" id="tab-8" name="tab-group-3">
<input type="radio" id="tab-9" name="tab-group-3">
<div class="tab-navs bg-gradient-to-bl from-gray-100 to-white">
<label onclick="selectTab(this);" class="tab-nav active" for="tab-7">
Now we're coding.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-8">
Libraries without the nightmares.
</label>
<label onclick="selectTab(this);" class="tab-nav" for="tab-9">
Integrate with anything.
</label>
</div>
<div id="content-7" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<br>
<div>Code in the browser in a real-time, responsive environment.
No setup required.
</div>
</div>
<div id="content-8" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<br>
<div>
Libraries in Informal are sandboxed by default. <br>They can't access your network, filesystem or any resource unless you grant them those capabilities.
</div>
</div>
<div id="content-9" class="tab-content">
<div class="window-border">
<img src="static/images/windows.svg" alt="Window border">
</div>
<div>
Informal compiles to the lightweight, efficient WebAssembly bytecode format.
You can run it in the browser, on your servers, or even embed it in other applications.
Use WebAssembly's built-in foreign-function interface to interact with code across languages.
</div>
</div>
</section>
</div>
</div>
<div class="bg-gradient fg-white">
<section class="max-w-6xl relative mx-auto px-16 pt-32 pb-32 ">
<h2 class="text-2xl font-heading font-bold text-center">
Build. Launch. Grow.
</h2>
<p class="text-lg">
</p>
</section>
</div>
<script>
// Some old-school style class toggling to highlight currently selected tab.
// The tab-content-switching is setup to work without JS.
function selectTab(evt) {
let tabs = evt.parentNode.getElementsByClassName("tab-nav");
// Disable previously active tab in this group and activate clicked tab.
for (var i = 0; i < tabs.length; i++) { tabs[i].classList.remove("active"); }
evt.classList.add("active");
}
// Lorenz attractor.
// The image version of this is a pathological case for image compression algorithms
// and end-up as several hundred KBs no matter the format.
// TODO: Port this over to Informal
var x = 0,
y = 10,
z = 10,
dx = 0,
dy = 0,
dz = 0;
// Try these ones out!
// A: 18 B 29 C 6.070134050509346
// A: 19 B 38 C 8.769096639124001
// A: 14 B 29 C 2.812496067011794
// A: 16 B 25 C 4.634000666150972
var A = 10, // Horizontal shear
B = 28, // Vertical size
C = 8 / 3, // Spacing
H = 0.004, // Speed/differential step
size = 400; // Scaling
var t = 0;
const MAX_FRAMES = 14000;
var lorenzAnim;
var canvas = document.getElementById("lorenz");
var ctx = canvas.getContext("2d");
function lorenzStep() {
var dx = H * A * (y - x);
var dy = H * (x * (B - z) - y);
var dz = H * (x * y - C * z);
x += dx; y += dy; z += dz;
}
function randomLorenz() {
A = Math.floor(2 + Math.random() * 20);
B = Math.floor(15 + Math.random() * 30);
C = 2 + Math.random() * 10;
t = 0;
console.log("A: " + A + " B " + B + " C " + C);
}
function stopRender() {
cancelAnimationFrame(lorenzAnim);
}
function renderLorenz() {
ctx.strokeStyle = "hsl(" + ((x + y) * 8) % 64 + "," + 96 + "%," + "60%)";
ctx.lineWidth = 2;
for (var i = 0; i < 20; i++) {
ctx.beginPath();
// ctx.moveTo(z + size + x * 8, z + size + y * 8);
ctx.moveTo(1.45 * size + x * 16, 2.1 * size - z * 16);
lorenzStep();
// ctx.lineTo(z + size + x * 8, z + size + y * 8);
ctx.lineTo(1.45 * size + x * 16, 2.1 * size - z * 16);
ctx.stroke();
t++;
}
if (t > MAX_FRAMES) {
stopRender();
} else {
lorenzAnim = requestAnimationFrame(renderLorenz);
}
}
var scrollTimer;
function scrollWatch() {
// Check if they've scrolled far enough down the page before starting the lorenz animation
var canvasLoc = canvas.getBoundingClientRect();
var scrollHeight = window.innerHeight || document.documentElement.clientHeight;
if (canvasLoc.top > 0 & canvasLoc.top + 25 <= scrollHeight) {
clearInterval(scrollTimer);
renderLorenz();
}
}
scrollTimer = setInterval(scrollWatch, 1000);
canvas.addEventListener("click", function (evt) {
stopRender();
ctx.clearRect(0, 0, canvas.width, canvas.height);
randomLorenz();
renderLorenz();
})
</script>
<!-- Built with <3 by Feni -->
</body>
</html>