Skip to content

Instantly share code, notes, and snippets.

View chrisaycock's full-sized avatar

Christopher C. Aycock chrisaycock

View GitHub Profile
@chrisaycock
chrisaycock / copy-and-fuse.md
Created December 9, 2025 03:12
Proposal: Copy-and-Fuse Compilation

Proposal: Copy-and-Fuse Compilation

One of the performance difficulties from interpreting a vector language is the accumulated temporaries. Consider:

y = 7 * x + 13

There are two different vector arithmetic operations here; an eager evaluation will perform the multiplication and then the addition. We can visualize this using the assembly language from Empirical's Vector Virtual Machine:

@chrisaycock
chrisaycock / pcap_udp.cpp
Last active May 24, 2025 13:27
Example for accessing UDP packets in a pcap file
// answer to https://quant.stackexchange.com/q/55088/35
// compile with c++ pcap_udp.cpp -lpcap
#include <iostream>
#include <pcap/pcap.h>
#include <netinet/if_ether.h>
#include <netinet/ip.h>
#include <netinet/udp.h>