For example when i run a playbook in ansible with modules, how does ansible interpret these modules on the target system? I hope you understand my Question and have a good day!
Simplified answer, modules are mostly just a scripts or binary
executables, which Ansible copies to the remote and then executes them
using the appropriate interpreter if needed.
The long answer has many details and many different branches to
consider. Also, while Ansible itself only ships with Python and
Powershell modules, and can bundle certain dependencies (module_utils)
that don't need to be present in the target system.In the end any
language should work as well as binary files, but you won't have
dependency packing features. The main requirement is that the module
can take input as JSON and outputs JSON with some required fields,
which should be doable in any/all programming languages.