My impression is that “hey” is a Haiku-native command-line utility that allows interprocess communication. It is not present on other operating systems.
It’s not without precedent on other operating systems: OS/2, AROS and AmigaOS 2 and 3 used their respective versions of the REXX scripting language for interprocess communication while AmigaOS 4 uses a proprietary Python plugin to access “AREXX ports” and MorphOS uses a similar “AREXX port” plugin to it’s version of Lua. There’s AppleScript on the Mac and ActiveX on Windows also.
Having a single “hey” command that can be called from any scripting language is much simpler than building a whole scripting language around it.
hey is only one frontend to the scripting API. There used to be a similar tool in the early days of BeOS that I can’t remember the name of. The scripting API isn’t really about interpreted languages like shell/ruby/perl/python/… scripts. Scripting is more about a “scripted conversation” between two objects. Non-native apps will not know how to respond to these script requests, although any app that opens a window will inherit some basic commands to manipulate the application windows and a few other properties. So, ported apps using toolkits like Qt or SDL will inherit the basics, but won’t truly support the full power of the scripting API.
You can cheat a bit if you’d like. There is a special flag to the findpaths command that will look up the package file for you, without having to use catattr. Something like findpaths -p /path/to/file B_FIND_PATH_PACKAGE_PATH will print the path to the hpkg that owns it. This also has the advantage of being usable for things installed to the user package directory at ~/config/packages.