1. 36
    1. 6

      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:


    2. 3

      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.

    3. [Comment removed by moderator alynpost: Remove off-topic comment, indistinguishable from spam.]

    4. 1

      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…

      1. 1

        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)

    5. [Comment removed by author]

    6. -1

      Any reason I should use this instead of something like TOML for which there is great language support even if it is Haskell?

      1. 9

        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.

        See https://www.gnu.org/software/recutils/manual/Encryption.html#Encryption for example.

        1. 11

          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.

          1. 6

            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”.

            1. 1

              “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.

              1. 1

                SQLite is awesome, but that doesn’t mean it’s a golden hammer. Sometimes, light as it is, it’s still overkill.

            2. 1

              Unless you want to look at textql or something like it.

          2. 3

            Yeah I think sqlite is the best comparison.

        2. 0

          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).

          1. 5

            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

          2. 2

            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.

      2. 2

        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.