Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding compatibility #3

Open
AshwinRamesh opened this issue Mar 17, 2017 · 7 comments
Open

Question regarding compatibility #3

AshwinRamesh opened this issue Mar 17, 2017 · 7 comments
Labels

Comments

@AshwinRamesh
Copy link

Hi guys,

First of all, great work on what you guys are trying to accomplish!!

My question comes regarding this issue on Bitbucket: https://bitbucket.org/ssllab/zippy/issues/4/things-that-are-missing-in-zippy

Are these modules still not supported under zippy?

Regards,

Ash

@qunaibit
Copy link
Collaborator

Hi,

Thank you!

The modules you are referring to in the list list are still uncovered and we are happy to accept pull requests to support them.

Cheers,

@SemanticBeeng
Copy link

@qunaibit - thank you, this will be very useful as it supports the need to migrate Python to things like Apache Spark.

I am considering using this for a project https://github.com/SemanticBeeng/The_Termolator which I am looking to migrate to Spark.

Could Zippy be used to as a stepping stone by running a mix of ported (Java/Scala) code and Python as is. This could be a good strategy given the lack of familiarity with the code base. I could port incrementally.

Since it is all on the JVM this should be ... workable but the interpreter must be tread safe.
Jep is not: https://github.com/mrj0/jep/wiki/How-Jep-Works#threading-complications

Is the Zippy interpreter thread safe (no thread state/affinity, etc)?

Thoughts in general about this idea please?

@qunaibit
Copy link
Collaborator

Hi,

Currently, ZipPy doesn't support a mixture of Java and Python.
ZipPy rely on Jython's parser to build the AST (Abstract Syntax Tree), and since Jython uses threads to do the process, we can't guarantee thread safety.

Best,

@SemanticBeeng
Copy link

Understood it does not support the mix.
But after Python is parsed (once) and ready for execution (many times) is there anything not thread safe?
Or is it only up to Truffle / Graal runtime?

Found this https://github.com/graalvm/graal/blob/master/examples/src/org.graalvm.polyglot.examples/src/org/graalvm/polyglot/examples/ParallelEval.java#L11-L12

Example shows how scripts can be executed in parallel. Please note that contexts are single threaded by design. It is allowed to use a context on more than one thread, but not at the same time.

Which would suggest it is like Jep.

Once all it is JVM bytecode (from Java or Python) they overall program should run well together, no?
My implicit assumption it that there is a way to use Zippy to translate to bytecode and then run that on the JVM without having to re-parse / analyze more than once.

Kindly advise.
Thanks

@qunaibit
Copy link
Collaborator

But after Python is parsed (once) and ready for execution (many times) is there anything not thread safe?
Or is it only up to Truffle / Graal runtime?

In this case, it should be fine for multiple Threads.

Once all it is JVM bytecode (from Java or Python) they overall program should run well together, no?
My implicit assumption it that there is a way to use Zippy to translate to bytecode and then run that on the JVM without having to re-parse / analyze more than once.

The only way, I can think of at the moment, is that you build your own internal library in Java and call it from your Python program.
e.g. Math library and register the library here.

Best,

@SemanticBeeng
Copy link

SemanticBeeng commented Jul 19, 2017

@qunaibit how is the Python 3 implemented; heard you are using Jython but that does not support Python 3 does it?

https://bitbucket.org/ssllab/zippy - "ZipPy is a fast and lightweight Python 3 implementation "

More specifically, does zippy support typing?
See this for context
https://gitter.im/python/typing?at=596f47af329651f46ea11f04
https://www.python.org/dev/peps/pep-0484/#rationale-and-goals

Thanks in advance.

@qunaibit
Copy link
Collaborator

how is the Python 3 implemented; heard you are using Jython but that does not support Python 3 does it?
https://bitbucket.org/ssllab/zippy - "ZipPy is a fast and lightweight Python 3 implementation "

We use Jython primarily as a parser, so some Python 3 features are not available yet. Once Jython 3 reaches a beta stage we will replace the current Jython jar and support the other Python 3 features.

More specifically, does zippy support typing?
See this for context
https://gitter.im/python/typing?at=596f47af329651f46ea11f04
https://www.python.org/dev/peps/pep-0484/#rationale-and-goals

Typing isn't supported, yet, in ZipPy

Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants