-
Notifications
You must be signed in to change notification settings - Fork 1
/
atom.xml
4165 lines (3273 loc) · 353 KB
/
atom.xml
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
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>kivikakk.ee</title>
<link href="/atom.xml" rel="self"/>
<link href="https://kivikakk.ee/"/>
<updated>2024-11-17T12:02:33+11:00</updated>
<id>https://kivikakk.ee</id>
<author>
<name>Asherah Connor</name>
<email>[email protected]</email>
</author>
<entry>
<title>Git and jujutsu: in miniature</title>
<updated>2024-11-09T14:30:00+11:00</updated>
<id>https://kivikakk.ee/2024/11/09/git-jujutsu-miniature</id>
<link href="https://lottia.net/notes/0013-git-jujutsu-miniature.html"/>
<content type="html">A concrete example of Git and jujutsu usage compared.</content>
</entry>
<entry>
<title>Soft skills: jujutsu early feelings</title>
<updated>2024-11-07T17:55:00+11:00</updated>
<id>https://kivikakk.ee/2024/11/07/soft-skills</id>
<link href="https://lottia.net/notes/0012-soft-skills.html"/>
<content type="html">Launching into jujutsu.</content>
</entry>
<entry>
<title>Non-intrusive vtable</title>
<updated>2024-10-29T19:06:00+11:00</updated>
<id>https://kivikakk.ee/2024/10/29/non-intrusive-vtable</id>
<link href="https://lottia.net/notes/0011-non-intrusive-vtable.html"/>
<content type="html">OOP is the world's most consistently-used term in any field of any kind, ever.</content>
</entry>
<entry>
<title>Reply to email, October 15</title>
<updated>2024-10-29T00:00:00+11:00</updated>
<id>https://kivikakk.ee/2024/10/29/reply-to-email-october-15</id>
<link href="https://kivikakk.ee/2024/10/29/reply-to-email-october-15/"/>
<content type="html"><p>The sender address bounced today, so I’m just publishing my reply here. Hope you
see it! :)</p>
<hr />
<p>Hiya &lt;3</p>
<p>Thank you very much for your email; it was really lovely to receive. (Markdown
ecosystem work is not very rewarding a lot of the time, lol :p)</p>
<p>But yeah — I don’t think there’s anything in particular you could do, and
that’s quite OK! The thought by itself is enough, thank you :) Financially I’m
completely fine. So I hope you get that Clojure gig and get money to make your
own life even cooler! (Throwback to that time I wrote a
<a href="https://web.archive.org/web/20130423114048/http://rouge.io/">Clojure impl in Ruby!</a>)</p>
<p>Be well &lt;3</p>
</content>
</entry>
<entry>
<title>Peak performance</title>
<updated>2024-10-28T00:00:00+11:00</updated>
<id>https://kivikakk.ee/2024/10/28/peak-performance</id>
<link href="https://kivikakk.ee/2024/10/28/peak-performance/"/>
<content type="html"><p><img alt="A small bar graph from GitHub, titled &quot;Languages&quot;. The legend shows 81% Nix, 18.4% Shell, 0.6% HTML." src="/assets/post-img/peakperformance.png" width="336" /></p>
<p>You may not like it, but this is what peak performance looks like.</p>
</content>
</entry>
<entry>
<title>Led</title>
<updated>2024-10-13T18:13:00+11:00</updated>
<id>https://kivikakk.ee/2024/10/13/led</id>
<link href="https://kivikakk.ee/2024/10/13/led/"/>
<content type="html"><p>Content note: pain, bad mental health, health issues.</p>
<p><a href="/eesti/2024/04/11/early-nyonks/">Six months later</a>, we’re back. It’s sad — we were acclimating well,
met our neighbours, started riding all over the country, and then I started to
be in pain.</p>
<p>Any kind of pain is bad, but the body part(s) affected really define the flavour
of the impact it has, I guess, and this has been the first time I’ve had really
significant leg pain. That’s sort of underselling it; it’s sometimes in my
knees, usually ankles, feet, and though it seems like it shouldn’t be related,
also in my elbows, fingertips, and even the sides of my neck, and it all feels
very much related.</p>
<p>Still, for the most part it’s in my lower legs, and it. is. constant. I went
back on nifedipine, since a Raynaud’s “diagnosis” last year had me try that
and it sort of helped during winter. My hands and feet are always really cold,
and they were worse than usual, so I was hopeful it’d help. Estonia only had
the <a href="https://www.health.nsw.gov.au/sabs/Documents/2021-sn-001.pdf">“medium acting”</a> variant, and it felt a lot bumpier than the
modified-release ones in Australia.</p>
<p>After that didn’t help at all, it was time to see the doctor. And see the
doctor I did. And again, and again. And a physiotherapist. And an orthopaedist.
Two X-rays, two different kinds of strong anti-inflammatory, three weeks of
gabapentin, a month and a half of physio, and three months later in total and
not even the slightest improvement. Exercising didn’t help, resting didn’t help.
Ruled out referred back pain, inflammation, neuropathy, muscular.</p>
<p>Meanwhile, the time between appointments started to stretch out, I guess as
folks returned from summer holidays, and I was just miserable. I hadn’t been
able to do much of anything in a long time, and the <a href="https://lobste.rs/s/jqfp5d/what_are_you_doing_this_week#c_hihjcw">healthcare system in
Estonia</a> was really making it hard. The pain on some days made me want
to beat whichever leg was hurting into a pulp, because that somehow was more
tractable and bearable.</p>
<p>So we’re back. I’ve had some relief since, in being able to switch back to
the modified-release nifedipine, as well as get back on an antidepressant —
duloxetine, both for the general sense of despair I’ve been accumulating this
last quarter of a year (!), and for its help with ?fibromyalgia. The pain is a
little bit more distant, but it’s still there and still getting worse.</p>
<p>Finally getting some blood tests confirmed it’s not something easy (anaemia,
B12 deficiency) or obvious (cancer, RF+ RA). My money is on COVID-related
vasculopathy, but I guess it’s not so easy to confirm, deny, or help. With some
amazing luck, I managed to score an early rheumatologist appointment (someone
had just cancelled), which then got bumped forward another week, so that’s now
tomorrow.</p>
<p>I can’t particularly have my hopes up — we’re up to 4 months now since this
started to intrude on my life. <a href="/2016/08/22/illness-1.html">Last time I had a new chronic illness</a>, it took more than a year for it to start subsiding regularly enough that
I could start to believe it might abate entirely. (It came back for months at a
time, years later.)</p>
<p>And unlike that time, this one isn’t only in my head: my legs and feet are
increasingly randomly surfacing bruises that don’t clear up for <em>months</em> at
a time. A few days ago while out to therapy, there was a particularly sharp
ache across the top of my left foot, and when I got home, I took my shoe off
and found that a vein had just turned completely black in a spot right there.
There’s a blue patch on the back of my right leg (the one that hurts less on
average!) that hasn’t gone away in the whole four months. And as my doctor here
said, it’s entirely possible that at the end of all our investigations, I’ll
still have this pain to manage, maybe indefinitely.</p>
<p>Which, y’know? That kind of thing just happens in life.</p>
</content>
</entry>
<entry>
<title>RSS autodiscovery</title>
<updated>2024-10-13T00:00:00+11:00</updated>
<id>https://kivikakk.ee/2024/10/13/rss-autodiscovery</id>
<link href="https://kivikakk.ee/2024/10/13/rss-autodiscovery/"/>
<content type="html"><p>It’s come to my attention that some folks don’t know my blog has an <a href="https://kivikakk.ee/atom.xml">RSS feed</a>!
This is kind of astonishing to me as it suggests people actually manually check
blogs for new posts sometimes?!</p>
<p>At any rate, it does, it’s just not linked anywhere explicitly — but it is
supported via <a href="https://dri.es/rss-auto-discovery">RSS autodiscovery</a>, which I just kind of .. assumed everyone
used, relied on, knew about? But apparently not!</p>
<p>I guess I’ll add a link, just in case. :)</p>
</content>
</entry>
<entry>
<title>Tüüpiautomaat: automated testing of a compiler and target against each other</title>
<updated>2024-08-06T00:00:00+10:00</updated>
<id>https://kivikakk.ee/zig/2024/08/06/tüüpiautomaat</id>
<link href="https://kivikakk.ee/zig/2024/08/06/t%C3%BC%C3%BCpiautomaat/"/>
<content type="html"><p>I’m currently working on a bit of a <a href="https://github.com/charlottia/ava">long-winded project</a> to recapture
<a href="https://en.wikipedia.org/wiki/QuickBASIC">QuickBASIC</a>, the environment I learned to program in, in a bit of
a novel way, while remaining highly faithful to the original. (I actually
started a related project <a href="https://github.com/kivikakk/kyuubey">9 years ago</a> (!), and I’ll be able to reuse
some of what I did back then!)</p>
<p>The new project involves compiling the BASIC down into a bytecode suitable for
a stack machine, and an implementation of such a stack machine. Importantly,
there’ll soon be a second implementation which runs on a different architecture
entirely: namely, it’ll be an implementation <em>of</em> this architecture on an FPGA.
So the machine needs to be reasonably easy to implement in hardware — if it
simplifies the gateware design, I’ll happily take tradeoffs that involve making the
compiler more complicated, or the ISA more verbose.</p>
<p>The ISA started out with opcodes like:</p>
<div class="language-zig highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">pub</span> <span class="k">const</span> <span class="n">Opcode</span> <span class="o">=</span> <span class="k">enum</span><span class="p">(</span><span class="kt">u8</span><span class="p">)</span> <span class="p">{</span>
<span class="n">PUSH_IMM_INTEGER</span> <span class="o">=</span> <span class="mi">0x01</span><span class="p">,</span>
<span class="n">PUSH_IMM_LONG</span> <span class="o">=</span> <span class="mi">0x02</span><span class="p">,</span>
<span class="n">PUSH_IMM_SINGLE</span> <span class="o">=</span> <span class="mi">0x03</span><span class="p">,</span>
<span class="n">PUSH_IMM_DOUBLE</span> <span class="o">=</span> <span class="mi">0x04</span><span class="p">,</span>
<span class="n">PUSH_IMM_STRING</span> <span class="o">=</span> <span class="mi">0x05</span><span class="p">,</span>
<span class="n">PUSH_VARIABLE</span> <span class="o">=</span> <span class="mi">0x0a</span><span class="p">,</span>
<span class="c">// [...]</span>
<span class="n">OPERATOR_ADD</span> <span class="o">=</span> <span class="mi">0xd0</span><span class="p">,</span>
<span class="n">OPERATOR_MULTIPLY</span> <span class="o">=</span> <span class="mi">0xd1</span><span class="p">,</span>
<span class="n">OPERATOR_NEGATE</span> <span class="o">=</span> <span class="mi">0xd2</span><span class="p">,</span>
<span class="c">// [...]</span>
<span class="p">};</span>
</code></pre></div></div>
<p>For the binary operations, the stack machine would pop off two elements, and then
look at the types of those elements to determine how to add them. This is easy to
do in Zig, but this is giving our core a lot of work to do — especially when we
consider how extensive the rules involved are:</p>
<p><img src="/assets/post-img/typeconversions.png" alt="Screenshot of QuickBASIC 4.5 open to the &quot;Type Conversions&quot; help page.
It's scrolled some way down and yet the screen is full of text describing how
operands are converted to the same degree of precision, and further how result
types may affect that." /></p>
<p>Ideally, the executing machine doesn’t <em>ever</em> need to check the type of a value
on the stack before doing something with it — the bytecode itself can describe
whatever needs to happen instead.</p>
<p>In other words, when compiling this<sup id="fnref:highlighting" role="doc-noteref"><a href="#fn:highlighting" class="footnote" rel="footnote">1</a></sup>:</p>
<div class="language-zig highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">a</span><span class="o">%</span> <span class="o">=</span> <span class="mi">42</span> <span class="err">'</span> <span class="n">This</span> <span class="n">is</span> <span class="n">an</span> <span class="n">INTEGER</span> <span class="p">(</span><span class="o">-</span><span class="mi">32768</span><span class="o">..</span><span class="mi">32767</span><span class="p">).</span>
<span class="py">b</span><span class="o">&amp;</span> <span class="o">=</span> <span class="mi">32800</span> <span class="err">'</span> <span class="n">This</span> <span class="n">is</span> <span class="n">a</span> <span class="n">LONG</span> <span class="p">(</span><span class="o">-</span><span class="mi">2147483648</span><span class="o">..</span><span class="mi">2147483647</span><span class="p">).</span>
<span class="py">c</span><span class="o">%</span> <span class="o">=</span> <span class="n">b</span><span class="o">&amp;</span> <span class="o">-</span> <span class="n">a</span><span class="o">%</span> <span class="err">'</span> <span class="n">This</span> <span class="n">should</span> <span class="n">result</span> <span class="n">in</span> <span class="n">c</span><span class="o">%</span> <span class="o">=</span> <span class="mi">32758</span><span class="p">.</span> <span class="py">A</span> <span class="n">smaller</span> <span class="n">a</span><span class="o">%</span> <span class="n">would</span> <span class="n">result</span> <span class="n">in</span> <span class="n">overflow</span><span class="o">.</span>
</code></pre></div></div>
<p>… instead of having an op stream like this:</p>
<div class="language-zig highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">PUSH_IMM_INTEGER</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">PUSH_IMM_LONG</span><span class="p">(</span><span class="mi">32800</span><span class="p">)</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">PUSH_VARIABLE</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">PUSH_VARIABLE</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">OPERATOR_SUBTRACT</span> <span class="c">// runtime determines it must promote RHS and do LONG subtraction</span>
<span class="n">CAST_INTEGER</span> <span class="c">// runtime determines it has a LONG to demote</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre></div></div>
<p>— and so leaving the runtime environment to decide when to promote, or demote,
or coerce, and when to worry about under/overflow — we instead have this:</p>
<div class="language-zig highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">PUSH_IMM_INTEGER</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">PUSH_IMM_LONG</span><span class="p">(</span><span class="mi">32800</span><span class="p">)</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">PUSH_VARIABLE</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="n">PUSH_VARIABLE</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">PROMOTE_INTEGER_LONG</span> <span class="c">// compiler knows we're about to do LONG subtraction</span>
<span class="n">OPERATOR_SUBTRACT_LONG</span>
<span class="n">COERCE_LONG_INTEGER</span> <span class="c">// compiler knows we're assigning to an INTEGER</span>
<span class="n">LET</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre></div></div>
<p>A proliferation of opcodes results, but crucially it means most operations
execute unconditionally, resulting in a far simpler design when it comes to
putting this on a chip.</p>
<p>The upshot of this design, however, is that the compiler needs a far greater degree
of awareness and ability:</p>
<ul>
<li>
<p>It needs to be aware of what types the arguments to the binary operation are.</p>
<p>In the example above, we have a LONG and an INTEGER. This appears trivial, but
we need to keep in mind that the arguments can be arbitrary expressions.</p>
<p>We need this in order to determine the opcode that gets emitted for the
operation, and to know if any operand reconciliation is necessary.</p>
</li>
<li>
<p>It needs to be able to reconcile different types of operands, where necessary.</p>
<p>BASIC’s rules here are simple: we coerce the lesser-precision
value to the greater precision. In effect the rule is
INTEGER &lt; LONG &lt; SINGLE &lt; DOUBLE.</p>
<p>STRING is not compatible with any other type — there’s no <nobr><code>"x" * 3 = "xxx"</code></nobr> here.</p>
</li>
<li>
<p>It needs to be aware of what type a binary operation’s result will be in.</p>
<p>I started out with the simple rule that the result will be of the same type
of the (reconciled) operands. This worked fine when I just had addition,
subtraction and multiplication; above, we add a LONG and an INTEGER, the INTEGER
gets promoted to a LONG, and the result is a LONG.</p>
<p>Division broke this assumption, and resulted in the motivation for this
write-up.</p>
</li>
<li>
<p>It needs to be able to pass that information up the compilation stack.</p>
<p>Having calculated the result is a LONG, we need to return that information to
the procedure that compiled this expression, as it may make decisions based
on what’s left on the stack after evaluating it — such as in the first
dot-point here, or when assigning to a variable (which may be of any type, and
so require a specific coercion).</p>
</li>
</ul>
<p>This all kind of Just Worked, right up until I implemented division. I
discovered QuickBASIC actually has floating <em>and</em> integer division! Young me
was not aware of the backslash “<code class="language-plaintext highlighter-rouge">\</code>” operator (or any need for it, I suppose).
Floating division always returns a floating-point number, even when the inputs
are integral. Integer division always returns an integral, even when the inputs
are floating. The precision of the types returned in turn depends on that of the
input types.</p>
<table>
<thead>
<tr>
<th style="text-align: right">operands</th>
<th style="text-align: right">fdiv “<code class="language-plaintext highlighter-rouge">/</code>”</th>
<th style="text-align: right">idiv “<code class="language-plaintext highlighter-rouge">\</code>”</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right">INTEGER</td>
<td style="text-align: right">SINGLE</td>
<td style="text-align: right">INTEGER</td>
</tr>
<tr>
<td style="text-align: right">LONG</td>
<td style="text-align: right">DOUBLE</td>
<td style="text-align: right">LONG</td>
</tr>
<tr>
<td style="text-align: right">SINGLE</td>
<td style="text-align: right">SINGLE</td>
<td style="text-align: right">INTEGER</td>
</tr>
<tr>
<td style="text-align: right">DOUBLE</td>
<td style="text-align: right">DOUBLE</td>
<td style="text-align: right">LONG</td>
</tr>
</tbody>
</table>
<p><center><em>Output types of each division operation given (reconciled) input type.</em></center></p>
<p>This presented a problem for the existing compiler, which assumed the result
would be the same type of the operands: having divided two INTEGERs, for
example, the bytecode emitted <em>assumed</em> there would be an INTEGER left on the
stack, and so further emitted code would carry that assumption.</p>
<p>Upon realising how division was supposed to work, the first place I made the
change was in the actual stack machine: correct the behaviour by performing
floating division when floating division was asked for, regardless of the
operand type. Thus dividing two INTEGERs pushed a SINGLE. The (Zig) machine then
promptly asserted upon hitting any operation on that value at all, expecting an
INTEGER there instead. (The future gateware implementation would probably not
assert, and instead produce confusing garbage.)</p>
<p>And so opened up a new kind of bug to look out for: a mismatch between (a)
the assumptions made by the compiler about the effects on the stack of the
operations it was emitting, and (b) the actual effects on the stack produced by
those operations running on the stack machine.</p>
<p>Rather than just some isolated tests (though short of creating some whole
contract interface between compiler and machine — maybe later), why not be
thorough while using the best witness for behaviour there is? Namely, the
compiler and stack machine themselves:</p>
<div class="language-zig highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">test</span> <span class="s">"compiler and stack machine agree on binop expression types"</span> <span class="p">{</span>
<span class="k">for</span> <span class="p">(</span><span class="n">std</span><span class="p">.</span><span class="py">meta</span><span class="p">.</span><span class="nf">tags</span><span class="p">(</span><span class="n">Expr</span><span class="p">.</span><span class="py">Op</span><span class="p">))</span> <span class="p">|</span><span class="n">op</span><span class="p">|</span> <span class="p">{</span>
<span class="k">for</span> <span class="p">(</span><span class="n">std</span><span class="p">.</span><span class="py">meta</span><span class="p">.</span><span class="nf">tags</span><span class="p">(</span><span class="n">ty</span><span class="p">.</span><span class="py">Type</span><span class="p">))</span> <span class="p">|</span><span class="n">tyLhs</span><span class="p">|</span> <span class="p">{</span>
<span class="k">for</span> <span class="p">(</span><span class="n">std</span><span class="p">.</span><span class="py">meta</span><span class="p">.</span><span class="nf">tags</span><span class="p">(</span><span class="n">ty</span><span class="p">.</span><span class="py">Type</span><span class="p">))</span> <span class="p">|</span><span class="n">tyRhs</span><span class="p">|</span> <span class="p">{</span>
<span class="k">var</span> <span class="n">c</span> <span class="o">=</span> <span class="k">try</span> <span class="n">Compiler</span><span class="p">.</span><span class="nf">init</span><span class="p">(</span><span class="n">testing</span><span class="p">.</span><span class="py">allocator</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
<span class="k">defer</span> <span class="n">c</span><span class="p">.</span><span class="nf">deinit</span><span class="p">();</span>
<span class="k">const</span> <span class="n">compilerTy</span> <span class="o">=</span> <span class="n">c</span><span class="p">.</span><span class="nf">compileExpr</span><span class="p">(</span><span class="o">.</span><span class="p">{</span> <span class="p">.</span><span class="py">binop</span> <span class="o">=</span> <span class="o">.</span><span class="p">{</span>
<span class="p">.</span><span class="py">lhs</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">Expr</span><span class="p">.</span><span class="nf">init</span><span class="p">(</span><span class="n">Expr</span><span class="p">.</span><span class="py">Payload</span><span class="p">.</span><span class="nf">oneImm</span><span class="p">(</span><span class="n">tyLhs</span><span class="p">),</span> <span class="o">.</span><span class="p">{}),</span>
<span class="p">.</span><span class="py">op</span> <span class="o">=</span> <span class="n">loc</span><span class="p">.</span><span class="nf">WithRange</span><span class="p">(</span><span class="n">Expr</span><span class="p">.</span><span class="py">Op</span><span class="p">).</span><span class="nf">init</span><span class="p">(</span><span class="n">op</span><span class="p">,</span> <span class="o">.</span><span class="p">{}),</span>
<span class="p">.</span><span class="py">rhs</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">Expr</span><span class="p">.</span><span class="nf">init</span><span class="p">(</span><span class="n">Expr</span><span class="p">.</span><span class="py">Payload</span><span class="p">.</span><span class="nf">oneImm</span><span class="p">(</span><span class="n">tyRhs</span><span class="p">),</span> <span class="o">.</span><span class="p">{}),</span>
<span class="p">}</span> <span class="p">})</span> <span class="k">catch</span> <span class="p">|</span><span class="n">err</span><span class="p">|</span> <span class="k">switch</span> <span class="p">(</span><span class="n">err</span><span class="p">)</span> <span class="p">{</span>
<span class="n">Error</span><span class="p">.</span><span class="py">TypeMismatch</span> <span class="o">=&gt;</span> <span class="k">continue</span><span class="p">,</span> <span class="c">// keelatud eine</span>
<span class="k">else</span> <span class="o">=&gt;</span> <span class="k">return</span> <span class="n">err</span><span class="p">,</span>
<span class="p">};</span>
<span class="k">var</span> <span class="n">m</span> <span class="o">=</span> <span class="n">stack</span><span class="p">.</span><span class="nf">Machine</span><span class="p">(</span><span class="n">stack</span><span class="p">.</span><span class="py">TestEffects</span><span class="p">).</span><span class="nf">init</span><span class="p">(</span>
<span class="n">testing</span><span class="p">.</span><span class="py">allocator</span><span class="p">,</span>
<span class="k">try</span> <span class="n">stack</span><span class="p">.</span><span class="py">TestEffects</span><span class="p">.</span><span class="nf">init</span><span class="p">(),</span>
<span class="kc">null</span><span class="p">,</span>
<span class="p">);</span>
<span class="k">defer</span> <span class="n">m</span><span class="p">.</span><span class="nf">deinit</span><span class="p">();</span>
<span class="k">const</span> <span class="n">code</span> <span class="o">=</span> <span class="k">try</span> <span class="n">c</span><span class="p">.</span><span class="py">buf</span><span class="p">.</span><span class="nf">toOwnedSlice</span><span class="p">(</span><span class="n">testing</span><span class="p">.</span><span class="py">allocator</span><span class="p">);</span>
<span class="k">defer</span> <span class="n">testing</span><span class="p">.</span><span class="py">allocator</span><span class="p">.</span><span class="nf">free</span><span class="p">(</span><span class="n">code</span><span class="p">);</span>
<span class="k">try</span> <span class="n">m</span><span class="p">.</span><span class="nf">run</span><span class="p">(</span><span class="n">code</span><span class="p">);</span>
<span class="k">try</span> <span class="n">testing</span><span class="p">.</span><span class="nf">expectEqual</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">m</span><span class="p">.</span><span class="py">stack</span><span class="p">.</span><span class="py">items</span><span class="p">.</span><span class="py">len</span><span class="p">);</span>
<span class="k">try</span> <span class="n">testing</span><span class="p">.</span><span class="nf">expectEqual</span><span class="p">(</span><span class="n">m</span><span class="p">.</span><span class="py">stack</span><span class="p">.</span><span class="py">items</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="k">type</span><span class="p">(),</span> <span class="n">compilerTy</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>
<p>We go as follows:</p>
<ul>
<li>
<p>For all binary operations, enumerate all permutations of left- and right-hand
side types.</p>
</li>
<li>
<p>For each such triple, try compiling the binary operation with the “one”-value<sup id="fnref:one" role="doc-noteref"><a href="#fn:one" class="footnote" rel="footnote">2</a></sup>
of each type as its operands. (For integrals, it’s literally the number one.)</p>
<ul>
<li>
<p>If we get a type error from this attempt, skip it — we don’t care that we can’t
divide a DOUBLE by a STRING, or whatever.</p>
</li>
<li>
<p>If not, the <code class="language-plaintext highlighter-rouge">compileExpr</code> method returns to us the type of what it believes
the result to be. This is the same information used elsewhere in the
compiler to guide opcode and coercion decisions.</p>
</li>
</ul>
</li>
<li>
<p>Create a stack machine, and run the compiled code.</p>
<ul>
<li>Seeing as we didn’t actually compile a full statement, we expect the result
of the operation to be left sitting on the stack. (Normally a statement
would ultimately consume what’s been pushed.)</li>
</ul>
</li>
<li>
<p>Assert that the type of the runtime value left on the stack is the same as
what the compiler expects!</p>
</li>
</ul>
<p>I love how much this solution takes care of itself. While it lacks the
self-descriptive power of a more coupled approach to designing the compiler and
runtime, it lets the implementations remain quite clear and straightforward to
read. It also lets them stand alone, which is handy when a second implementation
of the runtime part is forthcoming, and is (by necessity) in a completely
different language environment.</p>
<p>There was greater value than just from floats, of course: relational operators
like equal “<code class="language-plaintext highlighter-rouge">=</code>”, not equal “<code class="language-plaintext highlighter-rouge">&lt;&gt;</code>”, etc. all return INTEGERs 0 or -1, but
can operate with any combination of numeric types, or with pairs of STRINGs.
Bitwise operators like <code class="language-plaintext highlighter-rouge">AND</code>, <code class="language-plaintext highlighter-rouge">OR</code>, <code class="language-plaintext highlighter-rouge">XOR</code>, <code class="language-plaintext highlighter-rouge">IMP</code> (!), etc. can operate with any
combination of numeric types, but coerce any floats to integrals before doing
so. I bet there’ll be more to uncover, too.</p>
<p>Hope this was fun to read!</p>
<div class="footnotes" role="doc-endnotes">
<ol>
<li id="fn:highlighting" role="doc-endnote">
<p>I will get some real BASIC highlighting up here by the next
post on this! <a href="#fnref:highlighting" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
</li>
<li id="fn:one" role="doc-endnote">
<p>I first used each type’s zero value, but then we get division by zero errors while trying
to execute the code! <a href="#fnref:one" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
</li>
</ol>
</div>
</content>
</entry>
<entry>
<title>Kalakarp</title>
<updated>2024-07-27T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/27/kalakarp</id>
<link href="https://kivikakk.ee/2024/07/27/kalakarp/"/>
<content type="html"><p><img src="/assets/post-img/kalakarp.png" alt="" /></p>
<p>Feeling very seen by fish today.</p>
</content>
</entry>
<entry>
<title>Ravimid</title>
<updated>2024-07-26T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/26/ravimid</id>
<link href="https://kivikakk.ee/2024/07/26/ravimid/"/>
<content type="html"><p>Reviewing all the medications I’ve ever been on. This will be intensely specific to my experiences;
YMMV! Content note: mentions of mental illness, suicidal feelings, assault, sex.</p>
<h2 id="mental-health-ish">mental health(-ish)</h2>
<ul>
<li>escitalopram
<ul>
<li>A day or two after starting it I felt like the world had colour in it again for the first time.</li>
<li>Not very effective for anything other than “light depression” (?) imo.</li>
<li>Prescribed initially for depression/I’m 23 And Life Is Generally Hard, was on it for two years.</li>
<li>Later prescribed in an attempt to counter chronic idiopathic nausea, to no effect.</li>
</ul>
</li>
<li>quetiapine
<ul>
<li>Wow! I didn’t know what “suicidal compulsion” actually felt like until I took my first dose.
That was also my last dose.</li>
</ul>
</li>
<li>desvenlafaxine
<ul>
<li>Going up from 100mg to 200mg, I’d just stop knowing how to form sentences halfway through them.</li>
<li>Effective on moderate GAD-type symptoms.</li>
<li>Coming off it was, contrary to all expectations, pretty uneventful. Except that for about three
weeks, all I could smell was blood, with no apparent source.</li>
</ul>
</li>
<li>brexpiprazole
<ul>
<li>If you close your eyes, you will fall asleep. At any time.</li>
<li>Definitely calm.</li>
<li>Much too sleepy to continue, but it definitely brought me down after increasingly intensifying
distress post-sexual assault.</li>
<li>As with any antipsychotic/dopamine antagonist, <a href="https://en.wikipedia.org/wiki/Tardive_dyskinesia">not particularly inclined</a> to remain on one
for any longer period of time.</li>
<li>
<p>At the time I was put on it, the <em>only</em> article in the literature about it had the (actually!)
reassuring title: <a href="https://pubmed.ncbi.nlm.nih.gov/26913177/">“Brexpiprazole: so far so good”</a>.</p>
</li>
</ul>
</li>
<li>lamotrigine
<ul>
<li>Unclear whether I felt much of anything on this, even after three years at 200mg.</li>
<li>Coming off it: ANGER. Wow. (Remember to titrate; SJS can be triggered both on increase and
decrease, apparently.)</li>
<li>After coming off it: oh my goodness I suddenly feel like being creative again.</li>
</ul>
</li>
<li>mirtazapine
<ul>
<li>eeeeeeeepy and hunnnnggggy.</li>
<li>Extremely and rapidly effective with chronic idiopathic nausea. <em>Nothing</em> else worked.</li>
<li>Weight gain pretty woof. That said, the weight I gained on it, I managed to drop while still on
it.</li>
<li>I don’t remember if I maxed out at 30mg or 45mg — at higher doses the dissociation made
memory very wonky.</li>
<li>Discontinuation meant a lot of rebound nausea and anxiety. It took me about 4 attempts, over
several years, with various titration schedules; the successful attempt was just dropping from
a sustained 15mg to 0. Trying to step it down at 7.5mg only prolonged the unpleasantness and
resulted in aborting the attempt — subtherapeutic but side-effects remain.</li>
</ul>
</li>
<li>duloxetine
<ul>
<li>Really pleasant and noticeable, even at 30mg. Everything feels a bit lighter, and mild
neuropathy totally neutralised.</li>
<li>Night sweats :( Became intolerable not long after increasing to 60mg, and didn’t subside after
reducing again.</li>
<li>Discontinuation was reasonably uneventful; (manageably) shorterer temper and very mild nausea.</li>
</ul>
</li>
<li>gabapentin
<ul>
<li>I just started this! Early effects for neuropathy are promising. Slightly dissociative/floaty.</li>
<li>Was always curious about gabapentin/pregabalin since I first started having noticeable anxiety,
so I’m glad I’ve gotten to try it. Definitely somewhat calming.</li>
</ul>
</li>
<li>diazepam
<ul>
<li>It is what it is.</li>
<li>Avoid taking on an empty stomach if you’re having issues with nausea — it can get so much
worse.</li>
<li>I treat it with extreme caution. I’ve read so many personal horror stories about benzodiazepine
dependence and it takes a really bad time for me to consider taking even 2.5mg. I’ll go up to
5mg if need be, but in general would refuse to take it if I’ve had any separate dose within the
last week.</li>
<li>For the above reason, despite having been in some very bad places (where doctors were
prescribing it in larger quantities at a time), I’ve maybe taken 100mg total over the last
decade. Just not worth the risk.</li>
<li>Even less inclined to if I’ve taken stimulants on the same day, but I’ve only ever once
(namely, in a life-threatening situation) had to even consider diazepam since getting medicated
for ADHD 2 years ago. Funny how that works!</li>
</ul>
</li>
<li>temazepam
<ul>
<li>Not a fan; taken a handful of times ever, mostly at music festivals.</li>
<li>I have chronic insomnia and this is just not any part of an answer to it.</li>
</ul>
</li>
</ul>
<h2 id="adhd">ADHD</h2>
<ul>
<li>dextroamphetamine
<ul>
<li>Current weapon of choice. Calm, alert, focussed.</li>
<li>Latent anxiety is reduced a lot, probably because it lets me have some agency in my own head.</li>
<li>My doctor gradually increased my dose to 10mg, 4 times a day. This is absolutely fucking nuts.
Don’t do that.</li>
<li>After 1.5 years I’ve settled on 2.5mg, twice a day at a 4 hour interval, and it’s completely
adequate.</li>
<li>If I’m having a very long day, a third dose is fine too. 2.5mg doses are very light.</li>
<li>For a long while there I was finding myself increasing my dose by 2.5mg or 5mg (per day) every
week or so since the tolerance builds so rapidly. You will deplete every last monoamine you
have like this. I managed to tolerate 40mg/day (after a buildup) for about two days before I
crashed. Do Not.</li>
<li>Sometimes 2.5mg doses can feel a little bit <em>too</em> light, but my health right now is such that
increasing even just one of the doses leaves me feeling empty the next day. I’m glad to have
something that works.</li>
<li>Small doses is also good because I’ve yet to see a psychiatrist in Estonia to get a
prescription here, so I’m working through my stock from Australia very slowly. As far as I can
tell, currently authorised dextroamphetamine products <a href="https://www.ravimiregister.ee/publichomepage.aspx?pv=PublicMedDetail&amp;vid=988182bb-38b5-4201-bc1f-8ec0eeb820fb">haven’t been imported to Estonia</a>,
so it’s unclear how easy it’d be to access it.</li>
<li>There’s <a href="https://www.ravimiregister.ee/publichomepage.aspx?pv=PublicMedDetail&amp;vid=7e33f799-6b5e-402f-b654-cda2d0e5fe66">this one</a>, but it’s only available in 10mg? And searching for it online shows up
something with the same name, but it’s <a href="https://www.google.com/search?hl=en&amp;q=attentin+10mg&amp;udm=2">atomoxetine</a> instead? Very suss on that.</li>
</ul>
</li>
<li>lisdexamfetamine
<ul>
<li>Hrrrrrrr. Not a fan.</li>
<li>Something about this leaves me feeling depleted at any effective dose. I think I like the
little humps I get between dex doses — lisdex is just exhausting, and an absolute pain if you
wake up late.</li>
<li>30mg? Not enough to feel anything — too spread out.</li>
<li>40mg? I kinda feel something. It’s a bit eh.</li>
<li>50mg? Yeah, okay, maybe this starts to feel like I’m having an OK dose of dex — I can think,
focus, actually listen to people when they talk to me. I feel like I am spread very thin.</li>
<li>60–70mg? Effective — wired — but also I start sleeping longer and longer because of how
exhausted it leaves me, making my doses later and later, in turn fucking up my sleep schedule;
not to mention the pervasive sense of Bad that starts to accumulate. No ty.</li>
<li>My god. I tried combining ~low dose lisdex with a small dex booster in the afternoon. Quick way
to know what it feels like to fry your brain. You can do all the stimulant equivalence
arithmetic you want, it just doesn’t add up that way.</li>
<li>If I was offered lisdex or nothing, it’s not clear to me that I would take it.</li>
<li>In general, I’m not sold on long-acting stimulants. I get the abuse angle (it’s what I was put
on first, for this reason), and I do read stories of folks who find it legitimately helpful —
like most others with ADHD, I regularly forget to take my stimulants — but there was no way
to make it work for me. It’s too inflexible, and there’s some (possibly fear-mongering) news
out there that suggests long-acting stimulants carry a greater risk of psychosis than
short-acting ones?</li>
</ul>
</li>
<li>methylphenidate
<ul>
<li>Very conflicted on this. (Annoying that it’s so much more readily available, especially in
Europe.)</li>
<li>
<p><a href="https://elifesciences.org/articles/68165">Possibly neuroprotective vs. an active COVID infection!</a> I was on MPH when I finally
got COVID, and was wondering if I should keep taking stimulants through a moderately bad case
of it or not. This article swayed me in favour of maintaining it:</p>
<blockquote>
<p>Remarkably, several drugs acting on receptors to neurotransmitters also appear to decrease
hospitalization risk: rizatriptan (OR=0.118, CI 0.003 to 0.750), bupropion (OR=0.399, CI
0.136 to 0.976), and methylphenidate (OR=0.444, CI 0.178 to 0.972).</p>
</blockquote>
<p>I’ll take an OR of 0.444ish. I had to argue with a doctor from the government(!) to avoid
hospitalisation, but avoid it I did.</p>
</li>
<li>I haven’t gotten a sense for how shared this is, but I get noticeable euphoria when starting on
10mg, and it makes one very inclined to up the dose when you stop getting that response after a
few days.</li>
<li>Dragon-chasing aside, MPH consistently produces a sort of global “bad” sensation that I just
cannot with. Even with the initial euphoria, it’s still noticeable — there’s just this
unpleasant but persistent background qualia, almost a certain flavour of experience. Unclear if
shared or just me.</li>
<li>All that notwithstanding, from 10mg it feels 70–80% as effective as dex at ~equivalent dose
(5mg dex ≈ 10mg MPH).</li>
<li>5mg didn’t feel like it had any impact at all, but that was a while ago, and I’d revisit it
if I had to.</li>
<li>If I was offered MPH or nothing, I would probably take it.</li>
<li>If I was offered MPH or lisdex, I would probably take MPH.</li>
</ul>
</li>
</ul>
<h2 id="vascular">vascular</h2>
<ul>
<li>propranolol
<ul>
<li>Very chill. Noticeable sensation in the chest.</li>
<li>I once had a kind of shock reaction to a piercing which resulted in a really high heart rate,
intense and sudden nausea, cold shivers all over, and me on the floor. (I find lying on a cold
hard floor fixes most things.) The next time I went for a piercing I took 10mg propranolol
before and it was easy.</li>
<li>Initially prescribed to try to combat panic disorder/idiopathic nausea. It at least brought my
heart rate down and made it possible to eat again.</li>
<li>Later took it for arrythmia on demand. Reasonable at this — would often get painful(!)
arrythmia at night which would make sleep impossible, and leave me feeling sore (and exhausted)
the whole next day. 10mg propranolol would usually convert it within half an hour.</li>
<li>100–200mg magnesium seems to work for that too.</li>
</ul>
</li>
<li>nifedipine
<ul>
<li>Certainly feel that one on starting. Not like I didn’t already have some orthostatic
hypotension …</li>
<li>Take for Raynaud’s in the Australian winter/unspecified (micro?)vascular issues. Recently my
legs have been feeling Not OK and so I’ve restarted it. Unfortunately, we don’t seem to have
the modified-release ones here, so I have to dose twice a day.</li>
<li>Doesn’t impair exercise.</li>
<li>Not to be combined with propranolol (or magnesium, possibly).</li>
</ul>
</li>
</ul>
<h2 id="gastric">gastric</h2>
<ul>
<li>esomeprazole/omeprazole
<ul>
<li>Unremarkable. Not super effective for (probably stress-induced) heartburn/reflux.</li>
<li>Was also prescribed it at one point as an attempt to help with idiopathic nausea — no
response.</li>
</ul>
</li>
<li>ondansetron
<ul>
<li>This is meant to be the Big Guns when it comes to nausea, and it did nothing for mine.</li>
<li>I was scrambling to find something that would work — it’d slowly subsided on desvenlafaxine
in the first instance, and I’d tapered off that after about a year and was all good. A
particularly bad anxiety attack provoked it into a full reoccurrence, which was terrifying. I
wasn’t inclined to retry stepping up on desvenlafaxine and waiting it out to see if it’d work
again — I felt like it might’ve also just been a matter of time, then, as it remitted only
after more than a year of (essentially constant) suffering! — so I looked for other things.</li>
<li>My research lead me to mirtazapine; <a href="https://en.wikipedia.org/wiki/Mirtazapine#Pharmacodynamics">there’s a number of different ways in which it’s
antiemetic</a>. My GP at the time was happy to prescribe it for me based on my conviction,
but wanted to try ondansetron first to see if it’d work as a circuit breaker (and thus avoid
necessitating something taken over a longer time). Alas.</li>
</ul>
</li>
</ul>
<h2 id="cannabidiol">cannabidiol</h2>
<p>Usual effects of cannabis products apply.</p>
<ul>
<li>THC oil
<ul>
<li>First trials found it to be extremely intense and disorienting.</li>
<li>Retrying years later (once I was using flower more medicinally and regularly), found it to be a
nice way to dose THC in a more controlled manner, without the usual associations that come with
vaping bud (i.e. “Time To Relax, And Perhaps Eat Much Šokolaadi.”)</li>
<li>Slower onset can be quite pleasant.</li>
</ul>
</li>
<li>CBD oil
<ul>
<li>First trials found it to make me feel generally unwell!</li>
<li>Later trials together with THC oil found it to be a nice way to dampen some aspects of the THC
high, if needed.</li>
</ul>
</li>
<li>cannabis flower
<ul>
<li>Nothing much to report here. Australian medicinal cannabis was decent, actually decent value
(per volume), and there was a reasonable variety of strains to choose from, which improved over
the years. Doctors were not inclined to gatekeep (<a href="https://www.abc.net.au/news/2024-07-21/medicinal-cannabis-psychosis-harm-risk-prescription-marijuana/104116952">perhaps concerningly so</a>) or judge.</li>
<li>Driving was a bit nerve-wracking; regular use builds up a level in the blood which can be
detected by roadside random breath tests even if you’ve not used any that day, so I was pretty
much always on alert/police-avoidance mode. It was a pretty strong deterrent, but I lived in a
public transport deadzone so there wasn’t much choice.</li>
<li><a href="https://www.abc.net.au/news/2024-05-21/victoria-medicinal-cannabis-driving-cbd-thc-explainer/103872650">This may be changing soon in Victoria!</a></li>
</ul>
</li>
</ul>
<h2 id="misc">misc</h2>
<ul>
<li>naproxen
<ul>
<li>Prescribed for leg pain which was suspected referred back pain.</li>
<li>Came in a combination form with esomeprazole because <a href="https://en.wikipedia.org/wiki/Nonsteroidal_anti-inflammatory_drug#Gastrointestinal">COX inhibitors be wild</a>.</li>
<li>No effect.</li>
</ul>
</li>
<li>tadalafil/sildenafil
<ul>
<li>Mildly effective for antiandrogen-related difficulties with penetrative sex.</li>
<li>Not a fan of the way these make my heart feel; wouldn’t opt for tadalafil again since it’s just
the same but for days instead of hours.</li>
</ul>
</li>
<li>emtricitabine+tenofovir
<ul>
<li><a href="https://en.wikipedia.org/wiki/Pre-exposure_prophylaxis_for_HIV_prevention">PrEP</a>. This is important, good stuff!</li>
<li>Mild nausea during the first two weeks of starting it, otherwise side-effect-free.</li>
<li>Been on and off it a half-dozen times over the last 8 years as my risk factors have increased
or decreased. I have nothing but good things to say about PrEP.</li>
<li>Caution while travelling; less progressive governments may infer any number of things about you
based on the medication you carry.</li>
</ul>
</li>
</ul>
<h2 id="hrt">HRT</h2>
<ul>
<li>oestradiol valerate
<ul>
<li>Standard first-line transfem primary HRT.</li>
<li>In the first few years I seemed to manage decent levels while increasing to 8mg/day, but over
time I seemed to stop being able to absorb oral oestrogen and had to switch off.</li>
<li>Not particularly sad about that: other forms are less work for my liver.</li>
</ul>
</li>
<li>oestradiol gel
<ul>
<li>Absorbs well. A little bit annoying to make your skin sticky twice a day but wycd ¯\_(ツ)_/¯</li>
<li>Seems to be widely available; the last few years have had many HRT shortages, but I’ve not had
issues with this.</li>
</ul>
</li>
<li>micronised progesterone
<ul>
<li>Preferred over synthetics (e.g. levonorgestrel) due to much reduced blood clotting risk, fewer
negative mood side-effects.</li>
<li>Helpful for sleep — take at night.</li>
<li>First time I started it, within days I was sobbing (+) while watching Frozen. Really unlocks
some emotions.</li>
<li>200-300mg is an actual recreational high (N.B.! loss of consciousness/respiratory depression
may result at extreme doses).</li>
<li>Also an antiandrogen!</li>
</ul>
</li>
<li>spironolactone
<ul>
<li>At least in Australia, first-line antiandrogen.</li>
<li>Diuretic and generally not fun. At the doses required for me, also precipitated pretty intense
low mood which abated upon discontinuation.</li>
</ul>
</li>
<li>cyproterone
<ul>
<li>Antiandrogen. Extremely effective in even tiny doses.</li>
<li>My doctor started me on 50mg a day. I don’t have a good analogy for how nuclear this is.</li>
<li>May need more initially to get levels down, but (depending on prevailing E levels) you may be
fine with 12.5 mg <strong>once a week</strong>, i.e. 3.6% of the dose I was started on.</li>
<li>Some folks report low mood on cypro; it hasn’t been an issue for me.</li>
</ul>
</li>
</ul>
</content>
</entry>
<entry>
<title>VyxOS</title>
<updated>2024-07-19T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/19/vyxos</id>
<link href="https://lottia.net/notes/0010-vyxos.html"/>
<content type="html">Nix configuration revealed!</content>
</entry>
<entry>
<title>Sada päeva</title>
<updated>2024-07-18T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/18/sada-päeva</id>
<link href="https://kivikakk.ee/2024/07/18/sada-p%C3%A4eva/"/>
<content type="html"><p>Yesterday was our 100th day in Estonia. Taking a little bit of stock of what we’ve managed:</p>
<ul>
<li>Visited the 4 largest cities in the country.</li>
<li>Rented an apartment in the biggest one!</li>
<li>Furnished what the apartment didn’t come with.</li>
<li>Shipped our things from Australia. (Maybe a month off those arriving.)</li>
<li>Got our motorcycles; put 900km on each.</li>
<li>Got medium-term visa for A, and long-term one applied for.</li>
<li>Got our medications prescribed locally.</li>
<li>Financial/bureaucratic overhead.</li>
<li>Changed my name and got new ID.</li>
<li>Got onto a good family doctor’s list.</li>
<li>Kept in touch with families and psychologists.</li>
<li>Vaccinations.</li>
<li>Saw the border.</li>
<li>Went to a cat café.</li>
<li>Went to sauna.</li>
<li>Concluded jaanipäev with clothes smelling deeply of bonfire.</li>
<li>Went to a live show (Estonian).</li>
<li>Went to a live show (non-Estonian).</li>
<li>Walked about 500km.</li>
<li>Taken a lot of public transport.</li>
<li>Met a range of people.</li>
<li>Spoken quite a bit of Estonian.</li>
<li>Kept up with projects.</li>
<li>Finished a diary!</li>
<li>Grew a lot.</li>
</ul>
</content>
</entry>
<entry>
<title>Activity period</title>
<updated>2024-07-09T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/09/activity-period</id>
<link href="https://kivikakk.ee/2024/07/09/activity-period/"/>
<content type="html"><p><img src="/assets/post-img/eesti/activityperiod.png" alt="Screenshot of a website. The title is &quot;Activity period&quot;. Text underneath reads: &quot;The sole proprietor may notify the registrar in advance of the suspension of activities, temporary activities or set periods of seasonal activities. Below that is a timeline with &quot;2024&quot; underneath it, and 12 points marked along the timeline. All 12 points have the legend &quot;Invalid Date&quot;." /></p>
</content>
</entry>
<entry>
<title>Time travel</title>
<updated>2024-07-06T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/07/06/time-travel</id>
<link href="https://lottia.net/notes/0008-time-travel.html"/>
<content type="html">The typical hypothetical “who are you coding for” example meant to shock you into writing better code is “yourself in six months”, but it turns out four is completely adequate to get lost.</content>
</entry>
<entry>
<title>Python still surprises</title>
<updated>2024-06-27T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/06/27/python-still-surprises</id>
<link href="https://kivikakk.ee/2024/06/27/python-still-surprises/"/>
<content type="html"><p>After the better part of 20 years working with Python, it still managed to
surprise me today.</p>
<p>I’m so used to languages treating <code class="language-plaintext highlighter-rouge">x += y</code> et al. as pure sugar for <code class="language-plaintext highlighter-rouge">x = x + y</code>
that it skipped my mind that some don’t.</p>
<p>I’m not surprised that you <em>can</em> override them separately in some languages (e.g.
I simply assume this to be the case in C++, and on checking it turns out to
be true — but that seems fair enough given the scope of the language), but I
really am so accustomed to them being only sugar in Ruby that I assumed the same
would hold, at least in effect, in Python.</p>
<p>Thus my surprise on <code class="language-plaintext highlighter-rouge">some_list += x</code> modifying <code class="language-plaintext highlighter-rouge">some_list</code> in place (unlike
<code class="language-plaintext highlighter-rouge">some_list = some_list + x</code>), but once observed, I realised there’d be a
separately-overridden operator function — namely <code class="language-plaintext highlighter-rouge">__iadd__</code> — and so I
figured it “had” to be that way.</p>
<p>Or did it? I then found myself assuming it’s because these operators can’t
actually reassign the receiver, but in fact they can and do: the return value is
what’s assigned to the LHS. So it’s just a matter of convention.</p>
</content>
</entry>
<entry>
<title>sint</title>
<updated>2024-06-22T00:00:00+10:00</updated>
<id>https://kivikakk.ee/2024/06/22/sint</id>
<link href="https://kivikakk.ee/2024/06/22/sint/"/>
<content type="html"><p>Notes.app, kell 08:03:</p>
<blockquote>
<p>my new theory is that satan Crept into this world through signed integers</p>
</blockquote>
</content>
</entry>
<entry>
<title>zxxrtl</title>
<updated>2024-06-17T00:00:00+10:00</updated>
<id>https://kivikakk.ee/digital/2024/06/17/zxxrtl</id>
<link href="https://kivikakk.ee/digital/2024/06/17/zxxrtl/"/>
<content type="html"><p>I’ve been getting back into using <a href="https://yosyshq.readthedocs.io/projects/yosys/en/latest/cmd/write_cxxrtl.html">CXXRTL</a> and <a href="https://ziglang.org">Zig</a> together, so I’ve extracted
and rendered somewhat reusable the bindings I made to use them together!</p>
<p><a href="https://github.com/kivikakk/zxxrtl">zxxrtl</a> uses CXXRTL’s C API to provide a somewhat idiomatic way to access,
manipulate, and respond to events happening in the design. Its README covers the
setup — it’s a bit involved as it’s necessarily something of a build system,
but once you’re done it’s good to go and flexible enough to be instrumented from
a higher build system.</p>