Introspection support

Would it be possible to have introspection capabilities similiar to Javas reflection? It would open up interesting possibilities. As far as I understand it is possible to compile c++ apps against certain libraries to get this feature but having it in the OS (which itself is a VM) would sound interesting.

Bindings for scripting languages would be trivial.
All kinds of dynamic class loading would be trivial.

Security would probably be nightmare
Would it affect performance ?

This was just a thought that occurred to me while trying to (as a refresher of C++ programming) develop a GUI design application.

I am not a programmer by any means, I only play around the edges of Ruby! But I would think that enabling introspection in the OS itself would be a good thing. It would be totally another to have the feature built into every app running on Haiku! One would think the app would consume a noticable amount of CPU cycles in introspection mode, and would probably require a new thread for the introspection to work smoothly!

My personal belief that the motto of Be OS and by extension Haiku is “Simple,Functional, Elegant”. The more complex you make a thing, the more that can go wrong with it! This is proven true time and time again when anyone uses Windows and even Linux. If a task needs to be done, build an app that can execute as fast as it can, with as little coding, cpu cycles, and memory footprint as possible.

While I do believe introspection could and posibly should be built into the Haiku kernel, but never at the cost of efficiency and simplicity! If the Haiku devs wanted to enable introspection in the apps, a new Introspection kit would likely be required. If it can be done with little complexity, low latency, and with little memory usage, then I think it would be a good addition to Haiku! .

There already is some introspection support, but most likely not what you’re used to. Haiku has its own scripting API, currently accessible from C++ and any scripting language via the bash command ‘hey’. How much support each program provides for scripting is up to the application developer. Sadly, not much has been done with it except for Tracker.

I actually have looked into that from time to time, but have yet to find an elegant way to do it in C++. Don’t recall if the new C++ standard improves the situation though.