• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When do choose Jython?

 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bill and all,
I am glad that i have chance to ask this question instead of digging into many documentations.(May be i am too lazy). I use Java and Python for sometimes in my projects(company's). I understand the strenght of each of these two languages. My question is, under what circumstances you will consider Jython as oppose to Python or Java? I am sorry this is a broad question.
Thank for any reply.
 
Author
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, one obvious place where using Jython important is when you can't decide between Java and Python. Just use Jython and you don't need to decide- just move in and out of these two languages in the same app.
If the app you are writting will never run in a Java framework, and it cannot benefit from Java's huge library of existing classes, then Python might make more sense. If you have a huge amount of OS-level work to do, then Python might make more sense. If raw runtime speed is primary, then use Java.
Otherwise, it makes sense to use Jython or a combination of Jython and Java classes.
 
SoonAnn Lim
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bill,
Thank you for the precise reply on my broad question. Your reply lead to another question. In concept, the overhead involve in Jython is higher that using Python or Java by itself. What is your opinion about these overhead? What are the decision pitfalls an application designer and implementer must be awared of? Since Python needs an interpreter and Java needs a virtual machine, Jython will need both of them. This make me feel that Jython may speed up the process of application development and give more flexibility in the design, but i don't see much gain in performance in using Jython. Am i in the right direction?
Regards
 
Robert W Bill
Author
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right. As with most high-level abstractions there is a memory and performance penalty that you must pay to get the flexibility and quick development. This penalty isn't as large as the order of magnitude between C and some scripting languages implemented in C, so that's good.
One anology that I really like is Java's hotspot. It looks for the code that needs optimizing and doesn't waste its time on the code that is rarely called anyway. That's what developing with Jython is often like. After writing something in jython, you can quickly tell which classes are those "hotspots" that are hogging the resources, and then move those to Java code. The Java/Python boundary is fairly transparent in Jython, so this is really easy and it leaves you with a fairly optimized app after a very light weight development cycle. I think Hotspot is great, and it makes sense to apply that thinking to development time as well.
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic