HackerTrans
TopNewTrendsCommentsPastAskShowJobs

CoderPuppy

no profile record

comments

CoderPuppy
·4 वर्ष पहले·discuss
SML doesn't have subtyping or variance AFAIK so that can't really explain the issue. The way I like to look at it is to translate to System F. The standard translation would give:

    let m : ∀α. ref (α → α) = Λα. ref [α → α] (λx. x)
    in
      (m [bool]) := not;
      print ((!(m [int])) 23)
    end
This actually has different behavior because the ref allocation is under a big lambda (Λ). Each time it is applied it would generate a new ref cell. So it would generate a `ref (bool → bool)` starting with `λx. x` and assign `not` to it. Then generate a separate `ref (int → int)` (again starting with `λx. x`) and dereference and apply it. Thus this would print `23`.

(The naive model of) SML runs into problems because it erases the big lambdas and so evaluates `Λα. ref [α → α] (λx. x)` to a single ref cell of type `∀α. ref (α → α)`

Sidenote: Variance does have some relation here, I couldn't think of a way to trigger bad behavior without a type that uses the type variable invariantly.
CoderPuppy
·5 वर्ष पहले·discuss
I had an idea a little while ago: constantly rewriting code. It was inspired by the idea of doing something repeatedly allows you to improve. So constantly rewriting the same bit of code (with changes) would allow you to get better at writing that sort of code (or solving that sort of problem). Every time you'd end up doing it slightly differently and learning something.

I also came up with a different idea along the same lines while writing this comment. Weakening it to rewriting code regularly (instead of constantly) and adding a (rough) time limit. A reasonable time limit could be anywhere from a day to a week. I think it'd work like this: you'd build a project for the first time (in a few days) and use it for things. Later when you find a problem with it, you'd return and rewrite the whole thing (again in just a few days). I think the combination of rewriting from scratch and a time limit would limit the complexity of each project. One thing I haven't fleshed out yet is how to limit the depth/complexity of dependency chains.
CoderPuppy
·5 वर्ष पहले·discuss
For math symbols I use Unicode characters, I have XCompose shortcuts [0] to easily insert them. I'm currently using WinCompose to use the same shortcuts on Windows. This works fairly well for my use cases (programming language theory and undergrad math), but doesn't support the fancy layouts that LaTeX does (fractions, large sub/superscripts).

I don't have a good solution for graphs/pictures/drawings. I don't think I've ever needed to, if I did I think I would just put the image in a folder alongside the note (`YYYY-MM-DD-ext`).

[0] https://github.com/CoderPuppy/.files/blob/master/XCompose
CoderPuppy
·5 वर्ष पहले·discuss
My personal note taking system is based around plain text files in Git repositories. I edit with NeoVIM and use ripgrep (and other shell tools) to recall. I started out (in 2014 or 2015) with a wiki-like style, but I switched to a time-based/append-only style (in 2019) when I realized that not everything that I wanted to write down needed its own name. I still use some remnants of the old wiki style, but I mostly use a few append-only files/folders.

I have `scratch` where I'll write just about anything, it has upcoming tasks, my current place in TV shows, juggling patterns, math problems, and drafts (including this message). Many things in it are unlabeled and I often delete things from it, relying on Git to store the history. I have `viewed-topics` which lists things (HN/Reddit threads, papers, talks) I've read/watched with a summary, my thoughts and related things from the past. Last I have dated notes (files named `YYYY-MM-DD`) where I write things that happened, philosophical rambles, mental constructions, shower thoughts, etc. Often these will reference previous notes.

I've been thinking about how to improve this for a while because it doesn't handle "updates" to old notes well. I currently have three ways I do it: (1) copy then change (with a reference), (2) append in place with a marker (WRITTEN YYYY-MM-DD), or (3) new note with just changes (and a reference). Each has problems, (1) makes seeing changes difficult, (2) is impure and can make it hard to find by date, and (3) makes seeing the "current" version difficult. I relate this to version control, particularly the tradeoff between (1) and (3). Git allows seeing both diffs and states fairly easily, but it doesn't track bits of text between files well enough. I've thought about it off and on but always manage to confuse myself without producing any solutions.

TL;DR I greatly agree but want better updates
CoderPuppy
·5 वर्ष पहले·discuss
I like the IPA Chart website [0] which lists the phonemes and has examples of each when clicked. To understand a pronunciation (such as /ɪg.drə.sɪl/ for Yggdrasil), I'll match up the symbols to the chart and piece it together from the sample sounds.

Sidenote: I had a bit of trouble locating an IPA transcription for Yggdrasil. The pronunciation guide in the Wikipedia article for Yggdrasil Linux/GNU/X is not IPA, it's using English pronunciation rules to try to emulate the correct pronunciation. The pronunciation in dictionaries (at least Merriam Webster) is also not quite IPA, though it is close. I came up with this pronunciation by merging those sources. I is probably correct, as I found a matching transcription in an old version of the Yggdrasil Wikipedia article which was removed for being original research.

[0] https://www.ipachart.com/