I've built my own window manager for macOS that gives me layout-based automatic tiling.
HHTWM is library with small API to be used within larger Hammerspoon configuration.
HHTWM
It's open sourced and well documented: szymonkaliski/hhtwm.