I've always wanted this as well but I haven't gotten the time to actually look into writing this. This would solve a lot of complaints I have and have heard about traditional CAD software, as they tend to constrain you with their very complex GUI.
Libfive is layered and can be used without Studio to generate models with its extensible Guile Scheme binding. It uses F-rep modeling.
Correct me if I'm wrong, but it should be possible today to add a programmatic (non-GUI) constraint solver to either FreeCAD or Libfive.