Btw, see also the related discussion in the Prolog Community Discourse, which includes also a discussion of the Ciao Prolog hiord approach, based on call/n.
hiord
call/n