#jython IRC Log


IRC Log for 2017-04-26

Timestamps are in GMT/BST.

[2:09] * jamierocks (~jamierock@mana.bot.jamiemansfield.me) Quit (Ping timeout: 260 seconds)
[2:10] * jamierocks (~jamierock@mana.bot.jamiemansfield.me) has joined #jython
[14:05] * xemdetia (~xemdetia@ has joined #jython
[14:48] <jimbaker> topi`, i need to revisit clamp. i do know i use it for a series of examples, such as hellowsgi
[14:48] <jimbaker> i have been pretty busy doing different things in openstack, but i'm now going to move back to the jvm space, due to a change in role at rackspace
[14:49] <jimbaker> https://github.com/jimbaker/hellowsgi
[14:53] <jimbaker> crazy to see that the last time i worked on clamp/fireside/etc was the end of 2015, so nearly 18 months ago. but teaching, then work in openstack, well that pulled me away
[14:59] * girish946 (~gsjoshi@2405:204:9385:72f7:ff02:e300:8b70:44f1) has joined #jython
[15:31] <topi`> jimbaker: I tested hellowsgi, it seems to work :)
[15:31] <jimbaker> including the ab testing?
[15:31] <topi`> I was able to sort out my probme with "no modules key present" error.. The error msg was just not very informative.
[15:31] <jimbaker> ahh, good
[15:31] <topi`> no ab testing...
[15:32] <jimbaker> worthwhile trying ab, just to verify things
[15:32] <jimbaker> really need to revisit clamp
[15:32] <topi`> I'm also very busy with one particular high level client
[15:32] <topi`> been working overtime for the past 4-8 weeks
[15:33] <jimbaker> i was very busy for quite a while, but recent role change should mean some chance to spend more time on this. we shall see! but not at the same level as i had say 3 years ago and finalizing socket support. that was a bit much!
[15:33] <topi`> I'm trying to make a good demo about Jython to a large JVM shop :) can you recommend any specific code bases where Jython does have good perf?
[15:33] * girish946 (~gsjoshi@2405:204:9385:72f7:ff02:e300:8b70:44f1) Quit (Quit: Leaving)
[15:34] <topi`> many codes are problematic, since each and every member access requires a lot of work from Jython's side
[15:34] <jimbaker> topi`, btw, i don't know if you know this, but datastax got their twisted application (opscenter for cassandra) running on jython. it was pretty cool
[15:34] <jimbaker> disappointed that none of the several jython talks last year were accepted for pycon, including the datastax one
[15:34] <topi`> I also managed to get some twisted codes working on Jython, way back in 2015, do you remember :)
[15:35] <jimbaker> topi`, indeed, that's why i mentioned it!
[15:35] <topi`> twisted would be a cool topic
[15:35] <topi`> because, afaik, there's nothing really on the JVM side that compares to it
[15:35] <topi`> if you need to build a custom protocol, twisted is the way
[15:35] <jimbaker> yes, and it was twisted running on jython. but again, not accepted for pycon
[15:35] <jimbaker> really wanted to see the next step, which was twisted on netty
[15:36] <jimbaker> in any event, jython 3 would logically support asyncio in that fashion
[15:37] <topi`> supposedly twisted on top of netty would offer much better perf :)
[15:37] <topi`> but in many cases, people do a quick and dirty MVP and the perf doesn't usually matter that much
[15:37] <topi`> hence, a twisted app would work just great on JVM, and as a plus you can implement some perf demanding codes in Java
[15:38] <topi`> let's say you'd implement a speech recognition algo in Java, for a twisted app
[15:38] <topi`> what would be the best way to heave data in between the two world?
[15:38] <topi`> let's say 44 kilosamples per second, that's 88 kb of data, not a lot TBH
[15:40] <topi`> jimbaker: do you accept any asyncio patches for jython3? :) I know quite a bit of the asyncio internals, and could possibly donate some time
[15:42] <jimbaker> topi`, well, i think we need to really start investing in jython3. i haven't had time to work on it directly myself, which is a shame, because jython3 is really the language side of things. the runtime up to 3.3 is more or less exactly the same as 2.7, in both cpython and jython
[15:42] <jimbaker> so yes, we would definitely accept patches
[15:42] <jimbaker> but do realize we need to start picking this up
[15:42] <topi`> I think the biggest since thing in 3.4 is the asyncio framework
[15:42] <jimbaker> yep
[15:43] <topi`> so if that can be tackled, the rest of the changes are probably more trivial
[15:43] <jimbaker> yeah, i very much think so
[15:43] <topi`> and the str/bytes handling of PY3 is probably more in line with java anyways
[15:43] <jimbaker> and it should be straightforward to do
[15:43] <jimbaker> also this change is pretty straightforward, because of all the runtime changes
[15:43] <jimbaker> that are common
[15:43] <topi`> I'd need some help with the asyncio internals, though. Specifically the select/epoll part of it
[15:44] <jimbaker> well, this is the one part i really do know :)
[15:44] <topi`> good :)
[15:44] <jimbaker> having implemented all that functionality in the socket reboot work
[15:44] <jimbaker> what i really want to see is a direct mapping to netty from asyncio
[15:44] <topi`> I'm having a presentation on jython in May, can you give me some helping hand :)
[15:45] <jimbaker> i'm certainly here to help review your presentation content!
[15:45] <topi`> can you give any examples of how to use jython effectively as a scripting aid for large java projects?
[15:45] <topi`> do you know example projects where jython was used for scripting?
[15:46] <topi`> or, like, extending things with behavior, etc
[15:46] <topi`> state machines
[15:46] <jimbaker> topi`, one thing that is sort of interesting is this article i co-authored for java magazine: http://www.javamagazine.mozaicreader.com/NovDec2015/Default/50/0#&pageSet=42&page=0
[15:47] <jimbaker> re state machines, you might find this original design doc on the socket reboot work useful - https://github.com/jimbaker/socket-reboot
[15:47] <topi`> ok
[15:47] <jimbaker> as too often, i haven't had a chance to go back and actual revisit
[15:48] <topi`> one thing that occurred to me is... that when we are at Jython 3.5, we can actually make good use of static type hints
[15:48] <topi`> ...by skipping on type checks and making everything run faster :)
[15:49] <topi`> let's see. If we have a simple for loop like for i in ... ; a = a+i
[15:50] <topi`> then for every loop iteration, "a" needs to be accessed, its type needs to be checked, a "+" op needs to be looked up for that object type, and the same for "i" var as well
[15:50] <jimbaker> it is true, we can use static type hints to actually generate better code
[15:50] <jimbaker> i think this is even more the case for 3.7 work
[15:50] <topi`> if type hints are complete, a few versions of the same loop can be built, in JVM code, where we anticipate the possible types
[15:51] <topi`> note that they are type *hints*, so it doesn't necessarily say so
[15:51] <topi`> but mypy could be used to actually verify some things
[15:51] <jimbaker> and yes, type hints can lie
[15:51] <jimbaker> but this is true in java too
[15:51] <topi`> in that sense, it can vbe an optional parameter
[15:51] <jimbaker> due to compilation boundaries
[15:51] <topi`> jython --enable-type-optimizations foo.py
[15:51] <jimbaker> CHECKCAST is the jvm answer
[15:52] <topi`> I'm so fed up with C/C++ that I think it is time Jython would surpass CPython
[15:52] <topi`> as the defacto to-go-implementation :)
[15:52] <jimbaker> so we insert casts of varying degrees of sophistication to verify that the dynamic code exec actually follows the static description
[15:52] <topi`> and JVM is a better virtual machine, in any case, than the CPython machine
[15:53] <jimbaker> well, that's a good dream. it's hard to compete with all the talented people who are making cpython more awesome, even with the jvm advantages
[15:54] <jimbaker> but i'm not going to say a dream never becomes reality :)
[15:54] <jimbaker> at the very least, if one is working on java, having a compatible python implementation is highly useful!
[15:54] <jimbaker> and that supports continued progress
[15:55] <jimbaker> topi`, also work continues on jyni (stewori's project) for c integration
[15:56] <jimbaker> and stewori did some pretty awesome stuff recently to support transparently using cpython as a tool for jython itself
[15:56] <jimbaker> in particular, to compile python bytecode so jython could then run that bytecode
[15:57] <topi`> it'd be great if all those C modules for CPython could work on Jython
[15:57] <topi`> I imagine a lot of ppl got disapointed when they realized "mysqldb" won't work with jython
[15:59] <jimbaker> sure. but pymysql should work just fine (https://github.com/PyMySQL/PyMySQL)
[15:59] <topi`> yes
[15:59] <topi`> but it wasn't very good back in 2012 :)
[15:59] <jimbaker> more importantly, so do all the standard JDBC integrations
[16:00] <topi`> yeah
[16:00] <jimbaker> topi`, i think it's improved, especially since openstack now depends on pymysql
[16:00] <topi`> it took me some effort to find out how to use JDBC classes with jython :)
[16:00] <topi`> pymysql is definitely improved, I think because pypy folks wanted to make it better
[16:00] <jimbaker> i would try using sqlalchemy with jdbc
[16:00] <topi`> anyways, pypy wasn't very popular back in 2012
[16:01] <topi`> sqlalchemy would win some minds from even the most die-hard Java+spring folks :)
[16:01] <jimbaker> no, it only got popular once the performance improved. and still doesn't have the multithreading story. unlike say jython
[16:02] <topi`> we need concurrent.futures out of the box for jython :)
[16:02] <topi`> I tried the ThreadPoolExecutor and it kicked ass
[16:02] <topi`> certainly unlikely in, say, CPython
[16:02] <jimbaker> yep
[16:02] <jimbaker> let's see i gave a talk on that subject at oscon, back in 2012
[16:03] <jimbaker> i can dig up my presentation notes and give those to you
[16:03] <jimbaker> it was a fun talk: cpython vs jython with respect to threading
[16:13] <jimbaker> https://conferences.oreilly.com/oscon/oscon2012/public/schedule/detail/23505
[16:15] <jimbaker> topi`, i have some talks listed here - only a very small subset of the ones i have give (apparently 130+ in the last 5 years or so... hard to believe, although ~100 of those are lectures at the univ of colorado)
[16:15] <jimbaker> https://github.com/jimbaker/talks
[16:15] <jimbaker> feel free to use as desired
[22:13] * Delpen9 (~Ian@dns25-176.cbu.edu) has joined #jython
[22:37] * Delpen9 (~Ian@dns25-176.cbu.edu) Quit (Ping timeout: 260 seconds)
[22:48] * xemdetia (~xemdetia@ Quit (Ping timeout: 240 seconds)


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