Article View: news.software.nntp
Article #29520Re: Replacing innmail?
From: Russ Allbery
Date: Thu, 02 Jul 1998 00:00
Date: Thu, 02 Jul 1998 00:00
96 lines
5519 bytes
5519 bytes
Peter J Naylor <pete@filter.supernal.net> writes: > Russ Allbery <rra@stanford.edu> writes: >> Because from an embedded interpreted language, I have access to all of >> INN. There are patches now that let me query INN to see if a group is >> moderated, cancel a message already received, add things to the history >> file, do history lookups, etc. That stuff is slow, impossible, or >> memory bloated in an external program, or all three. > You're making the comparison between the two particular languages which > are provided with a direct interface to INN functions and everything > else - which doesn't have the same interface. This doesn't tell me > anything at all about why using an interpretted scripting language is > dramatically faster than a compiled binary for filtering. Oh, wait, I think I see the problem. The internal design of INN is highly monolithic, that being one of the original design goals since it was originally written back in the days when a single process handling everything was really quite a bit faster. (May still be, I'm not sure.) As such, my understanding is that providing those hooks to anything that *isn't* embedded in the INN process itself would require a fundamental reworking of the structure of INN. The current interface, ctlinnd, works well for what it's intended to be used for, but is not suitable for issuing a *lot* of commands like a filter would need to. The locking and rendezvous protocols necessary are too time-consuming. So yes, I agree that what you want to see would probably be a nice thing to have, but it's very difficult to do. In the meantime, it's much easier to directly embed a language *designed* for embedding (which C really was not) into the INN process itself. An external C daemon in the present state of INN would be slow and less functional. In a redesigned INN that could be fixed, but for right now an embedded language is better. > Why Perl though? We went from a shell script that worked for everyone > but recently needed a security fix, to another interpretted script. The > security problem doesn't exist in the patched shell script or the Perl > script. The Perl script also uses sendmail instead of UCB Mail. What's > the advantage that justifies the dependency on a totally separate and > otherwise unnecessary package? Probably ease of coding; it's easier to write in Perl than it is in shell for most people. > Couldn't the same have been done in C and just compiled with the rest of > INN? Oh, probably, but again it's harder to write this sort of script in C than it is in Perl. I'm reasonably experienced in both languages, having written non-trivial chunks of code in both, and yet it's dramatically faster for me to develop in Perl. Admittedly, I have a strong Perl bias, but I don't think it's solely due to that, and my experience has been backed up by a lot of other people. Perl is an inherently higher-level language. > Because they use more disk space? The scripts do the same thing as far > as the user is concerned, only one needs Perl, which might not already > be available and may be unwanted. Nah, it's not disk space. It's a news server; nickle and diming disk space by reducing script size would be, er, dumb. It's because I'm the sort of person who *looks* at these things all the time and tweaks them, and it's easier for me to look at and tweak something that's shorter and in Perl than something that's long and in shell. It's also easier for me to modify a Perl script and keep it secure. Again, a lot of this is personal preference. That's why I'd like people to have the choice. > I would agree with that attitude if these scripts were for your personal > use at your site only. Since INN is intended for use by many, it is > worth some extra time to accomplish a task in the best manner rather > than the quickest/easiest. Likely true, but at the same time it has to be easy enough to work on INN that people will keep working on INN. My guess is that the existing script is in Perl because the person who wrote it knew how to write it in Perl, and if you submitted a patch against INN 2.0 that provided the shell script as an alternative, it would be accepted. (On the other hand, I believe INN 2.0 includes innreport as the default log scanner, and innreport is the sort of thing that would be pretty much impossible to write in shell and have it run in finite time and produce nice output, and would be a real bitch to write in C.) -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Technical Details
Message-ID:
<m3lnqbiqye.fsf@windlord.Stanford.EDU>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<6napr9$oov$1@nnrp1.dejanews.com> <87hg13uhd9.fsf@erlenstar.demon.co.uk> <6nc7s9$1lc$1@news.supernal.net> <m390meuulh.fsf@windlord.Stanford.EDU> <6ncl16$5s6$1@news.supernal.net> <m3d8bqoxkm.fsf@windlord.Stanford.EDU> <6netla$su5$1@news.supernal.net> <m3k95wrk0t.fsf@windlord.Stanford.EDU> <6nhfdv$p44$1@news.supernal.net>Show Full Headers
Complete Article Headers
Message-ID: <m3lnqbiqye.fsf@windlord.Stanford.EDU> Subject: Re: Replacing innmail? Date: Thu, 02 Jul 1998 00:00:00 +0000 From: Russ Allbery <rra@stanford.edu> References: <6napr9$oov$1@nnrp1.dejanews.com> <87hg13uhd9.fsf@erlenstar.demon.co.uk> <6nc7s9$1lc$1@news.supernal.net> <m390meuulh.fsf@windlord.Stanford.EDU> <6ncl16$5s6$1@news.supernal.net> <m3d8bqoxkm.fsf@windlord.Stanford.EDU> <6netla$su5$1@news.supernal.net> <m3k95wrk0t.fsf@windlord.Stanford.EDU> <6nhfdv$p44$1@news.supernal.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 368283364 Sender: eagle@windlord.Stanford.EDU Organization: The Eyrie Newsgroups: news.software.nntp