tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: sqlite3 mandocdb and apropos (etc.)
Date: Wed, 6 Jun 2012 00:17:04 +0200	[thread overview]
Message-ID: <20120605221704.GA27160@iris.usta.de> (raw)
In-Reply-To: <4FCE1871.90605@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Tue, Jun 05, 2012 at 04:32:17PM +0200:

> Enclosed [finally] is a patch against HEAD that uses sqlite3 for
> mandocdb and apropos (getting the others to use it is quite easy).
> It's a work in progress, but is the simplest possible implementation
> before extensive polishing.  I'd like to get this in to start
> refining.

I am interested in the sqlite3 integration and hope we get it
going.  Certainly, this will need a thorough review, and i hope
to find some time for it.  As i couldn't find the time for a full
review right now, i'm sending comments on one aspect that became
obvious at once.

> First of all, you'll need uthash (in ports) and sqlite3 to build.  I
> chose uthash for hashtables just because I'm familiar with it.  I'd
> like to use espie@'s ohash stuff instead to reduce dependencies, but
> since uthash is just a header file, I'm not that concerned.

First point, the base system cannot ever use anything from ports.
Thus, using uthash would require to import it into base and maintain
it there.  So i had a brief look at it - and even without
understanding what it does, i think there is no way in hell to ever
get that imported.  The file uthash.h alone is 900 lines of abusing
cpp(1) macro definitions instead of defining proper functions.  I
cannot imagine that you will find anybody willing to do the required
code audit on code of that style, let alone build consensus to import
such code; myself, i must say it feels positively revolting on first
sight.

Of course, i might be wrong in my first impression, but if you
suspect i am wrong and this is actually code of sufficient quality
to be considered for inclusion in base, i'd recommend you first
verify with some of the usual suspects for userland library hacking
(like millert@, otto@, guenther@, deraadt@, ...) before spending
a lot of time integrating it and then being disappointed later.

Otherwise, it's probably better to choose tools available in base
first and use those, at least for now, to avoid changing too much
in a single step.

> There are a few significant differences between this and the last
> mandocdb family of tools:
> 
>  1.  apropos_db.c -> mansearch.c (simplified search interface)
>  2.  UTF-8 encoding in database
>  3.  fts(3) in mandocdb
>  4.  for the time being, only OR'd expressions using IS/GLOB
>  5.  lots of hashing (uthash) in mandocdb
>  6.  only apropos/mandocdb/manpage are enabled (for now)

I will have to look at that...

Yours,
  Ingo
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2012-06-05 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-05 14:32 Kristaps Dzonsons
2012-06-05 22:17 ` Ingo Schwarze [this message]
2012-06-05 22:43   ` Kristaps Dzonsons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120605221704.GA27160@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).