Mailing List Archive

Port SA to Java
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.

Anyway, I was just curious.

Thanks,
Mark DeMichele
Re: Port SA to Java [ In reply to ]
At 10:28 AM 3/11/2004, Mark A. DeMichele wrote:
>Has anyone ever talked about porting the entire SA to java.

Nope, that's new to me. And I for one can't see that the benefits would be
very significant, except to windows users. Certainly not enough to outweigh
the effort.

>I think it would make it more easily installed and run on multiple
>platforms, especially Windows.

The latter half (re: windows) is true, the latter half is debatable. I've
seen more unix boxes with perl support than java support..

>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 thin the "code would probably be a lot more readable" is a very
subjective thing. I know a smidge of perl, and am a excellent C and C++.. I
find Java extraordinarily weird and tough to read, as I don't know the
language.

And, lets face it, the sa-devel team is for the most part perl
programmers.. I'm sure several know java, but I'd be surprised if they were
all as good at java as they are at perl. So, in doing a port, you'd need a
new devel team.
Re: Port SA to Java [ In reply to ]
somebody has to say it....

Java sux.

Matt Kettler wrote:

> At 10:28 AM 3/11/2004, Mark A. DeMichele wrote:
>
>> Has anyone ever talked about porting the entire SA to java.
>
>
> Nope, that's new to me. And I for one can't see that the benefits
> would be very significant, except to windows users. Certainly not
> enough to outweigh the effort.
>
>> I think it would make it more easily installed and run on multiple
>> platforms, especially Windows.
>
>
> The latter half (re: windows) is true, the latter half is debatable.
> I've seen more unix boxes with perl support than java support..
>
>> 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 thin the "code would probably be a lot more readable" is a very
> subjective thing. I know a smidge of perl, and am a excellent C and
> C++.. I find Java extraordinarily weird and tough to read, as I don't
> know the language.
>
> And, lets face it, the sa-devel team is for the most part perl
> programmers.. I'm sure several know java, but I'd be surprised if they
> were all as good at java as they are at perl. So, in doing a port,
> you'd need a new devel team.
>
>
Re: Port SA to Java [ In reply to ]
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/
Re: Port SA to Java [ In reply to ]
On Thu, Mar 11, 2004 at 11:36:48AM -0600, mike is rumored to have said:
>
> somebody has to say it....
>
> Java sux.

And if you hadn't, I probably would've...


--
"Fill the unforgiving minute with sixty seconds worth of distance run."
- Rudyard Kipling (1865-1936)
Re: Port SA to Java [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Matt Kettler writes:
>At 10:28 AM 3/11/2004, Mark A. DeMichele wrote:
>>Has anyone ever talked about porting the entire SA to java.
>
>Nope, that's new to me. And I for one can't see that the benefits would be
>very significant, except to windows users. Certainly not enough to outweigh
>the effort.
>
>>I think it would make it more easily installed and run on multiple
>>platforms, especially Windows.
>
>The latter half (re: windows) is true, the latter half is debatable. I've
>seen more unix boxes with perl support than java support..
>
>>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 thin the "code would probably be a lot more readable" is a very
>subjective thing. I know a smidge of perl, and am a excellent C and C++.. I
>find Java extraordinarily weird and tough to read, as I don't know the
>language.
>
>And, lets face it, the sa-devel team is for the most part perl
>programmers.. I'm sure several know java, but I'd be surprised if they were
>all as good at java as they are at perl. So, in doing a port, you'd need a
>new devel team.

Plus this one, at least, spent a couple of years writing java code,
and far prefers perl to java ;)

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFAUKkUQTcbUG5Y7woRAkHzAJ4xax+P/KNegeMgcYC66F/KI8n78ACfYm82
MWMFbNv5C8Z30VsB9ZJk064=
=BZV3
-----END PGP SIGNATURE-----
Re: Port SA to Java [ In reply to ]
On Thu, Mar 11, 2004 at 09:59:49AM -0800, Justin Mason wrote:
> Plus this one, at least, spent a couple of years writing java code,
> and far prefers perl to java ;)

I spent the last year in college doing Java, both for a senior project
(http://www.kluge.net/mqp/ if you're interested) and for part of a
grad. class ... The only thing I remember from that experience is
"never again". ;)

--
Randomly Generated Tagline:
A person's language is an index of his mind.
Re: Port SA to Java [ In reply to ]
On Thu, Mar 11, 2004 at 11:37:20AM -0600, Chris Thielen wrote:
> 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).

We are working to improve the OO design for SpamAssassin 3.0 without
re-writing everything. Would you care to take a look at the code and
suggest any improvements?

Also, you can look at this thread where we discuss many of the issues
we want to address.
http://marc.theaimsgroup.com/?t=107472222800002&r=1&w=2

Feel free to file bug reports with suggestions so we don't lose them.

Thanks,
--
Duncan Findlay
Re: Port SA to Java [ In reply to ]
On Thu, 2004-03-11 at 10:19, Theo Van Dinter wrote:
> I spent the last year in college doing Java, both for a senior project
> (http://www.kluge.net/mqp/ if you're interested) and for part of a
> grad. class ... The only thing I remember from that experience is
> "never again". ;)

Amen.

--
jon@tgpsolutions.com

Administrator, tgpsolutions
http://www.tgpsolutions.com
Re: Port SA to Java [ In reply to ]
From: "Matt Kettler" <mkettler@evi-inc.com>

> At 10:28 AM 3/11/2004, Mark A. DeMichele wrote:
> >I think it would make it more easily installed and run on multiple
> >platforms, especially Windows.
>
> The latter half (re: windows) is true, the latter half is debatable. I've
> seen more unix boxes with perl support than java support..

The whole statement is questionable. MS does not ship Java with their
Windows boxes anymore. At that point the Java advantage dissipates.

> >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 thin the "code would probably be a lot more readable" is a very
> subjective thing. I know a smidge of perl, and am a excellent C and C++..
I
> find Java extraordinarily weird and tough to read, as I don't know the
> language.

Ditto. But one advantage for perl is that it is a string handling
language from the gitgo and the problem is one of string handling.
Ergo perl is probably optimal. (Although - I know REXX really well
so for me it'd be ideal. {^_-})

> And, lets face it, the sa-devel team is for the most part perl
> programmers.. I'm sure several know java, but I'd be surprised if they
were
> all as good at java as they are at perl. So, in doing a port, you'd need a
> new devel team.

The best tool job that you know how to handle is the right tool to use.
{^_-}
Re: Port SA to Java [ In reply to ]
From: "Steve Thomas" <lists@sthomas.net>

> On Thu, Mar 11, 2004 at 11:36:48AM -0600, mike is rumored to have said:
> >
> > somebody has to say it....
> >
> > Java sux.
>
> And if you hadn't, I probably would've...

Please, gentlemen, can we avoid a language war here? perl has built
in features that fit this sort of project and the programmers who
are its chief authors know perl well. Therefore perl is "the best
language for spamassassin." And I'm not too keyed up over what might
be the ideal language for a "SpamWhompinator" or the like. I'm simply
interested in keeping SpamAssassin working well.

Note, too, that moving to a new language means a halt to continued
SpamAssassin development in its current form while they rewrite and
debug. That would be "unfortunate". So changing languages at this
time seems to be a theoretical argument that is not germane to the
list at this time.

{^_^} (If you're not careful you'll get me going about REXX just
to be obnoxious. If polite requests as above don't work
maybe threats will.)