#jython IRC Log (v0.9)

Index

IRC Log for 2016-04-12

Timestamps are in GMT/BST.

[0:07] * stewori (~stefan@5.146.129.173) has joined #jython
[0:19] * agronholm (~agronholm@2a00-1190-c00e-0001-c956-71a6-cc92-0439.v6.cust.suomicom.net) Quit (Ping timeout: 250 seconds)
[0:24] * agronholm (~agronholm@2a00-1190-c00e-0001-b06d-5194-f3ad-555d.v6.cust.suomicom.net) has joined #jython
[0:24] * ChanServ sets mode +o agronholm
[0:27] <dyce_> how do i pass some sys.argv to http://www.jython.org/javadoc/org/python/util/PythonInterpreter.htm
[2:19] * srcerer_ (~chatzilla@dns2.klsairexpress.com) has joined #jython
[2:20] * fwierzbicki1 (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) Quit (Read error: Connection reset by peer)
[2:21] * fwierzbicki (~Adium@99-106-169-5.lightspeed.sntcca.sbcglobal.net) has joined #jython
[2:22] * srcerer (~chatzilla@dns2.klsairexpress.com) Quit (Ping timeout: 248 seconds)
[2:25] * InfinityBear (~InfinityB@69.159.21.121) has joined #jython
[2:26] <InfinityBear> Question
[2:26] <InfinityBear> Can Jython be used on Android
[3:28] * srcerer_ is now known as srcerer
[3:36] <stewori> InfinityBear: Unfortunately not
[3:36] <stewori> at least not yet
[3:37] * InfinityBear (~InfinityB@69.159.21.121) Quit (Ping timeout: 246 seconds)
[3:38] * InfinityBear (~InfinityB@69.159.21.121) has joined #jython
[3:42] <InfinityBear> so
[3:42] <InfinityBear> can jytho be used on android?
[3:42] <InfinityBear> jython
[4:01] <stewori> InfinityBear: Unfortunately not (see log)
[4:02] <stewori> afaik the main hurdle is that android disallows generating bytecode at runtime
[4:03] <jimbaker> it is feasible. but we need to do some more engineering, to support ahead-of-time compilation
[4:03] <stewori> I suppose porting the lib to android API would also not be trivial, but I actually cannot tell
[4:06] <stewori> Wouldn't it be already a milestone to support code that does not need runtime code-generation? I.e. code that can be precompiled by e.g. import compileall; compileall.compile_dir('some_dir')
[4:07] <jimbaker> stewori, the problem is in code that import java classes. in general, the corresponding proxy code is generated at runtime
[4:07] <jimbaker> (btw, this proxy generation is what is blocking 2.7.1...)
[4:08] <jimbaker> clamp does address, but it requires additional packaging for AOT
[4:08] <InfinityBear> :(
[4:09] <InfinityBear> so is Jython worth learning coming from Python?
[4:09] <jimbaker> i suppose there is a minimal subset of jython that does not depend on importing java classes. but it's sort of defeats the purpose of jython on android i would think
[4:09] <InfinityBear> Just for daemons
[4:09] <jimbaker> InfinityBear, jython is a python implementation. there is no real extra learning when it comes to python. pretty much pure python runs on jython
[4:10] <jimbaker> but of course the reason one uses it is for java integration. which usually requires learning about that ecosystem to use effectively
[4:12] <InfinityBear> I am thinking about doing a Daemon in Python because I can
[4:16] <InfinityBear> jimbaker, So Jython lets me take advantage of Java libraries from Python
[4:16] <InfinityBear> and the JIT in the JVM
[4:17] <jimbaker> yes. but remember, the JIT does give you cpython-level performance for python code. we need more work to make it speed up. our focus has instead been on making the integration and compatibility better
[4:18] <jimbaker> if you are integrating with java code... that's the usual way to speed things up in jython. usually just a small percentage of code, and easy to do since the java integration is so good
[4:19] <InfinityBear> ok
[4:20] <jimbaker> people do some pretty amazing things, given the restrictions i outlined. because python is awesome, and the java ecosystem (including other languages) is so vast
[4:21] <jimbaker> but no android. not yet at least :)
[4:33] <InfinityBear> LLVM backend anyone? :P
[4:47] <stewori> Last time I looked at the list of LLVM backends, Java was not really available. Some abandoned project, but nothing current.
[4:49] * stewori (~stefan@5.146.129.173) has left #jython
[4:50] <InfinityBear> I mean Python
[5:19] * InfinityBear (~InfinityB@69.159.21.121) Quit (K-Lined)
[8:00] * threeminutemonta (~dave@eth778.vic.adsl.internode.on.net) Quit (Ping timeout: 248 seconds)
[9:14] * jimbaker (~jbaker@python/psf/jimbaker) Quit (Ping timeout: 260 seconds)
[9:14] * jimbaker (~jbaker@c-24-8-162-79.hsd1.co.comcast.net) has joined #jython
[9:14] * jimbaker (~jbaker@c-24-8-162-79.hsd1.co.comcast.net) Quit (Changing host)
[9:14] * jimbaker (~jbaker@python/psf/jimbaker) has joined #jython
[9:14] * ChanServ sets mode +o jimbaker
[10:17] * threeminutemonta (~dave@ppp118-209-115-68.lns20.mel4.internode.on.net) has joined #jython
[12:48] * threeminutemonta (~dave@ppp118-209-115-68.lns20.mel4.internode.on.net) Quit (Ping timeout: 244 seconds)
[14:28] * xemdetia (xemdetia@nat/ibm/x-lcetjsaqwmbcezbe) has joined #jython
[15:39] * AndyBotwin (~Gustavo@unaffiliated/andybotwin) has joined #jython
[16:05] * Misdicorl (434f0e42@gateway/web/freenode/ip.67.79.14.66) has joined #jython
[16:06] <Misdicorl> I'm having trouble importing a static inner class in a jython module. Is there some special syntax needed to do this?
[16:06] <Misdicorl> I've tried
[16:07] <Misdicorl> import com.test.TestClass.InnerClass, from com.test.TestClass import InnerClass, import com.test.InnerClass, import com.test.TestClass as test (newline) inner = test.InnerClass
[17:34] * Misdicorl (434f0e42@gateway/web/freenode/ip.67.79.14.66) Quit (Ping timeout: 250 seconds)
[18:44] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 244 seconds)
[19:20] <xemdetia> did you try (out of curiousity) import the test class and just run dir() on a copy of it and see if it is in there
[19:21] <xemdetia> you might be in a situation that you really can only import TestClass and use a version of it to refer to the static class
[19:21] <xemdetia> that would be what is indicated in your last test
[19:21] <xemdetia> but knowing what dir() says could be helpful
[19:22] <dyce_> is it possible to create a lean uberjar? that reads what imports are needed and only packs those classes into the jar
[20:38] <jimbaker> dyce_, yes in principle. all uber jarring is selection of class files; plus renaming
[20:40] <dyce_> jimbaker: https://wiki.python.org/moin/DistributionUtilities something like that. so if my program only has import sys, it will only copy that python file
[20:40] <dyce_> jimbaker: currently my uberjar is around 30MB, im trying to see if i can get it smaller
[20:41] <dyce_> i noticed that in the jar, under Lib, I assume the full python distribution is in there.
[20:44] <dyce_> i am using maven assembly:single
[20:48] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Remote host closed the connection)
[21:19] <jimbaker> dyce_, so it's worth noting that such tooling (as listed in that wiki) all use implementation details about cpython
[21:19] <jimbaker> there's also an underlying tool that scans python package dependencies; also impl dependent
[21:19] <jimbaker> it does not preclude you from going through your code and selecting what you want
[21:19] <dyce_> i see
[21:19] <dyce_> i found this http://stackoverflow.com/questions/30337317/jython-standalone-jar-with-reduced-package-list
[21:20] <jimbaker> as you may know, the jar utility is simply a wrapper around the zip file format
[21:20] <dyce_> but manually delete unneeded classes theoretically should not break anything
[21:20] <dyce_> deleting*
[21:21] <jimbaker> dyce_, correct. if you are not using a feature - although you need to consider dependencies! - it will not break
[21:21] <jimbaker> btw, i'm the author of the quoted email...
[21:21] <jimbaker> no gsoc student unfortunately who worked on it, although it was listed on our ideas list
[21:22] <jimbaker> dyce_, i should point out a tool i have worked on called clamp
[21:22] <jimbaker> specifically for uberjaring
[21:22] <jimbaker> but it does not do any stripping
[21:23] <jimbaker> and it has been sadly not maintained, due to other projects, such as jython itself
[21:23] <jimbaker> taking up my available time
[21:23] <jimbaker> i keep on promising darjus and i will get back to it. but first, the 2.7.1 release :)
[21:24] <dyce_> oh cool ill check that out
[21:28] <dyce_> jimbaker: also, for maven projects, currently i am making a java main that calls a jython file. but i wonder if i can use maven assembly without using any java at all, and point directly to a python file?
[21:29] <dyce_> i messed around with clojure and its it has a :gen-class option. but reading the log i see that jython doesnt have AOT, so perhaps the java main calling the python file is the best way at the moment?
[21:30] <dyce_> (not sure if gen-class is related to AOT or not)
[22:02] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[22:04] * stewori (~stefan@5.146.129.173) has joined #jython
[22:07] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Ping timeout: 264 seconds)
[22:08] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[22:47] * xemdetia (xemdetia@nat/ibm/x-lcetjsaqwmbcezbe) Quit (Ping timeout: 276 seconds)
[22:52] * threeminutemonta (~dave@eth778.vic.adsl.internode.on.net) has joined #jython
[23:22] * eatkin (~eatkin@166.70.212.121) Quit (Ping timeout: 260 seconds)
[23:28] * eatkin (~eatkin@166.70.212.121) has joined #jython
[23:33] * eatkin (~eatkin@166.70.212.121) Quit (Ping timeout: 260 seconds)
[23:33] * eatkin (~eatkin@166.70.212.121) has joined #jython
[23:51] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) has joined #jython
[23:55] * TomA (~TomA@c-68-32-46-223.hsd1.mi.comcast.net) Quit (Ping timeout: 276 seconds)

Index

These logs were automatically created by JythonLogBot_ on irc.freenode.net using a slightly modified version of the Java IRC LogBot (github).