Mark A. DeMichele said:
> Has anyone ever talked about porting the entire SA to java. I think it
> would make it more easily installed and run on multiple platforms,
> especially Windows. Not to mention the source code would probably be a
> lot more readable. As you can tell, I'm a Perl novice. I'm a pretty
> advanced java and Delphi programmer. I can program and read C++ and C,
> but I don't do it a lot so I'm not as good. I'm learning C# which it
> pretty much the same as java. I've also programmed in many other
> scripting languages. I have to say, that reading Perl code is probably
> the most difficult code to understand, excluding assembly language. I
> give you Perl guys a lot of credit. I'm not sure I could ever
> efficiently write a full Perl application. The code is so strange
> looking.
I am a professional Java developer, one who's toyed with perl, and one
who's hacked the SA codebase a little.
My take is that the SA codebase could be much cleaner than it is right
now. It's hard for me to follow. In my opinion, a complete redesign
(OO) and rewrite in java might make the code much easier to follow and
extend (then again, I am in fact a Java developer by trade). However,
there are some huge advantages to writing a tool like SA in perl.
1) Probably most important: RegEx built into language and WELL INTEGRATED.
There are nice (and fast, even) RegEx libraries for Java, but they're no
where near as easy to use!
2) Second most important, or maybe this is even more important than (1):
Other than windows, perl is already installed almost everywhere. Ever
installed a Sun JVM on a linux box? The "installer" simply requires you
to accept a license, then extracts the archive to the current directory...
*bleh*. Plus, Java is "non-free", so a large portion of the OSS is
already opposed to running java software.
3) Easily tied into shell scripts, procmail, etc. A native spamc-like
client for a Java daemon server (spamd) would mitigate this.
3b) Less startup overhead when a daemon is not running. The
'spamassassin' perl script, while it does have extra overhead, is nowhere
near as expensive as starting up a new modern JVM (Sun *is* working on
reducing this overhead, rumor has it 1.5 should be quicker to start up).
4) Hacking code seems to be quicker when using perl than when using Java.
This seems to help with rapid testing of new detection methods. Then
again, I have nothing which I can use to back this statement up :)
It's also my opinion that an OO redesign in perl would have many of the
same architectural benefits of a Java rewrite. To me, OO Perl is fugly
and confusing, but again I am a Java developer, not a Perl developer.
Also, there already are development efforts to clean up the internal
architecture, and new OO stuff like the plugin framework are coming soon,
which can be considered the beginnings of an OO redesign (at least for
parts of SA).
To summarize:
I think SA is best left in perl. I think SA would benefit from an OO
redesign.
--
Chris Thielen
Easily generate SpamAssassin rules to catch obfuscated spam phrases
(0BFU$C/\TED SPA/\/\ P|-|RA$ES):
http://www.sandgnat.com/cmos/