In the same lain as Music as Code
and CAD as Code
.
Designing electronics as composable modules in code seems like a good idea.
Some tools like that:
tscircuit - Make electronics using Typescript and React
replicad - Design circuits using Javascript/Typescript.
Being able to simulate circuits would mean that one could do the intitial debugging on your development machine without having to have the hardware in-front of you yet.
CircuitJS1 - an electronic circuit simulator that runs in the browser
Wokwi - "World's most advanced ESP32 simulator"
Wokwi Github - Some of their stuff is open source, but not all it seems