🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #36696

[slrn] Generator for an S-Lang-based scoring mechanism (1 of 2)

#36696
From: l... Lloyd Zusman
Date: Fri, 17 Oct 1997 00:00
128 lines
6843 bytes

[ Posted to news.software.readers and alt.lang.s-lang, but
  followups set to news.software.readers. ]

Well, I finished my first cut at 'scoregen', a Perl script which
generates an S-Lang-based scoring routine which can be used as a
replacement for the standard Slrn score file.  I did some preliminary
testing of this, and it seems to work fine.

I'm posting it here for discussion and feedback, as well as to make it
available to all of you who might find it useful or interesting.

I'm enclosing the first section of the scoregen README file at the end
of this message.  I'm posting a second message containing the
uuencoded, gzipped tar file of the package.  Before running scoregen,
you should read the complete README file and carefully study the
sample input and output that I enclosed.

I'm looking forward to your feedback.

-- 
 Lloyd Zusman
 l...@asfast.com

====================== first part of README file ======================

scoregen -- Generate S-Lang scoring routines from an Slrn score file
--------------------------------------------------------------------

Version 0.01
Lloyd Zusman <l...@asfast.com>
1997/10/17

IMPORTANT NOTE:  PLEASE READ ALL OF THIS BEFORE USING THIS SOFTWARE


BACKGROUND
----------

This is scoregen, a Perl script that reads an Slrn score file as input
and uses it to produce a group of S-Lang routines which perform the
same scoring functions.

The idea for scoregen came to me during a recent discussion in
news.software.readers among some of us Slrn aficionados.  One of us,
J.B. Nicholson-Owens <j...@pop-a-wheelie.midwest.net>, was suggesting
that Slrn's score-file processing be enhanced with variable expansion
and perhaps some simple functional processing.

During the ensuing debate, it occurred to some of us that this
functionality and a lot more could be had simply by doing the scoring
from within S-Lang instead of via the standard score file.

Some objections to this idea were raised, and most of them hinged
around the fact that it would be complicated and time-consuming to
manually construct the S-Lang from an existing score file, especially
one which is large.  It was then that I conceived of the current form
of scoregen.

Scoregen answers these objections because it automatically generates
the appropriate S-Lang code by reading a standard score file.  Once
this code is generated, the resulting S-Lang scoring routine can then
be easily modified by hand whenever new scoring logic is desired.

The following point is important, and so I'm putting it in caps:

    SCOREGEN IS ONLY INTENDED TO BE USED ONCE PER SCORE FILE

In other words, the recommended use of scoregen is for you to feed
your score file through it once and only once, and then to stop using
your score file.  From then on, you should use the resulting S-Lang
routines to do your article scoring, and you should modify the
S-Lang code directly if you want to make any changes.

The reason that I recommend this is that the resulting S-Lang-based
scoring routines will by necessity run a bit slower than the
optimized, compiled C routines that currently do scoring.  The only
advantage in using the resulting S-Lang-based routines is so that you
can easily add variable substitution and functional processing during
scoring.  If you don't want these added features, stick to your
standard score file and forget about scoregen.

Of course, if S-Lang-based scoring catches on, it can be speeded up
quite a bit if some new Slrn intrinsics would be defined.  I discuss
this topic in more detail below.

Scoregen generates the following routines:

  score_article()         This routine scores each article.  It's
                          what gets generated from your score file,
                          and its structure is pretty much parallel
                          to that of your score file.

  do_scoring()            This routine loops through all the articles
                          in a newsgroup, calling score_article()
                          on each one.  It's designed to be invoked
                          from within article_mode_hook.  Alternatively,
                          the name of this routine can be changed to
                          "article_mode_hook", and it'll work just
                          fine in this capacity.

  convenience routines    The above two routines make use of a few
                          convenience routines that I wrote to
                          simplify the S-Lang-based scoring
                          procedure.  These convenience routines are
                          also generated by scoregen.
    

Some of the convenience routines I wrote are direct recodings of C
routines that exist in the S-Lang source code.  These routines are
good candidates for intrinsics.  The other convenience functions can
also be made into intrinsics if this is deemed useful.  The
S-Lang-based scoring would probably be speeded noticeably if these
routines were to be made into intrinsics (at least for large score
files).  After some discussion, feedback, and inevitable retooling,
I'm quite willing to do the work to create these intrinsics for a
future version of S-Lang.

Note that one major purpose of scoregen is to stimulate discussion and
debate about S-Lang-based scoring.  Although I spent some time trying
to optimize scoregen and make it useful, I do not consider it the
"be-all and the end-all".  I'm hoping that through our discussion, we
Slrn lovers can come up with the best and most useful approaches to
scoring.


Technical Details
Message-ID: <slrn64dtrv.oql.ljz@ljz.asfast.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
References: <slrn63gm05.ad.jbn@pop-a-wheelie.midwest.net> <slrn63gr84.13h.sp_robi@Elvira.home> <slrn63h1ti.ad.jbn@pop-a-wheelie.midwest.net> <slrn63rfmg.bnv.sp_robi@Elvira.home> <slrn63rp0b.411.jbn@pop-a-wheelie.midwest.net> <slrn63sjme.44k.Hubert.Canon@guenievre.irisa.fr> <slrn6429lb.65s.jbn@pop-a-wheelie.midwest.net> <slrn642k1i.fj9.ljz@ljz.asfast.net> <slrn6434a0.6ms.jbn@pop-a-wheelie.midwest.net> <slrn643cih.puh.ljz@ljz.asfast.net> <slrn643e4a.1bj.lahvak+n@math.mps.ohio-state.edu> <slrn644l21.74r.jbn@pop-a-wheelie.midwest.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrn64dtrv.oql.ljz@ljz.asfast.net>
Subject: [slrn] Generator for an S-Lang-based scoring mechanism (1 of 2)
Date: Fri, 17 Oct 1997 00:00:00 +0000
From: l...@asfast.com (Lloyd Zusman)
References: <slrn63gm05.ad.jbn@pop-a-wheelie.midwest.net> <slrn63gr84.13h.sp_robi@Elvira.home> <slrn63h1ti.ad.jbn@pop-a-wheelie.midwest.net> <slrn63rfmg.bnv.sp_robi@Elvira.home> <slrn63rp0b.411.jbn@pop-a-wheelie.midwest.net> <slrn63sjme.44k.Hubert.Canon@guenievre.irisa.fr> <slrn6429lb.65s.jbn@pop-a-wheelie.midwest.net> <slrn642k1i.fj9.ljz@ljz.asfast.net> <slrn6434a0.6ms.jbn@pop-a-wheelie.midwest.net> <slrn643cih.puh.ljz@ljz.asfast.net> <slrn643e4a.1bj.lahvak+n@math.mps.ohio-state.edu> <slrn644l21.74r.jbn@pop-a-wheelie.midwest.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!not-for-mail
X-Deja-AN: 281143002
Followup-To: news.software.readers
X-Newsgroup: news.software.readers
Organization: As Fast
Reply-To: l...@asfast.com (Lloyd Zusman)
Newsgroups: news.software.readers,alt.lang.s-lang