Programming Leftovers
-
Max Bernstein ☛ Into CPS, never to return | Max Bernstein
CPS, or continuation-passing style, is an intermediate representation for programs, particularly functional programs. It’s used in compilers for languages such as SML and Scheme.
In CPS, there are two rules: first, that function/operator arguments must always be trivial; second, that function calls do not return. From this, a lot falls out.
In this post, we’ll introduce CPS by building a simple (Plotkin1) CPS transform from a small Scheme-like language. We’ll sketch some optimizations on the IR. Then we’ll look at a couple of the common ways to actually compile the IR for execution.
-
Karl Seguin ☛ Basic Awareness in Addition to Deep Understanding
Software developers are often evaluated based on how well they understand specific ideas and tools. While mastery is important, there's another type of knowledge I find myself relying on: vague awareness. Unlike mastery, awareness is merely knowing that something exists along with a basic understanding of what it is and what problem it can solve.
-
[Old] Max Bernstein ☛ Damas-Hindley-Milner inference two ways
Damas-Hindley-Milner (HM) is a type system for Standard ML and the ML-family languages with parametric polymorphism, aka generic functions. It sits at a sweet spot in PL design: the type system is quite expressive, and there are well known type inference algorithms that require absolutely no annotations from the programmer.
It seems to have been discovered independently multiple times over the years, but the most famous papers are the original (PDF) by Milner and the follow-on (PDF) by Damas and Milner. Damas continued on to write his thesis (PDF) about it. (If you have a link to the appropriate Hindley paper, please let me know.)
-
Evan Hahn ☛ A black cat in 2032 bytes
Taper describes itself as “an online literary magazine for small computational pieces”. Submissions need to be 2048 bytes or fewer.
-
Kentaro Hayashi: How to check what matches linux-any?
Usually
Architecture: any
is recommended in debian/control except upstream explicitly doesn't/won't support that architecture.In practical use case,
linux-any
is useful to exclude hurd architecture. (Previously it is also useful to exclude kfreebsd)Here is the simple script to check whether specific architecutre matches linux-any or not.
-
Adam Young: Long Refactoring: Resetting the class model
With the inclusion of the Generators, the main functions seem to be in the right shape. What seems off is the naming of things. For example, we have a couple functions that take a parameter named “board” but it turns out they mean different things. The names of classes do not seem to align with what they are doing.
Lets continue with the renaming of things and see where it leads us.
But first: we can remove the exceptions to the flake8 testing, and, with the removal of some white space, we can run with all the pep8 rules intact. Now, on to renaming.I am not going to go through each commit, but will try to provide enough context so you could follow the logic in the commits in github.
This is the last article in my Long Refactoring series. You can read the first article here.
-
Rlang ☛ Creating an animated Christmas tree in R
With Christmas tomorrow we have decided to create an animated Christmas
Tree using {ggplot2},
{sf} and
{gganimate}.
First we need a tree. To do this we have used an {sf} polygon where we
pass in the coordinates of the Christmas tree as a list matrix to
st_polygon. -
Shell/Bash/Zsh/Ksh
-
dwaves.de ☛ GNU Linux bash stopwatch script
-
-
Standards/Consortia
-
Bob Monsour ☛ Look Ma, I've styled my RSS feed
Now, rather than get just a glob of XML thrown in your face, you get a reasonably nice looking list of posts. Go ahead and click on that link above and you'll see what I mean.
-