youki + libkrun
Japanese version is available here. https://gist.github.com/saku3/9a3d45e61e329a29a3214cdff0797193
This document explains how to launch VM containers using youki together with libkrun.
youki + libkrun
Japanese version is available here. https://gist.github.com/saku3/9a3d45e61e329a29a3214cdff0797193
This document explains how to launch VM containers using youki together with libkrun.
| import Control.Monad (ap, forM_) | |
| import qualified Data.Map as M | |
| -- The Collapse Monad | |
| -- ------------------ | |
| -- The Collapse Monad allows collapsing a value with labelled superpositions | |
| -- into a flat list of superposition-free values. It is like the List Monad, | |
| -- except that, instead of always doing a cartesian product, it will perform | |
| -- pairwise merges of distant parts of your program that are "entangled" | |
| -- under the same label. Examples: |
This gist is a quick explainer on how to install and configure gVisor on K3s. There is a sort of hidden gotcha if you aren't reading the documentation thoroughly. If you already have a K3s cluster setup skip to the appropriate section below.
Install K3s as described in the documentation.
| 0810 b' from ' | |
| 0678 b' ssh2' | |
| 00d8 b'%.48s:%.48s():%d (pid=%ld)\x00' | |
| 0708 b'%s' | |
| 0108 b'/usr/sbin/sshd\x00' | |
| 0870 b'Accepted password for ' | |
| 01a0 b'Accepted publickey for ' | |
| 0c40 b'BN_bin2bn\x00' | |
| 06d0 b'BN_bn2bin\x00' | |
| 0958 b'BN_dup\x00' |
This is the predecessor of Mazeppa.
Supercompilation is a deep program transformation technique due to V. F. Turchin, a prominent computer scientist, cybernetician, physicist, and Soviet dissident. He described the concept as follows [^supercompiler-concept]:
A supercompiler is a program transformer of a certain type. The usual way of thinking about program transformation is in terms of some set of rules which preserve the functional meaning of the program, and a step-by-step application of these rules to the initial program. ... The concept of a supercompiler is a product of cybernetic thinking. A program is seen as a machine. To make sense of it, one must observe its operation. So a supercompiler does not transform the program by steps; it controls and observes (SUPERvises) the running of the machine that is represented by th
Note: this was originally several Reddit posts, chained and linked. But now that Reddit is dying I've finally moved them out. Sorry about the mess.
URL: https://www.reddit.com/r/ProgrammingLanguages/comments/up206c/stack_machines_for_compilers/i8ikupw/ Summary: stack-based vs register-based in general.
There are a wide variety of machines that can be described as "stack-based" or "register-based", but not all of them are practical. And there are a lot of other decisions that affect that practicality (do variables have names or only address/indexes? fixed-width or variable-width instructions? are you interpreting the bytecode (and if so, are you using machine stack frames?) or turning it into machine code? how many registers are there, and how many are special? how do you represent multiple types of variable? how many scopes are there(various kinds of global, local, member, ...)? how much effort/complexity can you afford to put into your machine? etc.)
| use serde::Serialize; | |
| struct Point { | |
| x: i32, | |
| y: i32, | |
| } | |
| fn main() { | |
| let point = Point { x: 1, y: 2 }; |
| type term = | |
| | Lam of (term -> term) | |
| | Pi of term * (term -> term) | |
| | Appl of term * term | |
| | Ann of term * term | |
| | FreeVar of int | |
| | Star | |
| | Box | |
| let unfurl lvl f = f (FreeVar lvl) |
| ;; curl -d 'id="1234"' -X POST 'http://localhost:65535/?name=otee' | |
| (defn handler-that-needs-keyword-params | |
| [{params :params}] | |
| ;; the following will return this response map: | |
| ;; {:body "Hello otee your ID is: 1234" ...} | |
| (ring.util.response/response "Hello" (:name params) " your ID is: " (:id params))) |
This will pull in source code for podman, buildah and related modules, build everything and install to /usr/local. This all happens in a directory named 'build' which can be deleted to clean up or to force a clean build.
mkdir -p build
fetch https://gist.github.com/dfr/ac4dc043ee3780b690c5887a61f53494/raw/1e55da486792ffda61c9d6070d5d834888be9590/buildah-install.sh
chmod +x buildah-install.sh
(cd build && ../buildah-install.sh)
Make a container and run things inside it: