mercredi 17 mai 2023

Dynamic computations in Rust

I want to develop a desktop app that allows user to describe a data-flow diagram with nodes and run it. Similar to node-based system in Blender, but more of general-purpose, data passing from node to node can be any type.

My main concern is how can I use Rust to declare new nodes so that node describes its inputs and outputs and when such node-graph is executed data can be passed from node to node in a type-safe manner.

In C# I can easily achieve this by simply inspecting any static function. Use reflection to get info about its arguments and dynamically pass out arguments from other functions to input arguments of the function.

For now it seems to me like Rust simply is a bad choice for such problems. Am I missing something? Can I solve this problem with Rust in an efficient manner?





Aucun commentaire:

Enregistrer un commentaire