Legacy Perl code and Zope. A pipe dream?
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible? It looks like the Zope-Perl project and everything else Perl related died long ago. Help me out here Zope gurus. Thanks! Derek Basch __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
--On 2. Oktober 2006 15:22:09 -0700 Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
By rewriting your code you can refactor everything. Your idea sounds like rewriting everything from scratch. But how is Perl related to Zope? You might want to rewrite it in Python (which is used by Zope as implementation language). -aj
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
Refactor? No. But it's quite likely that you can redo it quite quickly with Zope thanks to all the third-party products. What does you perl code/crap do? What type of site is it? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
--- Lennart Regebro <regebro@gmail.com> wrote:
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
Refactor? No. But it's quite likely that you can redo it quite quickly with Zope thanks to all the third-party products.
What does you perl code/crap do? What type of site is it?
Thanks for the responses everyone. Perhaps refactor wasn't the best choice of words. The site is a very large online gaming website (not gambling). The legacy perl code does many, many things (administration, game play, accounting, message boards, publishing, mail, etc...) and really is around a million lines. Rewriting the current perl code in python/zope would take a small eternity even with the rapid development that zope permits. I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar. Forgive me if my zope terminology is a bit off as I haven't worked with zope in about three years. As it stands it looks like I will need to use a PHP or Perl web application framework. PHP because it has decent Perl to PHP support: http://www.zend.com/php5/articles/php5-perl.php Or Perl, for obvious reasons. Perhaps something like Catalyst: http://www.catalystframework.org/ However, neither of the above solutions is as enticing as the joy I am sure I would get from Zope. Which way should I go? Thanks, Derek Basch __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
----- Original Message ----- From: "Derek Basch" <dbasch@yahoo.com> To: "Lennart Regebro" <regebro@gmail.com>; <zope@zope.org> Sent: Tuesday, October 03, 2006 1:25 PM Subject: Re: [Zope] Legacy Perl code and Zope. A pipe dream?
--- Lennart Regebro <regebro@gmail.com> wrote:
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
Refactor? No. But it's quite likely that you can redo it quite quickly with Zope thanks to all the third-party products.
What does you perl code/crap do? What type of site is it?
Thanks for the responses everyone.
Perhaps refactor wasn't the best choice of words. The site is a very large online gaming website (not gambling). The legacy perl code does many, many things (administration, game play, accounting, message boards, publishing, mail, etc...) and really is around a million lines. Rewriting the current perl code in python/zope would take a small eternity even with the rapid development that zope permits.
I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar. Forgive me if my zope terminology is a bit off as I haven't worked with zope in about three years.
As it stands it looks like I will need to use a PHP or Perl web application framework.
PHP because it has decent Perl to PHP support:
http://www.zend.com/php5/articles/php5-perl.php
Or Perl, for obvious reasons. Perhaps something like Catalyst:
http://www.catalystframework.org/
However, neither of the above solutions is as enticing as the joy I am sure I would get from Zope. Which way should I go?
It sounds like you already have a web application (in perl) up and running, so what do you want Zope (or anything else) to accomplish for you? Jonathan
--- Jonathan <dev101@magma.ca> wrote:
----- Original Message ----- From: "Derek Basch" <dbasch@yahoo.com> To: "Lennart Regebro" <regebro@gmail.com>; <zope@zope.org> Sent: Tuesday, October 03, 2006 1:25 PM Subject: Re: [Zope] Legacy Perl code and Zope. A pipe dream?
--- Lennart Regebro <regebro@gmail.com> wrote:
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
Refactor? No. But it's quite likely that you can redo it quite quickly with Zope thanks to all the third-party products.
What does you perl code/crap do? What type of site is it?
Thanks for the responses everyone.
Perhaps refactor wasn't the best choice of words. The site is a very large online gaming website (not gambling). The legacy perl code does many, many things (administration, game play, accounting, message boards, publishing, mail, etc...) and really is around a million lines. Rewriting the current perl code in python/zope would take a small eternity even with the rapid development that zope permits.
I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar. Forgive me if my zope terminology is a bit off as I haven't worked with zope in about three years.
As it stands it looks like I will need to use a PHP or Perl web application framework.
PHP because it has decent Perl to PHP support:
http://www.zend.com/php5/articles/php5-perl.php
Or Perl, for obvious reasons. Perhaps something like Catalyst:
http://www.catalystframework.org/
However, neither of the above solutions is as enticing as the joy I am sure I would get from Zope. Which way should I go?
It sounds like you already have a web application (in perl) up and running, so what do you want Zope (or anything else) to accomplish for you?
Jonathan
Yes, the application is currently deployed but it is the gnarliest mess of ten year old spaghetti code you have ever seen. No session handling, no automatic CGI variable parsing, no authentication....no fun. I am attempting to find a path towards a proper web application framework without having to rewrite every single line of legacy code. For example, all new projects would adhere to framework xyz and the legacy code would still play nicely with the framework. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
----- Original Message ----- From: "Derek Basch" <dbasch@yahoo.com> To: "Jonathan" <dev101@magma.ca>; <zope@zope.org> Sent: Tuesday, October 03, 2006 1:54 PM Subject: Re: [Zope] Legacy Perl code and Zope. A pipe dream?
--- Jonathan <dev101@magma.ca> wrote:
----- Original Message ----- From: "Derek Basch" <dbasch@yahoo.com> To: "Lennart Regebro" <regebro@gmail.com>; <zope@zope.org> Sent: Tuesday, October 03, 2006 1:25 PM Subject: Re: [Zope] Legacy Perl code and Zope. A pipe dream?
--- Lennart Regebro <regebro@gmail.com> wrote:
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
Refactor? No. But it's quite likely that you can redo it quite quickly with Zope thanks to all the third-party products.
What does you perl code/crap do? What type of site is it?
Thanks for the responses everyone.
Perhaps refactor wasn't the best choice of words. The site is a very large online gaming website (not gambling). The legacy perl code does many, many things (administration, game play, accounting, message boards, publishing, mail, etc...) and really is around a million lines. Rewriting the current perl code in python/zope would take a small eternity even with the rapid development that zope permits.
I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar. Forgive me if my zope terminology is a bit off as I haven't worked with zope in about three years.
As it stands it looks like I will need to use a PHP or Perl web application framework.
PHP because it has decent Perl to PHP support:
http://www.zend.com/php5/articles/php5-perl.php
Or Perl, for obvious reasons. Perhaps something like Catalyst:
http://www.catalystframework.org/
However, neither of the above solutions is as enticing as the joy I am sure I would get from Zope. Which way should I go?
It sounds like you already have a web application (in perl) up and running, so what do you want Zope (or anything else) to accomplish for you?
Jonathan
Yes, the application is currently deployed but it is the gnarliest mess of ten year old spaghetti code you have ever seen. No session handling, no automatic CGI variable parsing, no authentication....no fun. I am attempting to find a path towards a proper web application framework without having to rewrite every single line of legacy code. For example, all new projects would adhere to framework xyz and the legacy code would still play nicely with the framework.
If you want to maintain this application within Zope then you will have to eventually rewrite the perl scripts into python. However, as a first step, perhaps you could turn your perl scripts into standalone routines which can be invoked by a Zope External Method (use an 'os' call), and then communicate with the perl script via pipes or temporary files. This should allow you to create an intial framework in Zope, but continue to use the business logic in the perl scripts. This approach is based on the assumption that the perl scripts can be turned into 'functions' which take some input parameters, then apply some internal logic, and then return some value(s) which you then process/store in Zope. I don't know if this approach will buy you anything or not... it all depends on how the perl routines are written and what they do. It may be easier to rewrite the whole thing! The end result will probably be more maintainable and remember 1000 lines of Perl = 10 lines of python ;-) (ok, i may have exaggerated just a little...) Jonathan
If I can provide any suggestion, take a look at "Refactoring", by Martin Fowler, and start applying the refactorings there provided. This is not, I think a Zope/Perl/Python/PHP issue, but rather a refactoring/migration problem, and it should be explored in that places (just a suggestion, of course). Regards Marco On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
--- Jonathan <dev101@magma.ca> wrote:
Yes, the application is currently deployed but it is the gnarliest mess of ten year old spaghetti code you have ever seen. No session handling, no automatic CGI variable parsing, no authentication....no fun. I am attempting to find a path towards a proper web application framework without having to rewrite every single line of legacy code. For example, all new projects would adhere to framework xyz and the legacy code would still play nicely with the framework.
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Marco Bizzarri http://notenotturne.blogspot.com/
there is some info in zopebook 2.6 edition in the advanced scripting chapter: http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.st... where there are some links in this chapter where it mentions "activestate": http://www.zope.org/Members/andym/wiki/FrontPage http://downloads.activestate.com/Zope-Perl/ hth, Josh
Sorry, just noticed thats already been considered... On 04/10/06, Josh Burvill <jburvill@gmail.com> wrote:
there is some info in zopebook 2.6 edition in the advanced scripting chapter:
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.st...
where there are some links in this chapter where it mentions "activestate": http://www.zope.org/Members/andym/wiki/FrontPage http://downloads.activestate.com/Zope-Perl/
hth,
Josh
--- Josh Burvill <jburvill@gmail.com> wrote:
Sorry, just noticed thats already been considered...
On 04/10/06, Josh Burvill <jburvill@gmail.com> wrote:
there is some info in zopebook 2.6 edition in the advanced scripting chapter:
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.st...
where there are some links in this chapter where it mentions "activestate": http://www.zope.org/Members/andym/wiki/FrontPage http://downloads.activestate.com/Zope-Perl/
hth,
Josh
Thanks for all the replies everyone! This all certainly helped me in deciding which direction to go. Cheers, Derek Basch __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On 10/4/06, Derek Basch <dbasch@yahoo.com> wrote:
Thanks for all the replies everyone! This all certainly helped me in deciding which direction to go.
Well, that's all we can hope for at this point! :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.nuxeo.org/
From: "Derek Basch" <dbasch@yahoo.com> Sent: Tuesday, 3 de October de 2006 18:54 Hello.
Yes, the application is currently deployed but it is the gnarliest mess of ten year old spaghetti code you have ever seen. No session handling, no automatic CGI variable parsing, no authentication....no fun. I am attempting to find a path towards a proper web application framework without having to rewrite every single line of legacy code. For example, all new projects would adhere to framework xyz and the legacy code would still play nicely with the framework.
Is your perl web app up and running? Leave it as it is. Just deploy a Zope instance in front of your perl web app and start relaying http requests throught an ExternalMethod ( using httplib, for example, its a nice way to start coding in python ) or similar. You will instantly find out that you will have to create a tree of objects similar to the perl scripts and folders that you have. Use DTML Method objects or even better, Python Scripts ones. You can even mount your static content folders into Zope using the "Local File System" product. Yes, it seems a little bit crazy, but gives you everything that Zope can offer w/out touching on the old web app. Anything ( apache, pound ) running as a load balancer/reverse proxy can also help, because you can redirect some http requests to the old web app and new ones to the new web app. Best regards, @671, Nbk
On 10/3/06, Derek Basch <dbasch@yahoo.com> wrote:
Perhaps refactor wasn't the best choice of words. The site is a very large online gaming website (not gambling). The legacy perl code does many, many things (administration, game play, accounting, message boards, publishing, mail, etc...) and really is around a million lines. Rewriting the current perl code in python/zope would take a small eternity even with the rapid development that zope permits.
Well, you don't need to rewrite most of it, as Zope handles some of this already, and there are products for some of the rest. But yes. It would be a lerge project, of course.
I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar.
Well, that wouldn't help you. You would then still have one million lines of perl code/crap, just wrapped in a Zope layer.
Which way should I go?
Hard to say. If the Perl code was NOT spaghetti-code (is there Perl code that is not) then a perl framework would probably have been the natural way to go. Now I don't even know if that would help you, because that assumes you can extract relevant parts from you current app and reuse them. And if you can, well, then it's not spaghetti. :) If it really is spaghetti, you'll end up rewriting everything anyway. Install something like CPS and Plone and look at Plones third-party products, and you'll get a feeling for how much you really need to write from scratch. There's a lot out there. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
Derek Basch wrote: [snip]
I saw that the zope-perl project is virtually dead and was hoping that some magical zope to perl bridge existed. Something that would allow me to use our existing perl code as an external method or someting similar. Forgive me if my zope terminology is a bit off as I haven't worked with zope in about three years.
As it stands it looks like I will need to use a PHP or Perl web application framework.
The closest thing right now available that might help you is Python WSGI technology. Zope 3 has WSGI support; Zope 2's support is still prototypical as far as I know, but Ian Bicking actually mentions work on this in the blog entry I link to below too. There has been some work done to bridge PHP into WSGI, allowing PHP applications can be embedded into Python applications. http://blog.ianbicking.org/2006-wphp.html What you might be able to do is write something based on WSGI that allows bridging Perl applications into Python applications. This should allow you then to embed these Perl applications into a Zope 3 context. Anyway, not a ready-made answer, but perhaps it will help. Regards, Martijn
Derek Basch wrote at 2006-10-2 15:22 -0700:
I have about a million lines of Perl code/crap that I would like to refactor to Zope. Is this even possible?
I think I have seen a Python-Perl adapter (search for such a thing; I will not search for you). If you find one, you may be able to use Perl from Python (and by extension from Zope). -- Dieter
participants (9)
-
Andreas Jung -
Derek Basch -
Dieter Maurer -
Jonathan -
Josh Burvill -
Lennart Regebro -
Marco Bizzarri -
Martijn Faassen -
Olavo Santos