Open AndrewBrownK opened 3 years ago
Unfortunately, not at the moment.
I think they do. Although the exact definition may not be completely obvious. DDlog consists of the imperative fragment (functions and expressions) and declarative fragment (relations and rules). It is relatively straightforward to add generics to the imperative fragment, e.g., by exposing a simplified version of the Rust traits system. But what exactly generics should look like for the declarative fragment is a more interesting question and a nice language design exercise that we haven't done yet.
I don't have a good general answer, but if you have a specific task, e.g., a simplified version of whatever you would like to implement in DDlog, I'll be happy to brainstorm potential solutions together.
I like Souffle's generic components: https://souffle-lang.github.io/components That would be a way to use generic relations.
Would it be possible to create and implement traits (or interfaces or typeclasses) in DDlog?
What I would like is inversion of control. I want some framework-like DDlog that can operate on any DDlog types that implement a trait. Then I want app-specific DDlog that can implement this trait. The framework-DDlog is responsible for (perhaps generic) inputs and outputs, but doesn't depend on the app-DDlog to compile. The app-DDlog can use the framework-DDlog to declare inputs and outputs and then customizes app-specific behavior by implementing the trait(s).
From wikipedia:
Questions
It won't be the end of the world if I have to make my framework-like DDlog hard-coupled with my app-like DDlog. I'd just like to poke at and discuss this subject before I get too far committed to an implementation either way.