In chef's case, I would rather write simple classes & functions in plain ruby than use the DSL and write "Lightweight Resource Providers".
In ansible's case, I even did a little experiment to show what it would look like to use & call ansible modules as normal python code:
https://github.com/lost-theory/ansible/blob/module_experimen...
https://groups.google.com/d/topic/ansible-project/Zv3Veo77gP...
I would love to see a CM tool that embraced plain python or plain ruby and not try to go the pseudo-"declarative" route, which ends up being IMO too constraining for not much benefit and needlessly reinventing a bunch of wheels (e.g. looping & conditionals, as the article mentions).