3 ms·
Hello ddddazed, interesting approach. With the C++26 release, native reflection was introduced, which is arguably more powerful than RTTR. So I'm not entirely
by A_Lorenzo 8mo ago
Hello ddddazed, interesting approach.
With the C++26 release, native reflection was introduced, which is arguably more powerful than RTTR.
So I'm not entirely sure on this point, how do reflection discovery works and how are complex types handled?
nice work anyway
- ddddazed 8mo agoYes, I actually discovered that C++ implemented reflection after working on the project, but at the moment I'm too busy to follow up on this with the attention it deserves. However, this is definitely something I need on my TODO. As for the details, the scheme I started with is “simple” and, as already mentioned, it is valid for all memory-managed languages. The desktop application starts up and, at the entry point, does the following: engine.Ingnite(this) The “engine” library now has the application instance in its belly, and a listener is created for each application, waiting for commands. On the “chat” side, the prompt to the model starts, and here both the prompt and the classic json that I built with the methods I decided to expose are sent. When the chat receives the response, it sends the token to the listening listener: engine.Execute(method.json) From here, first deserialize the json by creating the objects. At this point, you have both the application instance and its method, as well as the arguments with which it must be called: method.Invoke(instance, parameters) I find this interesting, and it breaks with the classic way we are used to communicating with wrapper APIs. I think that, since it has probably been an established method for decades with the advent of the web, it was natural to move in this direction. However, coming mainly from a desktop environment, I wonder if this is the “easiest” and “smartest” way to handle these cases. I hope this can help.