All Posts
welcome to my blog :^)
164 Midterm Prep
As of 12:35AM October 28th 2025, I am in poor shape.
Week 0
compiler : source_program -> target_program
Compilers take source code written in one language and return source code written in another language.
interpreter : source_program -> value
Interpreters take source code written in some language and return a value.
164 compiler : OCaml -> x86-64 machine code
- runtime is in C
entry function: the entry point to the code our compiler is producing
OCaml
- is a functional programming language
- for each input, it always produces the same output
- has first-class functions
- you can use functions as input to other functions, and produce functions as output
- has type inference
- compiler automatically figures out most data types
- is statically-typed
- detects type errors at compile time
- is type-safe
- limits which kinds of operations can be performed on which kinds of data
- is primarily immutable
- no side effects that update state when producing a return value
In the toplevel, running let x = 24;; returns val x : int = 42.
- "
xhas typeintand equals42."
Week 1
S-Expressions
type s_exp =
Sym of string | Num of int | Lst of s_exp list
- Lst takes as its argument a list of other s-expressions.
fold_left
Unary Operations
Pipeline expressions: x |> f is the same as f x.
Dev environment
Works for Fall 2025
{
description = "cs164";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
systems.url = "github:nix-systems/default";
};
outputs = { self, nixpkgs, systems }:
let
pkgsFor = system: nixpkgs.legacyPackages.${system};
forAllSystems = fn: nixpkgs.lib.genAttrs (import systems) (system: fn (pkgsFor system));
in
{
packages = forAllSystems (pkgs: {
default = pkgs.callPackage ./. { };
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
inputsFrom = [ self.packages.${pkgs.system}.default ];
#shellHook = "mkdocs serve";
};
});
formatter = forAllSystems (pkgs: pkgs.nixpkgs-fmt);
};
}
{ pkgs }:
pkgs.stdenvNoCC.mkDerivation {
name = "cs164";
src = ./.;
nativeBuildInputs = with pkgs; [
ocaml
dune_3
ocamlPackages.findlib
ocamlPackages.ounit2
ocamlPackages.ppx_deriving
ocamlPackages.menhir
ocamlPackages.yojson
ocamlPackages.janeStreet.shexp
ocamlPackages.core_unix
ocamlPackages.ppx_blob
nasm
# for examples in class notes
libgccjit
];
}
In a directory with both of these files on a machine with Nix installed, run nix develop --extra-experimental-features nix-command --extra-experimental-features flakes. Remove flags if you have flakes or nix-command enabled systemwide.
Songes and Sonettes (Tottel's Miscellany)
im pissed that I can't get home manager to work the way that i want. so we're doing this now.
no good online versions of this poetry exist online that aren't old PDFs. and even if they do... here's a solid transcription nonetheless.
Frequently bought together
Here's a list of other blogs from people I've met, mostly at UC Berkeley. Go give their stuff a look!
my makeup routine





