I learned a bit of Prolog a long time ago (as part of a philosophy course at university!) and it sounds interesting but I have no idea of how useful it is.
I learned a bit of Prolog a long time ago (as part of a philosophy course at university!) and it sounds interesting but I have no idea of how useful it is.
- Data queries (e.g. given data X show me as much as you can across multiple systems)
- Cross API integration (e.g. show me a PRs that merged, but not marked as done in Jira)
- Data transformation (JSON -> XML -> YAML), e.g. Excalidraw to Graphviz to draw.io - State transition checks (systems modeling)
- Diagram generation
- Code/Document generation
One of the most crazy ideas I have is one to generate C++ code for Cardputter in order to have a little Uiua machine. Arduino tooling is so slow (or it might be the thing for this specific board, no idea), that I figured it's going to be easier to develop it in Prolog and then generate C code from it (i.e. key handlers, rendering etc.)
Thing with Prolog is, that people think it's slow, but it's not. I agree that in 80's it might have not be usable, but today I'm having 2.1M Lips (Logical Iteration Per Seconds), so solution might not be inefficient but I save on the lines of code in the end.
For such tasks I prefer quasi-quotation [0] or a simple format with goal expansion [1]. As for readers I rarely need ones, because XML, YAML, JSON are already included.
In order to do code analysis I first pulled pieces using Regex (mostly headers) and only then parsed them over with DCG. Which is also neat when creating own DSLs - one can ask people on meeting to decorate lightly notes and get - semantic linking almost for free.
[0]: https://www.swi-prolog.org/pldoc/man?section=quasiquotations [1]: https://www.swi-prolog.org/pldoc/man?section=format-predicat...