If you look at this and you think "wow, I love the idea of CAD-as-code but I wish it was a more sane language" then have a look at CadQuery: https://cadquery.readthedocs.io/en/latest/quickstart.html#qu...
(I recommend CQ-editor for an easy install: https://github.com/CadQuery/CQ-editor/releases/)
It's a similar idea to OpenSCAD, but embedded in Python and using a better geometry kernel. Want to fillet a box in OpenSCAD? Sure, either take the convex hull of 8 spheres, or the minkowski sum of a box and a sphere. Want to fillet a box in CadQuery? .edges().fillet()
Now I'm hearing some protests about Python, but consider this example OpenSCAD code:
x = 1;
echo(x);
x = 2;
In most languages you would expect this to print "1". In OpenSCAD, the last assignment wins and it prints "2".
I certainly have my complaints about openscad (mostly that the geometry isn't something you can operate on), but as far as I'm concerned a declarative language is perfect for describing an object. I don't want your example to do what you expect. I would have preferred if it didn't compile