Skip to content

Instantly share code, notes, and snippets.

View HRussellZFAC023's full-sized avatar
PRO

Henry Russell HRussellZFAC023

PRO
View GitHub Profile
// Break down linear IR into basic blocks and construct CFG.
// Just a naive program to teach myself datalog and Souffle.
.type Address <: number
// A sequential instruction, i.e. one that does not change control flow.
// Don't bother describing operands as we're only interested in control flow here.
// (ALU, load, store)
.decl seq(address:Address)
@0xc0392b
0xc0392b / 6ic.js
Last active November 16, 2021 12:36
6 instruction assembly language simulator written in Javascript using only arrow functions and ternary operators
/*
* @author William Santos
*
* Below is a 6 instruction assembly language simulator written in Javascript
* using only arrow functions and ternary operators.
* There is no point in an assembler here since the assembly program to be
* executed has to be composed as a recursive linked list of instructions
* - which are, of course, each constructed using explicit function calls.
*
* How it works:
@Dammmien
Dammmien / bfs.js
Last active February 22, 2022 11:35
Breadth First Search (BFS) Graph Traversal in Javascript
var nodes = [
{
links: [ 1 ], // node 0 is linked to node 1
visited: false
}, {
links: [ 0, 2 ], // node 1 is linked to node 0 and 2
path: [],
visited: false
},
...