Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>
Clone
HTTPS:
git clone https://vervis.peers.community/repos/yEzqv
SSH:
git clone USERNAME@vervis.peers.community:yEzqv
Branches
Tags
choice-of-language.mdwn
Which language? C or C++? Query resolution has a functional/procedural nature, there is no need for OOP here. On the other hand, a semantic store as a whole can be quite complicated and benefit from OOP. Hmmm… I could even use a functional language like Haskell and parallel execution would make things much much faster.
Let’s decide by examining the needs. What is the query resolver going to do? Basically, it reads from some collection of information and returns a set of answers. But wait a moment. This model is limited: What if we wanted to keep just a small amount of answers in memory? Solution: Instead of saving them, it calls some callback. DECISION: Let’s try to enjoy C++ templates, as I usually do and then regret it. Later I’ll consider switching to C. It’s still early enough to make such a switch easy.
Creating saugus…
After several hours and fixing the Autotools setup and i18n support, I’m ready to start. But I had a thought: I don’t think I really need OOP here. I mean, the idea is to have a database encoded in some way, and then apply an algorithm. The algorithm is procedural and and data can be represented in an array somehow. An array of statements, each has four fields, each is a union or something.
Hmmm… on the other hand, Redland is OOP in C. Jena is in Java. Haystack is in a Java-like language. They’re OOP too. Actually even the Perl interpreter, whose functionality is procedural or functional in nature, is written in OOP style in C.
Remember Saugus will be much more than just the algorithms: The software is eventually also an API. You know what? Since I’m going to reuse code, let’s go see how 4store is written. Just have a taste of what it looks like.
- Webtite: http://4store.org/
- Code: https://github.com/garlik/4store
It’s not immediately clear to me how it works and how storage is managed. I’ll need to clone it and examine more carefully. Anyway, it’s time for a final decision.
DECISION: I’m taking C++ for now.