Not quite 4k, but MicroPython runs on 16K of RAM.
What I want is something that I can hook up to the UART serial port, and start typing interactive commands into it to debug why my system is hung/stuck/etc. It needs to live in about 4K of RAM (and I can trade quite a bit of flash to do that).
16K of RAM is too much. Something like a Nordic nRF52811 only has 24K of RAM, and a lot of that gets used for the Bluetooth stack.
On bigger devices (PC/SBC/...) with an OS, Tcl/Tk is a wonderfully effective programming tool!