Re: Compiler(s) in 2.5+?

View: New views
2 Messages — Rating Filter:   Alert me  

Re: Compiler(s) in 2.5+?

by Avi Flax :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Mar 10, 2009 at 10:13, Frank Wierzbicki <fwierzbicki@...> wrote:

> There is also a project started to replace jythonc called "clamp"
> started by Charlie Groves on github, but it will probably not be
> finished until after 2.5 releases.
>
> jythonc itself prints out this warning in 2.2:
>
> Warning: jythonc is unmaintained and will not be included in
> Jython-2.3.  See http://jython.org/Project/jythonc.html for
> alternatives to jythonc.  Add '-i' to your invocation of jythonc to
> turn off this warning

I'm a little confused. What compiler(s), if any, will be included in
the final release of 2.5? And are they in the current beta? If not,
shouldn't there be another beta to test the compiler(s)?

--
Avi Flax » Lead Technologist » Partner » Arc90 » http://arc90.com

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users

Re: Compiler(s) in 2.5+?

by Frank Wierzbicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Mar 20, 2009 at 10:49 AM, Avi Flax <avif@...> wrote:
> On Tue, Mar 10, 2009 at 10:13, Frank Wierzbicki <fwierzbicki@...> wrote:
> I'm a little confused. What compiler(s), if any, will be included in
> the final release of 2.5? And are they in the current beta? If not,
> shouldn't there be another beta to test the compiler(s)?
I'll start by defining "compile" as translating Python source code to
.class bytecodes in the case of Jython.  In the old world, jythonc was
a completely separate compiler with a completely separate model from
the internal compilation model of Jython.  Also, jythonc went a little
beyond this definition of compiling and did what you might call
"freezing" Jython code.  By "freezing" I mean that jythonc exposed a
more static version of the Jython code vs. how it is normally
compiled.

When Jython executes any code, even in an interactive session, even in
"eval" and "exec", it first compiles the Python source directly into
.class bytecodes.  The old jythonc first turned Python source into
Java source, and then executed javac on the result.  For a number of
technical reasons, modern Python source code cannot be translated into
reasonable Java source code, and so jythonc had to go.

There are lots of ways to cover the same use cases that jythonc
covered without using jythonc.  Some good recipes:

For using Jython from Java code:

Simple and Efficient Jython Object Factories
http://wiki.python.org/jython/JythonMonthly/Articles/October2006/3

For packaging up your Jython apps:

Distributing Jython Scripts
http://wiki.python.org/jython/JythonFaq/DistributingJythonScripts

Also note that you can pre-compile your python scripts to .class files using:

jython [jython home]/Lib/compileall.py [the directory where you keep
your python code]

We do know that these recipes lack some ease of use that will be
missed from jythonc.  We also know that the "freezing" behavior of
jythonc is desirable from some sort of tool.  The plan is to use the
exact compiler that already produces .class files in Jython and do
some bytecode decoration in this new project "clamp".  Charlie Groves
has already proven that this is a viable option with the work he has
done with clamp.

There are a number of reasons that we have decoupled clamp from the
main Jython project.  The first is that Jython as a project is very
useful without a jythonc.  We need to get a 2.5 released, and we don't
want to have it delayed by the clamp project.  Another reason is that
clamp is very experimental.  Before we bring clamp into the Jython
project and rename it "jythonc" (if we ever do that), we will want to
know that we have designed it in a way that we can live with for many
years to come.

We do want to make every effort to release clamp concurrently with
Jython 2.5 GA, but I don't think we are ready to make that guarantee.
Having said that, once Jython 2.5 comes out, clamp will become one of
my highest priorities.  We know that the jythonc replacements above
are somewhat awkward.

-Frank

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users