A relatively simple Datalog engine
Nice! It's always good to see Datalog in action. In my experience, Datalog is often more convenient and more readable than SQL.As the post mentions, the current ergonomics ("a wall of definitions") are indeed the main shortcoming of the present approach, which is syntactically far removed from Datalog.My suggestion towards an automated conversion is to consider Prolog: Syntactically, a Datalog clause is a valid Prolog term. In fact, Datalog is a syntactic subset of Prolog. Therefore, it can be easily parsed with Prolog (using the predicate read/1), and then inspected via built-in mechanisms. You may be able to write a Prolog program that converts proper Datalog definitions to such Rust snippets.