Blog author here. It looks like my little intro got shared on HN and here. There’s a lot more power to recutils than the bits I showed in the post. I recommend you look deeper if the format appeals to you. For you emacs users out there, it integrates well with org-mode too.
I really wish there were Go bindings for this format. There’s an application I want to write that this would be perfect for. I might look into writing a parser…
I don’t understand the question. TOML is a configuration file format. This is.. completely different. It’s a relational database.
Recutils is a collection of tools, like recins, recdel, and recsel used to manage these recfiles/databases. They allow for all the normal basic relational database operations, typing, auto-incrementing, and even field-level crypto. All of this power is yours with the bonus that your database is a human-readable text file that you can grep/awk/sed freely, and a line-oriented structure makes it perfect for version control systems.
As far as I remember, Guix uses this format to display package information, when searching. With Recutils you don’t even notice it’s a special format, while “printing” sqlite would be a bit harder. So I’d say that answer is less grep/awk/sed/git and more “human-readable text file”.
“frontend” tools can easily be developed for SQLite. Recently I’ve been using SQlite and plain text for almost anything, so both are compelling for me, but the Emacs word is a bit esoteric for me, wile SQLite is ordinary everyday tool.
Follow up question: why does recutils invent its own format instead of reusing an existing one (eg: TOML)? If I want to use recutils from Haskell today, there is no support for it (unless I write my own parser).
If I want to use recutils from Haskell today, there is no support for it (unless I write my own parser).
Unless you use an FFI in Haskell to call librec. Wouldn’t advise since there’s jack squat in documentation outside of the program suite itself.
Overall, wouldn’t recommend it in the long haul. Especially when creating a “static” site generator with Recutils, M4, and Make.
Because using TOML as a database as opposed to configuration would be a pain in the neck. The Recutils are good databases, terrible for configuration. Handy if you want to write out the basics of a database in a text editor without wrangling a lot of SQL and to use it in shell scripts.
There’s a similar but more modular set of utilities written in Perl called ‘recs’, which is short for “record stream”, which is also pretty cool:
https://metacpan.org/pod/release/TSIBLEY/App-RecordStream-4.0.1/README.pod
Blog author here. It looks like my little intro got shared on HN and here. There’s a lot more power to recutils than the bits I showed in the post. I recommend you look deeper if the format appeals to you. For you emacs users out there, it integrates well with org-mode too.
[Comment removed by moderator alynpost: Remove off-topic comment, indistinguishable from spam.]
I really wish there were Go bindings for this format. There’s an application I want to write that this would be perfect for. I might look into writing a parser…
A basic parser for the Recfile format is not much work, as you can see in Relational pipes.
(however if you want to parse all data formats and do not treat everything as mere strings/integers, it is bit more code)
[Comment removed by author]
Any reason I should use this instead of something like TOML for which there is great language support even if it is Haskell?
I don’t understand the question. TOML is a configuration file format. This is.. completely different. It’s a relational database.
See https://www.gnu.org/software/recutils/manual/Encryption.html#Encryption for example.
The better question would be why not use Sqlite? The answer is grep/awk/sed/git.
The arguments for Sqlite are probably SQL and ACID.
As far as I remember, Guix uses this format to display package information, when searching. With Recutils you don’t even notice it’s a special format, while “printing” sqlite would be a bit harder. So I’d say that answer is less grep/awk/sed/git and more “human-readable text file”.
“frontend” tools can easily be developed for SQLite. Recently I’ve been using SQlite and plain text for almost anything, so both are compelling for me, but the Emacs word is a bit esoteric for me, wile SQLite is ordinary everyday tool.
SQLite is awesome, but that doesn’t mean it’s a golden hammer. Sometimes, light as it is, it’s still overkill.
Unless you want to look at textql or something like it.
Yeah I think sqlite is the best comparison.
Follow up question: why does recutils invent its own format instead of reusing an existing one (eg: TOML)? If I want to use recutils from Haskell today, there is no support for it (unless I write my own parser).
TOML: Initial release: 23 February 2013
recutils: 1.0, 2010: http://ftp.gnu.org/gnu/recutils/
This took literally 1 minute to find out :P
Unless you use an FFI in Haskell to call
librec
. Wouldn’t advise since there’s jack squat in documentation outside of the program suite itself. Overall, wouldn’t recommend it in the long haul. Especially when creating a “static” site generator with Recutils, M4, and Make.Because using TOML as a database as opposed to configuration would be a pain in the neck. The Recutils are good databases, terrible for configuration. Handy if you want to write out the basics of a database in a text editor without wrangling a lot of SQL and to use it in shell scripts.