Skip to content

Instantly share code, notes, and snippets.

View praisethemoon's full-sized avatar
🌕

Soulaymen Chouri praisethemoon

🌕
View GitHub Profile
@praisethemoon
praisethemoon / every-vm-tutorial-you-ever-studied-is-wrong.md
Created September 10, 2024 10:37 — forked from o11c/every-vm-tutorial-you-ever-studied-is-wrong.md
Every VM tutorial you ever studied is wrong (and other compiler/interpreter-related knowledge)

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.)

  • a pure stack VM can only access the top elemen
@praisethemoon
praisethemoon / keras-conv.ipynb
Created April 3, 2019 15:00
Convolution over volume, in keras
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2-3d-vectorized.ipynb
Created April 3, 2019 14:59
Convolution over volume
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2-vectorized-d-filters.ipynb
Created April 1, 2019 08:18
Convolution over N filters for 2D images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-comparison.ipynb
Created March 31, 2019 00:53
conv_loop_vs_vectorized
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2-vectorized.ipynb
Last active April 1, 2019 07:37
Convolution with im2col
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / ndarray.ipynb
Created March 29, 2019 10:50
NDArray, for tensors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / 3d-images.ipynb
Created March 28, 2019 20:36
Split RGB Image channels
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / ndarry_1.ipynb
Created March 28, 2019 19:39
2D Index to 1D Index and backwards.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@praisethemoon
praisethemoon / conv-v2.ipynb
Created March 26, 2019 22:09
Intuition behind convolutions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.