aboutsummaryrefslogtreecommitdiff
path: root/docs/community/aoc.html
blob: 5ecd882238f644d8f03c79e3c853f9eb082d4fdf (plain)
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
<head>
  <link href="../favicon.ico" rel="shortcut icon" type="image/x-icon"/>
  <link href="../style.css" rel="stylesheet"/>
  <title>BQN: Advent of Code</title>
</head>
<div class="nav">(<a href="https://github.com/mlochbaum/BQN">github</a>) / <a href="../index.html">BQN</a> / <a href="index.html">community</a></div>
<h1 id="advent-of-code"><a class="header" href="#advent-of-code">Advent of Code</a></h1>
<p><a href="https://adventofcode.com/2022">Advent of Code 2022</a> is now running, with tons of published BQN solutions:</p>
<center>

<p><a href="https://github.com/shnarazk/advent-of-code/tree/main/bqn/2022">Narazaki Shuji</a><a href="https://github.com/jhfranklin/aoc/tree/main/2022">Jack Franklin</a><a href="https://github.com/Detegr/aoc2022">Antti Keränen</a><a href="https://code.tvl.fyi/tree/users/sterni/exercises/aoc/2022">sterni</a><a href="https://github.com/Brian-ED/BQN-Advent-Of-Code/tree/main/2022">Brian E</a><a href="https://github.com/razetime/aoc/tree/main/22/bqn">Raghu R</a><a href="https://github.com/saltysylvi/bqn-aoc2022">saltysylvi</a><a href="https://github.com/icendoan/aoc22">Caleb Quilley</a><a href="https://github.com/mpizzzle/AdventOfCode/tree/master/2022">Michael Percival</a><a href="https://github.com/frasiyav/AoC2022">frasiyav</a><a href="https://github.com/dzaima/aoc/tree/master/2022/BQN">dzaima</a><a href="https://github.com/dlozeve/aoc2022">Dimitri Lozeve</a><a href="https://github.com/Skyb0rg007/Advent-of-Code/tree/master/2022">Skye Soss</a><a href="https://github.com/karimElmougi/aoc/tree/master/2022">Karim Elmougi</a><a href="https://github.com/eissplitter/aoc">eissplitter</a><a href="https://codeberg.org/Rampoina/aoc/src/branch/master/2022">Rampoina</a><a href="https://github.com/Olodus/advent_of_code2021/tree/main/2022">Olodus</a><a href="https://git.sr.ht/~srasu/bqn-aoc/tree/main/item/src/aoc2022">Joshua Suskalo</a><a href="https://github.com/jhvst/advent2022">Juuso Haavisto</a><a href="https://github.com/dunyakirkali/aoc.bqn/tree/main/2022">Dunya Kirkali</a><a href="https://github.com/devcordde/adventofcode-22">Johnny</a><a href="https://github.com/SamuelSarle/advent/tree/master/adv_2022">Samuel</a><a href="https://github.com/axelbdt/aoc/tree/main/2022/bqn">axelbdt</a><a href="https://github.com/Nhlest/AoC2022/tree/main/bqn">N`hlest</a><a href="https://github.com/kejadlen/advent-of-code/tree/main/2022/bqn">Alpha Chen</a><a href="https://github.com/AugustUnderground/AoC2022">ynk</a><a href="https://github.com/sullyj3/adventofcode2022">James Sully</a><a href="https://github.com/dancek/bqn-advent2022">Hannu Hartikainen</a><a href="https://github.com/codereport/Advent-of-Code-2022">Conor Hoekstra</a><a href="https://github.com/asherbhs/aoc2022">Asher Harvey-Smith</a><a href="https://github.com/extorious/aoc2022">extorious</a><a href="https://github.com/japiirainen/aoc-2022/tree/main/hs">Joona Piirainen</a><a href="https://github.com/dgkf/advent-of-code/tree/master/2022">Doug Kelkhoff</a><a href="https://github.com/juriad/advent2022">Adam Juraszek</a><a href="https://github.com/dankeyy/aoc22">dankeyy</a><a href="https://github.com/phenax/advent-of-coolio-2022">Akshay Nair</a><a href="https://github.com/bddean/aoc/tree/main/2022">Ben Dean</a></p>
</center>

<p>I'm posting statistics in the <a href="forums.html">forum</a> for now, and will update here once things have settled down some!</p>
<h3 id="last-year"><a class="header" href="#last-year">Last year</a></h3>
<p><a href="https://adventofcode.com/2021">Advent of Code 2021</a> saw great participation by the BQN community, with a total of 234 solutions published by 22 programmers. They can be found in these repositories:</p>
<center>

<p><a href="https://github.com/dzaima/aoc/tree/master/2021/BQN">dzaima</a><a href="https://github.com/dancek/bqn-advent2021">Hannu Hartikainen</a><a href="https://github.com/razetime/AOC2021-BQN">Raghu Ranganathan</a><a href="https://github.com/frasiyav/AoC2021">frasiyav</a><a href="https://github.com/leahneukirchen/adventofcode2021">Leah Neukirchen</a><a href="https://github.com/Detegr/aoc2021">Antti Keränen</a><a href="https://gitlab.com/icen/aoc21">Caleb Quilley</a><a href="https://github.com/alvinvoo/aoc2021">Alvin Voo</a><a href="https://github.com/AlexDikelsky/puzzles/tree/main/advent_of_code/advent_2021">Alex Dikelsky</a><a href="https://github.com/andreypopp/aoc2021">Andrey Popp</a><a href="https://github.com/JohnnyJayJay/adventofcode-21">Johnny</a><a href="https://git.sr.ht/~jshholland/adventofcode/tree/master/item/2021">Josh Holland</a><a href="https://github.com/bddean/aoc-2021">Ben Dean</a><a href="https://github.com/alephno/aoc2021/tree/main/BQN">Alastair Williams</a><a href="https://github.com/Olodus/advent_of_code2021">Olodus</a><a href="https://github.com/arwn/aoc2021">Aren Windham</a><a href="https://github.com/dlozeve/aoc2021">Dimitri Lozeve</a><a href="https://github.com/knightzmc/advent-of-code-2021">Alexander Wood</a><a href="https://github.com/mathiasmagnusson/advent-of-code-21">Mathias Magnusson</a><a href="https://github.com/m-lima/advent-of-code-2021">m-lima</a><a href="https://github.com/dunyakirkali/aoc.bqn/tree/main/2021">Dunya Kirkali</a><a href="https://github.com/Camto/Advent-of-Code-2021/tree/master/BQN">Benjamin Applegate</a></p>
</center>

<p>Below, problems solved in BQN are shown in green, and problems solved in other languages in faint red.</p>
<svg viewBox='-20 -5 638 462'>
  <g stroke-width='1' font-size='14px' fill='currentColor'>
    <rect class='code' stroke-width='1' rx='6' x='0' y='0' width='598' height='452'/>
    <g class='Paren' stroke='currentColor' fill='none'>
      <path d='M90 0V452'/>
      <path d='M0 50H598'/>
    </g>
    <g text-anchor='middle'>
      <text font-size='20px' x='340' y='24'>Day</text>
      <g font-size='11px'>
        <text x='100' y='46'>1</text>
        <text x='120' y='46'>2</text>
        <text x='140' y='46'>3</text>
        <text x='160' y='46'>4</text>
        <text x='180' y='46'>5</text>
        <text x='200' y='46'>6</text>
        <text x='220' y='46'>7</text>
        <text x='240' y='46'>8</text>
        <text x='260' y='46'>9</text>
        <text x='280' y='46'>10</text>
        <text x='300' y='46'>11</text>
        <text x='320' y='46'>12</text>
        <text x='340' y='46'>13</text>
        <text x='360' y='46'>14</text>
        <text x='380' y='46'>15</text>
        <text x='400' y='46'>16</text>
        <text x='420' y='46'>17</text>
        <text x='440' y='46'>18</text>
        <text x='460' y='46'>19</text>
        <text x='480' y='46'>20</text>
        <text x='500' y='46'>21</text>
        <text x='520' y='46'>22</text>
        <text x='540' y='46'>23</text>
        <text x='560' y='46'>24</text>
        <text x='580' y='46'>25</text>
      </g>
    </g>
    <text x='10' y='65'>dzaima</text>
    <text x='10' y='83'>Hannu</text>
    <text x='10' y='101'>Raghu</text>
    <text x='10' y='119'>frasiyav</text>
    <text x='10' y='137'>Leah</text>
    <text x='10' y='155'>Antti</text>
    <text x='10' y='173'>Caleb</text>
    <text x='10' y='191'>Alvin</text>
    <text x='10' y='209'>Alex</text>
    <text x='10' y='227'>Andrey</text>
    <text x='10' y='245'>Johnny</text>
    <text x='10' y='263'>Josh</text>
    <text x='10' y='281'>Ben</text>
    <text x='10' y='299'>Alastair</text>
    <text x='10' y='317'>Olodus</text>
    <text x='10' y='335'>Aren</text>
    <text x='10' y='353'>Dimitri</text>
    <text x='10' y='371'>Alexander</text>
    <text x='10' y='389'>Mathias</text>
    <text x='10' y='407'>m-lima</text>
    <text x='10' y='425'>Dunya</text>
    <text x='10' y='443'>Benjamin</text>
    <g stroke-width='6' class='green' opacity='0.9'>
      <path d='M90 60.5h500'/>
      <path d='M90 78.5h440M550 78.5h40'/>
      <path d='M90 96.5h440M570 96.5h20'/>
      <path d='M90 114.5h440'/>
      <path d='M90 132.5h220M330 132.5h60M410 132.5h40M470 132.5h40M550 132.5h40'/>
      <path d='M90 150.5h360M470 150.5h40'/>
      <path d='M90 168.5h360'/>
      <path d='M90 186.5h280'/>
      <path d='M90 204.5h220M330 204.5h40'/>
      <path d='M90 222.5h60M170 222.5h60M290 222.5h60M370 222.5h20M410 222.5h20M470 222.5h20'/>
      <path d='M90 240.5h140M250 240.5h40'/>
      <path d='M90 258.5h160'/>
      <path d='M90 276.5h140'/>
      <path d='M90 294.5h20M130 294.5h20M190 294.5h40M250 294.5h20'/>
      <path d='M90 312.5h60M250 312.5h20'/>
      <path d='M190 330.5h40M250 330.5h20'/>
      <path d='M90 348.5h20M130 348.5h20'/>
      <path d='M130 366.5h20'/>
      <path d='M130 384.5h20'/>
      <path d='M90 402.5h20'/>
      <path d='M90 420.5h20'/>
      <path d='M90 438.5h20'/>
    </g>
    <g stroke-width='6' class='red' opacity='0.2'>
      <path d='M310 132.5h20M390 132.5h20M450 132.5h20M510 132.5h40'/>
      <path d='M310 204.5h20'/>
      <path d='M230 240.5h20'/>
      <path d='M110 294.5h20'/>
      <path d='M90 330.5h100M230 330.5h20M270 330.5h60'/>
      <path d='M110 348.5h20M170 348.5h60M250 348.5h40M310 348.5h120M470 348.5h40'/>
      <path d='M90 366.5h40'/>
      <path d='M90 384.5h40'/>
      <path d='M110 402.5h320'/>
    </g>
  </g>
</svg>

<p>Some wrote about aspects of the Advent experience: Leah explained her solutions for <a href="https://leahneukirchen.org/blog/archive/2021/12/counting-lanternfish-with-bqn-and-linear-algebra.html">day 6</a> and <a href="https://leahneukirchen.org/blog/archive/2021/12/surveying-lava-basins-with-bqn-and-fixpoints.html">day 9</a>, Hannu <a href="https://hannuhartikainen.fi/blog/advent-of-bqn/">reflected</a> on the choice of BQN, and Raghu <a href="https://razetime.github.io/blog1/2022/01/09/aoc-bqn.html">commented on</a> each problem.</p>
<p>The number of BQN solutions for each of the 25 days is plotted below, along with totals from AoC's <a href="https://adventofcode.com/2021/stats">stats page</a>. The BQN solutions are scaled to be visible here: there are 6827 times more valid AoC submissions than published BQN solutions overall.</p>
<svg viewBox='-40 -25 336 178'>
  <g stroke-width='1.2' font-size='13px' text-anchor='end' fill='currentColor'>
    <rect class='code' stroke-width='1' rx='6' x='-20' y='-20' width='296' height='168'/>
    <text x='256' y='9'>Solutions in:</text>
    <text class='red' x='256' y='27'>Anything</text>
    <text class='green' x='256' y='45'>BQN</text>
    <g text-anchor='middle' opacity='0.8'>
      <text dy='1em' x='128' y='128'>day</text>
      <text transform='rotate(-90)' dy='-0.35em' x='-64' y='0'>count</text>
    </g>
    <path class='Paren' stroke='currentColor' fill='none' d='M0 0V128H256'/>
    <path class='red' style='fill:none' d='M0 0L10.667 21.116L21.333 34.08L32 66.927L42.667 74.514L53.333 74.193L64 77.272L74.667 82.658L85.333 86.149L96 90.367L106.667 94.989L117.333 99.169L128 98.574L138.667 98.442L149.333 104.735L160 108.875L170.667 108.938L181.333 114.112L192 118.738L202.667 115.258L213.333 113.545L224 116.127L234.667 119.629L245.333 121.132L256 119.185'/>
    <path class='green' style='fill:none' d='M0 51.572L10.667 71.684L21.333 55.594L32 79.73L42.667 75.707L53.333 67.662L64 67.662L74.667 87.775L85.333 75.707L96 87.775L106.667 87.775L117.333 95.82L128 87.775L138.667 91.797L149.333 95.82L160 103.865L170.667 95.82L181.333 99.842L192 111.91L202.667 99.842L213.333 103.865L224 111.91L234.667 123.977L245.333 115.932L256 111.91'/>
  </g>
</svg>

<p>The BQN counts fall off much less than the average. Most likely this is because programmers who decide to try AoC in a crazy new language like BQN tend to be more committed to the task, but BQN also has to meet some minimum bar to enable these crazy people to continue.</p>
<p>Just how okay is BQN? Hannu <a href="https://hannuhartikainen.fi/blog/advent-of-bqn/">made the case</a> for optimism. Hannu writes that BQN's slogan &quot;might be the best [further glowing praise/context]&quot;, in stark contrast to that time <a href="https://adspthepodcast.com/2021/12/17/Episode-56.html">Bryce and Conor agreed</a> that it was a bad slogan. And Andrey offers <a href="https://news.ycombinator.com/item?id=29521264">suspiciously positive comments</a> as well. The list includes &quot;good text editor support&quot;, but Johnny remarked on the forums that he didn't manage a good editor/REPL setup—a second contradiction, meaning that I can now prove the Riemann hypothesis in <em>two</em> independent ways. Johnny also cited little support for string handling and low-information error messages as obstacles. I like that these aren't tied to the core language, and can eventually be improved, even though it won't be easy. dzaima complained about frequent confusion between functions and immediate blocks, and right-to-left folds being the much less useful direction. I dislike that dzaima is right a lot.</p>
<p>All three non-dzaimas of the last paragraph are essentially array outsiders, with little or no experience with languages like J or APL. In fact I think this describes the majority of Adventurers in BQN (although the list also includes array junkies like Raghu and Leah, and they've predictably made it further than most participants). Reaching out to a general programming audience wasn't initially a goal of BQN because I didn't think it <em>was</em> within reach. I realized this was wrong, and began to adjust course, in the early days, but am pleased to continue getting even more wrong.</p>
<p>With all this said, a handful of reports about recreational programming is a pretty poor basis for judging a programming language. Advent of Code was more useful as a checkup on BQN and its environment, resulting in fixes to documentation and implementation. And dzaima improved various aspects of performance as a way to cheat in speed battles with ngn/k.</p>
<p>BQN did do okay in terms of performance. At times programmers on the forum commented about having slow solutions (tens of seconds) or having to rewrite an obviously unsatisfactory algorithm. I don't think anyone mentioned having to switch languages for performance reasons, which is good news for an implementation as young as CBQN. But also not a surprise, as it's pretty fast with scalar code for an interpreter: about 10 times slower than C when I've measured it. Array code is usually faster, but can be slower. A particular problem was that in-place mutation <code><span class='Modifier2'></span><span class='Paren'>(</span><span class='Value'>i</span><span class='Modifier2'></span><span class='Function'></span><span class='Paren'>)</span></code> is only fast for very simple cases. Of course, this problem only arises because BQN's arrays are immutable, highlighting that immutable arrays, despite being perfect in every way, can be a pain. In a serious application you might be willing to endure more pain and use a mutable array object, to ensure good performance.</p>