-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkgm.html
More file actions
executable file
·2025 lines (1887 loc) · 69.2 KB
/
pkgm.html
File metadata and controls
executable file
·2025 lines (1887 loc) · 69.2 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
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
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en"><head>
<script src="pkgm_files/libs/clipboard/clipboard.min.js"></script>
<script src="pkgm_files/libs/quarto-html/tabby.min.js"></script>
<script src="pkgm_files/libs/quarto-html/popper.min.js"></script>
<script src="pkgm_files/libs/quarto-html/tippy.umd.min.js"></script>
<link href="pkgm_files/libs/quarto-html/tippy.css" rel="stylesheet">
<link href="pkgm_files/libs/quarto-html/light-border.css" rel="stylesheet">
<link href="pkgm_files/libs/quarto-html/quarto-syntax-highlighting-de070a7b0ab54f8780927367ac907214.css" rel="stylesheet" id="quarto-text-highlighting-styles"><meta charset="utf-8">
<meta name="generator" content="quarto-1.7.30">
<meta name="author" content="Shiwei Weng">
<meta name="author" content="Logan Kostick">
<meta name="author" content="Michael Rushanan">
<meta name="author" content="Scott Smith">
<title>Package Managers à la Carte</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="pkgm_files/libs/revealjs/dist/reset.css">
<link rel="stylesheet" href="pkgm_files/libs/revealjs/dist/reveal.css">
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
vertical-align: middle;
}
/* CSS for syntax highlighting */
html { -webkit-text-size-adjust: 100%; }
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ color: #003b4f; background-color: #f1f3f5; }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span { color: #003b4f; } /* Normal */
code span.al { color: #ad0000; } /* Alert */
code span.an { color: #5e5e5e; } /* Annotation */
code span.at { color: #657422; } /* Attribute */
code span.bn { color: #ad0000; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #003b4f; font-weight: bold; } /* ControlFlow */
code span.ch { color: #20794d; } /* Char */
code span.cn { color: #8f5902; } /* Constant */
code span.co { color: #5e5e5e; } /* Comment */
code span.cv { color: #5e5e5e; font-style: italic; } /* CommentVar */
code span.do { color: #5e5e5e; font-style: italic; } /* Documentation */
code span.dt { color: #ad0000; } /* DataType */
code span.dv { color: #ad0000; } /* DecVal */
code span.er { color: #ad0000; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #ad0000; } /* Float */
code span.fu { color: #4758ab; } /* Function */
code span.im { color: #00769e; } /* Import */
code span.in { color: #5e5e5e; } /* Information */
code span.kw { color: #003b4f; font-weight: bold; } /* Keyword */
code span.op { color: #5e5e5e; } /* Operator */
code span.ot { color: #003b4f; } /* Other */
code span.pp { color: #ad0000; } /* Preprocessor */
code span.sc { color: #5e5e5e; } /* SpecialChar */
code span.ss { color: #20794d; } /* SpecialString */
code span.st { color: #20794d; } /* String */
code span.va { color: #111111; } /* Variable */
code span.vs { color: #20794d; } /* VerbatimString */
code span.wa { color: #5e5e5e; font-style: italic; } /* Warning */
</style>
<link rel="stylesheet" href="pkgm_files/libs/revealjs/dist/theme/quarto-f563837468303362081e247dddd440d0.css">
<link rel="stylesheet" href="styles.css">
<link href="pkgm_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.css" rel="stylesheet">
<link href="pkgm_files/libs/revealjs/plugin/reveal-menu/menu.css" rel="stylesheet">
<link href="pkgm_files/libs/revealjs/plugin/reveal-menu/quarto-menu.css" rel="stylesheet">
<link href="pkgm_files/libs/revealjs/plugin/quarto-support/footer.css" rel="stylesheet">
<style type="text/css">
.reveal div.sourceCode {
margin: 0;
overflow: auto;
}
.reveal div.hanging-indent {
margin-left: 1em;
text-indent: -1em;
}
.reveal .slide:not(.center) {
height: 100%;
}
.reveal .slide.scrollable {
overflow-y: auto;
}
.reveal .footnotes {
height: 100%;
overflow-y: auto;
}
.reveal .slide .absolute {
position: absolute;
display: block;
}
.reveal .footnotes ol {
counter-reset: ol;
list-style-type: none;
margin-left: 0;
}
.reveal .footnotes ol li:before {
counter-increment: ol;
content: counter(ol) ". ";
}
.reveal .footnotes ol li > p:first-child {
display: inline-block;
}
.reveal .slide ul,
.reveal .slide ol {
margin-bottom: 0.5em;
}
.reveal .slide ul li,
.reveal .slide ol li {
margin-top: 0.4em;
margin-bottom: 0.2em;
}
.reveal .slide ul[role="tablist"] li {
margin-bottom: 0;
}
.reveal .slide ul li > *:first-child,
.reveal .slide ol li > *:first-child {
margin-block-start: 0;
}
.reveal .slide ul li > *:last-child,
.reveal .slide ol li > *:last-child {
margin-block-end: 0;
}
.reveal .slide .columns:nth-child(3) {
margin-block-start: 0.8em;
}
.reveal blockquote {
box-shadow: none;
}
.reveal .tippy-content>* {
margin-top: 0.2em;
margin-bottom: 0.7em;
}
.reveal .tippy-content>*:last-child {
margin-bottom: 0.2em;
}
.reveal .slide > img.stretch.quarto-figure-center,
.reveal .slide > img.r-stretch.quarto-figure-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-left,
.reveal .slide > img.r-stretch.quarto-figure-left {
display: block;
margin-left: 0;
margin-right: auto;
}
.reveal .slide > img.stretch.quarto-figure-right,
.reveal .slide > img.r-stretch.quarto-figure-right {
display: block;
margin-left: auto;
margin-right: 0;
}
</style>
<meta name="mermaid-theme" content="default">
<script src="pkgm_files/libs/quarto-diagram/mermaid.min.js"></script>
<script src="pkgm_files/libs/quarto-diagram/mermaid-init.js"></script>
<link href="pkgm_files/libs/quarto-diagram/mermaid.css" rel="stylesheet">
</head>
<body class="quarto-light">
<div class="reveal">
<div class="slides">
<section id="title-slide" class="quarto-title-block center">
<h1 class="title">Package Managers à la Carte</h1>
<p class="subtitle">NJPLS @ Jane Street, 2025 May</p>
<div class="quarto-title-authors">
<div class="quarto-title-author">
<div class="quarto-title-author-name">
<strong>Shiwei Weng</strong>
</div>
<p class="quarto-title-affiliation">
Johns Hopkins University<br><img src="images/jhu-logo.png" class="author-image">
</p>
</div>
<div class="quarto-title-author">
<div class="quarto-title-author-name">
Logan Kostick
</div>
<p class="quarto-title-affiliation">
Johns Hopkins University<br><img src="images/jhu-logo.png" class="author-image">
</p>
</div>
<div class="quarto-title-author">
<div class="quarto-title-author-name">
Michael Rushanan
</div>
<p class="quarto-title-affiliation">
Johns Hopkins University<br><img src="images/jhu-logo.png" class="author-image">
</p>
</div>
<div class="quarto-title-author">
<div class="quarto-title-author-name">
Scott Smith
</div>
<p class="quarto-title-affiliation">
Johns Hopkins University<br><img src="images/jhu-logo.png" class="author-image">
</p>
</div>
</div>
</section>
<section class="slide level2">
<h3 id="package-managers-are-ubiquitous-but">Package Managers are Ubiquitous but …</h3>
<ul>
<li>Real-world package managers are not easy to understand and reason about
<ul>
<li>whether they make mistakes, or users are just confused</li>
</ul></li>
</ul>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Some popular languages may have too many package managers
<ul>
<li>e.g. <code>python</code> has <code>pip</code>, <code>conda</code>, <code>poetry</code>, <code>uv</code>, but <strong>why?</strong></li>
</ul></li>
</ul>
</div>
<div class="fff-1 fragment" data-fragment-index="1">
<ul>
<li>Some <strong>languages</strong> may lack one
<ul>
<li>e.g. <code>shell</code>, <code>cmake</code>, <code>menhir</code>, <code>dune</code>, etc</li>
<li>e.g. LLM Prompts, λ-calculus or DSLs you have invented</li>
</ul></li>
</ul>
</div>
<aside class="notes">
<p>Opening-Outline, 1/5, 3m</p>
<p>a rule of thumb: if sth has a syntax and you often copy-and-paste it, that language must be beneficial for having a package manager</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="current-state-of-package-managers">Current State of Package Managers</h3>
<blockquote>
<p>Any sufficiently complicated C or Fortran program contains an <strong>ad hoc</strong>, <strong>informally-specified</strong>, <strong>bug-ridden</strong>, <strong>slow implementation</strong> of half of Common Lisp.</p>
<p>— Greenspun’s Tenth Rule</p>
</blockquote>
<p><br></p>
<p>It also applies to package managers.</p>
<aside class="notes">
<p>quick next two Opening-Outline, 2/5, 3m</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="goals">Goals</h3>
<ul>
<li><strong>Principled and modular</strong> (vs <em>ad hoc</em>)</li>
<li><strong>Formally specified</strong> (vs <em>informally-specified</em>)</li>
<li><em>Sound and verified</em> (vs <em>bug-ridden</em>)</li>
<li><em>Efficient and scalable</em> (vs <em>slow implementation</em>)</li>
</ul>
<aside class="notes">
<p>Opening-Outline, 3/5, 3m</p>
<p>This talk and our current work focuses on the first two</p>
<p><strong>Formally</strong> is the opposite of <strong>informally</strong>, not mean dependent-typed</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="approach-and-aim">Approach and Aim</h3>
<ul>
<li>Our approach
<ul>
<li>Distill a precise vocabulary for package managers (PKGM)</li>
<li>Understand and reason about their structures and operations<br>
</li>
<li>Build a proof-of-concept framework <code>tola</code> (Thousands of Languages)</li>
</ul></li>
</ul>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Our aims
<ul>
<li>Hit the goals of the previous slide (principled/sound/efficient/scalable)</li>
<li>Allow users to derive PKGM for their languages</li>
<li>Help understand and address real-world PKGMs</li>
</ul></li>
</ul>
</div>
<aside class="notes">
<p>Opening-Outline, 4/5, 3m</p>
<p>Our aims ranges from the academic ideals or some ultimate visions</p>
<p>Besides, it’s also practical and educational</p>
<p>After warming up, go deep into two parts:</p>
<ul>
<li>Distributed Stores equipped with Version Logic</li>
</ul>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="outline-of-the-talk">Outline of the Talk</h3>
<ul>
<li>Vocabulary
<ul>
<li>Clarify terms like <code>package name</code> and <code>version</code></li>
</ul></li>
<li>Package Stores
<ul>
<li>We treat PKGMs as <em>distributed “versioned-key”-value maps</em> with explicit local and remote stores</li>
</ul></li>
<li>Version Logic
<ul>
<li>A formal approach to define dependency and their operations that every PKGM (mostly) implements</li>
</ul></li>
</ul>
<aside class="notes">
<p>Opening-Outline 5/5, 3m</p>
<p>Vocabulary, 2, 5m</p>
<p>I could do a 1-hour talk for clarifying the vocabulary, however, we want to show that even the simple-looking terms may be subtle</p>
<p>Then for the talk, we will focus on two essential abstractions of PKGM</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="what-is-package-name-and-version-really">What is <em>Package Name</em> and <em>Version</em>, really?</h3>
<ul>
<li><code>foo</code>
<ul>
<li><span class="fragment" data-fragment-index="1">Package name <code>foo</code></span></li>
</ul></li>
<li><code>foo.1.0</code>
<ul>
<li><span class="fragment" data-fragment-index="2">Version <code>1.0</code> </span></li>
</ul></li>
<li><code>foo.1.1.bugfix</code>
<ul>
<li><span class="fragment" data-fragment-index="2">Version <code>1.1.bugfix</code></span></li>
</ul></li>
<li><code>foo_1.1-2_amd64</code>
<ul>
<li><span class="fragment" data-fragment-index="2">Version <code>1.1-2</code></span></li>
<li><span class="fragment" data-fragment-index="3">Platform <code>amd64</code></span>
<ul>
<li><span class="fragment" data-fragment-index="3">less interesting when two platforms are compared</span></li>
</ul></li>
</ul></li>
</ul>
<aside class="notes">
<p>Vocabulary, 1/2, 5m</p>
<p>platform can also be called build, architecture, release</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="the-vocabulary-is-messy">The Vocabulary Is Messy</h3>
<ul>
<li>Package managers don’t agree on common terms
<ul>
<li>e.g. <em>package</em>, <em>project</em>, <em>library</em>, <em>application</em>, <em>module</em>, <em>workspace</em></li>
</ul></li>
</ul>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Package managers use metaphors for terms
<ul>
<li>e.g. <em>wheel</em>, <em>gem</em>, <em>switch</em>, <em>rack</em>, <em>keg</em>, <em>bottle</em></li>
</ul></li>
</ul>
</div>
<div class="fff-1 fragment" data-fragment-index="1">
<ul>
<li>Other systems (build systems, compilers, etc) also use these terms but may have subtle different meanings</li>
</ul>
</div>
<aside class="notes">
<p>Vocabulary, 2/2, 5m</p>
<p>We are working on a uniform naming</p>
<p>As we will show in the Package Stores and Version Logic</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="where-are-packages-kept-in-the-real-world">Where are Packages Kept in the Real-World?</h3>
<ul>
<li>Stored local to the user
<ul>
<li><em>system-wise</em>: in some (global) system directory</li>
<li><em>project-wise</em>: near the project directory</li>
</ul></li>
<li>Stored remotely, on some servers</li>
</ul>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Each of these locations — a local directory, or a remote source
<ul>
<li>acts as an <strong>isolated place for packages</strong>.</li>
</ul></li>
<li>We name each such package place a <strong>Package Store</strong></li>
</ul>
</div>
<aside class="notes">
<p>Store, 1/6, 9m</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="local-package-stores-in-the-real-world">Local Package Stores in the Real-World</h3>
<div class="r-stack">
<ul>
<li>system-wise
<ul>
<li><span class="fragment" data-fragment-index="1"><code>opam switch create</code> – creates a local isolated store </span></li>
<li><span class="fragment" data-fragment-index="1"><code>python -m venv</code> – installs into the virtualenv </span></li>
<li><span class="fragment" data-fragment-index="1"><code>gem install --install-dir</code> – local install path for RubyGems </span></li>
</ul></li>
<li>project-wise
<ul>
<li><span class="fragment" data-fragment-index="2"><code>npm install</code> – installs into <code>node_modules/</code> in the project </span></li>
<li><span class="fragment" data-fragment-index="2"><code>bundle config set --local cache_path vendor/cache</code> – caches resolved packages locally</span></li>
<li><span class="fragment" data-fragment-index="2"><code>brew --prefix <path></code> – local installs under custom prefix path</span></li>
</ul>
<img class="fragment" style="position: absolute; bottom: 2em; right: 2em; z-index: 10;" src="images/switch.png" width="600"></li>
</ul>
</div>
<aside class="notes">
<p>Store, 2/6, 9m</p>
<p>Usually, you can have multi local store but just one is active. virtualenv (concept) vs site (implementation of searchpath),</p>
<p>This is a real question from a PL student</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="remote-package-stores-in-the-real-world">Remote Package Stores in the Real-World</h3>
<ul>
<li>Names for remote stores also vary widely
<ul>
<li>repository, index, registry, (gem) server, archive mirror, Personal Package Archive(PPA), tap</li>
</ul></li>
<li>Official public stores
<ul>
<li><code>opam</code>: opam repository (Git-based, versioned)</li>
<li><code>pip</code>: Python Package Index (PyPI)</li>
<li><code>npm</code>: npm registry</li>
<li><code>RubyGems</code>: rubygems.org</li>
<li><code>dpkg+apt</code>: Debian archive mirrors</li>
</ul></li>
</ul>
<aside class="notes">
<p>quick page</p>
<p>Store, 3/6, 9m</p>
<p>You can have multiple remote stores.</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="store-structures-in-our-perspective">Store Structures in Our Perspective</h3>
<ul>
<li>PKGMs are <em>Distributed</em> “Versioned-key”-value maps
<ul>
<li>Each distributed store, locally or remotely, is heterogeneous</li>
</ul></li>
</ul>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Multiplicity of choice for key:
<ul>
<li><strong>Unique</strong>: only one version per package in a store</li>
<li>vs <strong>Multi</strong>: multiple versions coexist</li>
</ul></li>
</ul>
</div>
<div class="fff-1 fragment" data-fragment-index="1">
<ul>
<li>Structure choice for value:
<ul>
<li><strong>Flat</strong>: packages are only put in a single directory without nesting</li>
<li>vs <strong>Nested</strong>: packages are organized in a hierarchical structure (nested directories)</li>
</ul></li>
</ul>
</div>
<aside class="notes">
<p>Store, 4/6, 9m</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="stores-of-package-managers">Stores of Package Managers</h3>
<div style="font-size: 50%">
<table>
<colgroup>
<col style="width: 7%">
<col style="width: 14%">
<col style="width: 20%">
<col style="width: 16%">
<col style="width: 25%">
<col style="width: 15%">
</colgroup>
<thead>
<tr class="header">
<th>PKGM</th>
<th>Target</th>
<th>Local Store</th>
<th>Local Structure</th>
<th>Remote Store</th>
<th>Remote Structure</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>opam</td>
<td>OCaml</td>
<td>switch</td>
<td>unique flat</td>
<td>opam repository</td>
<td>multi flat</td>
</tr>
<tr class="even">
<td>pip</td>
<td>Python</td>
<td>virtual environment</td>
<td>unique flat</td>
<td>Python Package Index (PyPI)</td>
<td>multi flat</td>
</tr>
<tr class="odd">
<td>npm</td>
<td>Node.js</td>
<td><code>node_modules</code></td>
<td>unique nested</td>
<td>npm registry</td>
<td>multi flat</td>
</tr>
<tr class="even">
<td>RubyGem</td>
<td>Ruby</td>
<td>System-wide directory</td>
<td>multi flat</td>
<td>RubyGems.org</td>
<td>multi flat</td>
</tr>
<tr class="odd">
<td>bundler</td>
<td>Ruby</td>
<td><code>vendor/bundle</code></td>
<td>unique flat</td>
<td>RubyGems.org</td>
<td>multi flat</td>
</tr>
<tr class="even">
<td>dpkg+apt</td>
<td>Debian packages</td>
<td>System-wide directory</td>
<td>multi flat</td>
<td>Debian package repository</td>
<td>multi flat</td>
</tr>
</tbody>
</table>
</div>
<div class="fff-0 small fragment" data-fragment-index="0">
<ul>
<li>Most remote stores use a <code>multi</code> <code>flat</code> structure</li>
<li><span class="fragment" data-fragment-index="1"><code>npm</code> uses a <code>nested</code> local store — used to cause issues</span></li>
<li><span class="fragment" data-fragment-index="2"><code>RubyGem</code> uses a <code>multi</code> local store</span> <span class="fragment" data-fragment-index="3">- causes many troubles</span></li>
<li><span class="fragment" data-fragment-index="4">dpkg’s <code>multi</code> local store requires switching symbolic links via <code>update-alternatives</code></span></li>
</ul>
</div>
<aside class="notes">
<p>next page is code</p>
<p>Store, 5/6, 9m</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="tola-code-for-stores"><code>tola</code> Code for Stores</h3>
<div class="columns">
<div class="column">
<div class="sourceCode" id="cb1"><pre class="sourceCode numberSource ocaml number-lines code-with-copy"><code class="sourceCode ocaml"><span id="cb1-1"><a href=""></a><span class="co">(* In Spec.config *)</span></span>
<span id="cb1-2"><a href=""></a><span class="kw">type</span> store_kind = </span>
<span id="cb1-3"><a href=""></a> Directory | Git_repo</span>
<span id="cb1-4"><a href=""></a><span class="kw">type</span> store_position = </span>
<span id="cb1-5"><a href=""></a> Local | Remote</span>
<span id="cb1-6"><a href=""></a></span>
<span id="cb1-7"><a href=""></a><span class="co">(* In Store *)</span></span>
<span id="cb1-8"><a href=""></a><span class="kw">module</span> Pkg_store = </span>
<span id="cb1-9"><a href=""></a> Store.File_store_make (Package)</span>
<span id="cb1-10"><a href=""></a></span>
<span id="cb1-11"><a href=""></a><span class="kw">type</span> t = {</span>
<span id="cb1-12"><a href=""></a> config : Spec.config;</span>
<span id="cb1-13"><a href=""></a> local_store : Pkg_store.t;</span>
<span id="cb1-14"><a href=""></a> remote_stores : Pkg_store.t <span class="dt">list</span>;</span>
<span id="cb1-15"><a href=""></a> ...</span>
<span id="cb1-16"><a href=""></a>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
</div><div class="column center">
<p><img data-src="images/tola-remote.png"></p>
</div></div>
<aside class="notes">
<p>Store, 6/6, 9m</p>
<p>Versioning, 9, 15m</p>
<p>Currently, tola has basic supports for local and remote store.</p>
<p>Given its modular nature, it’s easy to adapt to pnpm’s hardlink, or put it on S3</p>
<p>Now we shift to the next topic: version</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="versions-in-the-real-world">Versions in the Real-World</h3>
<ul>
<li>A <strong>version</strong> is a string — but often has internal structure
<ul>
<li>e.g. SemVer <code>1.3.2</code> <==> <code>{major=1; minor=3; patch=2}</code></li>
<li>Each segment can be compared; precedence differs by position</li>
</ul></li>
<li>Different ecosystems define different version schemes:
<ul>
<li><strong>SemVer</strong>: <code>MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD]</code>
<ul>
<li><span class="fragment" data-fragment-index="1"><em>build metadata does not affect precedence</em></span></li>
</ul></li>
<li><strong>Debian</strong>: <code>[epoch:]upstream_version[-debian_revision]</code>
<ul>
<li><span class="fragment" data-fragment-index="1">Fields like <code>Architecture: amd64</code> are defined elsewhere</span></li>
</ul></li>
</ul></li>
</ul>
<aside class="notes">
<p>Versioning (RW), 1/3, 12m</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="advanced-comparators-in-package-managers">Advanced Comparators in Package Managers</h3>
<div style="font-size: 70%">
<table>
<colgroup>
<col style="width: 10%">
<col style="width: 28%">
<col style="width: 61%">
</colgroup>
<thead>
<tr class="header">
<th>PKGM</th>
<th>Version Scheme</th>
<th>Advanced Comparators</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>opam</td>
<td>Debian versioning</td>
<td><code>conflicts</code>, <code>conflict-class</code>, <code>virtual package</code></td>
</tr>
<tr class="even">
<td>pip</td>
<td>version specifiers</td>
<td><code>~=</code> (compatible), <code>===</code> (arbitrary equality)</td>
</tr>
<tr class="odd">
<td>npm</td>
<td>semantic versioning</td>
<td><code>~</code> (tilde), <code>^</code> (caret)</td>
</tr>
<tr class="even">
<td>RubyGem</td>
<td>semantic versioning</td>
<td><code>~></code> (pessimistic)</td>
</tr>
<tr class="odd">
<td>dpkg+apt</td>
<td>Debian versioning</td>
<td><code>Breaks</code>, <code>Conflicts</code></td>
</tr>
</tbody>
</table>
<p><br></p>
</div>
<div class="fff-0 fragment" data-fragment-index="0">
<ul>
<li>Package managers define <strong>advanced comparators</strong>
<ul>
<li>some are based on version schemes (e.g., <code>~</code>, <code>~></code>, <code>^</code>),<br>
</li>
<li>but others are based on dependency relations (e.g., <code>conflicts</code>, <code>breaks</code>)</li>
</ul></li>
</ul>
</div>
<aside class="notes">
<p>Versioning (RW), 2/3, 12m</p>
<p>arbitrary equality is defined as string equality The primary use case for arbitrary equality is to allow for specifying a version which cannot otherwise be represented by this specification.</p>
<style type="text/css">
span.MJX_Assistive_MathML {
position:absolute!important;
clip: rect(1px, 1px, 1px, 1px);
padding: 1px 0 0 0!important;
border: 0!important;
height: 1px!important;
width: 1px!important;
overflow: hidden!important;
display:block!important;
}</style></aside>
</section>
<section class="slide level2">
<h3 id="examples-for-advanced-comparators">Examples for Advanced Comparators</h3>
<p><br></p>
<div style="font-size: 40%">
<table>
<colgroup>
<col style="width: 15%">
<col style="width: 3%">
<col style="width: 5%">
<col style="width: 34%">
<col style="width: 14%">
<col style="width: 26%">
</colgroup>
<thead>
<tr class="header">
<th>Name</th>
<th>Cmp</th>
<th>PKGM</th>
<th>Meaning</th>
<th>Example Input</th>
<th>Example Match Versions</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Compatible release</td>
<td><code>~=</code></td>
<td>pip</td>
<td>Allows patch updates within same minor</td>
<td><code>~=1.2.3</code></td>
<td><code>1.2.3</code>, <code>1.2.9</code> , not <code>1.3.0</code></td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td></td>
<td>Allows minor updates within same major</td>
<td><code>~=1.2</code></td>
<td><code>1.2.0</code>, <code>1.9.9</code><span class="fragment" data-fragment-index="1">💥</span> , not <code>2.0.0</code></td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td></td>
<td></td>
<td><code>~=1</code> (invalid) <span class="fragment" data-fragment-index="2">💥</span></td>
<td>-</td>
</tr>
<tr class="even">
<td>Exact match</td>
<td><code>===</code></td>
<td>pip</td>
<td>Exact string match</td>
<td><code>===1.2.3</code></td>
<td>Only <code>1.2.3</code></td>
</tr>
<tr class="odd">
<td>Tilde</td>
<td><code>~</code></td>
<td>npm</td>
<td>Allows patch updates within same minor</td>
<td><code>~1.2.3</code></td>
<td><code>1.2.3</code>, <code>1.2.9</code> , not <code>1.3.0</code></td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td></td>
<td></td>
<td><code>~1.2</code></td>
<td><code>1.2.0</code>, <code>1.2.9</code><span class="fragment" data-fragment-index="1">💥</span> , not <code>1.3.0</code></td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td></td>
<td></td>
<td><code>~1</code></td>
<td><code>1.0.0</code>, <code>1.9.9</code>, not <code>2.0.0</code></td>
</tr>
<tr class="even">
<td>Caret</td>
<td><code>^</code></td>
<td>npm</td>
<td>Allows minor updates within same major</td>
<td><code>^1.2.3</code></td>
<td><code>1.2.3</code>, <code>1.9.9</code>, not <code>2.0.0</code></td>
</tr>
<tr class="odd">
<td>Pessimistic Operator</td>
<td><code>~></code></td>
<td>RubyGem</td>
<td>Allows patch updates within same minor</td>
<td><code>~> 1.2.3</code></td>
<td><code>1.2.3</code>, <code>1.2.9</code>, not <code>1.3.0</code></td>
</tr>
<tr class="even">
<td></td>
<td></td>
<td></td>
<td></td>
<td><code>~> 1.2</code></td>
<td><code>1.2.0</code>, <code>1.2.9</code><span class="fragment" data-fragment-index="1">💥</span> , not <code>1.3.0</code></td>
</tr>
<tr class="odd">
<td></td>
<td></td>
<td></td>
<td><em>may surprise some people - gem guide</em></td>
<td><code>~> 1</code></td>
<td><code>1.0.0</code>, <code>1.9.9</code>, not <code>2.0.0</code></td>
</tr>
</tbody>
</table>
</div>
<!-- [^1]: https://guides.rubygems.org/patterns/ -->
<p><br></p>
<div class="fff-0 small-xs fragment" data-fragment-index="0">
<ul>
<li>pip’s compatible <code>~=</code>, npm’s tilde <code>~</code>, and gem’s pessimistic <code>~></code> look similar, but
<ul>
<li><strong>informally-specified</strong> from document and implementation</li>
<li>They differ on <code>~= 1.2</code>, <code>~ 1.2</code>, <code>~> 1.2</code> <span class="fragment" data-fragment-index="1">💥</span> and differ on <code>~= 1</code>, <code>~ 1</code>, <code>~> 1</code> <span class="fragment" data-fragment-index="2">💥</span></li>