#jython IRC Log (v0.9)

Index

IRC Log for 2013-09-15

Timestamps are in GMT/BST.

[1:09] * bgrz (~bgr@109-93-61-241.dynamic.isp.telekom.rs) Quit (Ping timeout: 264 seconds)
[3:37] * heath (quassel@unaffiliated/ybit) has left #jython
[5:02] <swingline> anyone know how to change the background color of a jtextfield?
[5:25] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[5:27] * thereisnospoon_ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 256 seconds)
[5:48] * cameron__ (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 260 seconds)
[7:20] * thereisnospoon (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[7:41] * lheuer (~Adium@89.204.153.237) has joined #jython
[7:41] * lheuer (~Adium@89.204.153.237) Quit (Changing host)
[7:41] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[8:55] * lheuer (~Adium@unaffiliated/lheuer) Quit (Quit: Leaving.)
[9:05] * robbyoconnor (~wakawaka@guifications/user/r0bby) Quit (Ping timeout: 246 seconds)
[9:06] * robbyoconnor (~wakawaka@guifications/user/r0bby) has joined #jython
[10:12] * bgrz (~bgr@109-93-61-241.dynamic.isp.telekom.rs) has joined #jython
[10:54] * supersven (~sven@port-54072.pppoe.wtnet.de) has joined #jython
[13:03] * JStoker (jstoker@unaffiliated/jstoker) Quit (Ping timeout: 246 seconds)
[13:04] * JStoker (jstoker@unaffiliated/jstoker) has joined #jython
[15:06] <topi`> jimbaker: interesting!
[15:07] <topi`> jimbaker: I've been working on my sailboat. Still problem with the engine. However, I might try to find some spare time slot to take a look at the Twisted patches.
[15:07] <topi`> daenney: twisted has a lot in it, I bet you're thinking of the legacy stuff but it has some awesome properties
[15:09] <daenney> topi`: Could be. My main issue with Twisted is it Java-esque verboseness, with factories and managers and interfaces and stuff. It reminds me a bit of this at times: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
[15:11] <topi`> daenney: indeed twisted is less pythonic
[15:30] <daenney> THe Jython startup script is priceless at times :D
[15:30] <daenney> if [ ! -f "$JYTHON_HOME"/jython.jar -a ! -f "$JYTHON_HOME"/jython-dev.jar ] ; then
[15:30] <daenney> JYTHON_HOME="$JYTHON_HOME_FALLBACK"
[15:30] <daenney> fi
[15:30] <daenney> That'll only ever work if JYTHON_HOME_FALLBACK is ever set, which it isn't :)
[15:49] <daenney> There's some parts of that script that are barely comprehensible
[16:13] <jimbaker> daenney, yikes
[16:15] <jimbaker> topi`, working on the sailboat also sounds great! it will be winter soon enough where you are. although i hope that means good snow
[16:37] <daenney> Yay skiing
[17:02] <topi`> jimbaker: it'll be Christmas before the sea freezes - so there's still plenty of time for sailing ;)
[17:11] <jimbaker> daenney, i ski when i can. rain? enough now, can't wait until it stops here. apparently just another 24h to endure
[17:42] * bgrz (~bgr@109-93-61-241.dynamic.isp.telekom.rs) Quit (Remote host closed the connection)
[17:45] * supersven (~sven@port-54072.pppoe.wtnet.de) Quit (Quit: Ex-Chat)
[17:45] * supersven_ (~sven@port-54072.pppoe.wtnet.de) has joined #jython
[18:21] <topi`> jimbaker: there's some incompatibility between threading in CPython and Jython, can you help me sort it out?
[18:21] <topi`> evidently if you import threading from Jython, it's not the same module as the CPython would get.
[18:22] <topi`> >>> threading.currentThread().ident
[18:22] <topi`> AttributeError: '_MainThread' object has no attribute 'ident'
[18:22] <topi`> whereas you get a large integer on CPython 2.7
[18:24] <topi`> any ideas how to replace .ident property? It's being used in twisted to e.g. register the IO thread, and then later lookup whether the code is currently in IOthread or not.
[18:26] <topi`> thread._thread has interesting properties. like hashCode()
[18:27] <topi`> I think I'll try to use that, at first. Let's see if the Twisted guys accept my patchset...
[18:33] <topi`> now I'll try out the twistd daemon, to load up some application file (.tac)
[18:39] <topi`> jimbaker: there we are. 3 (short) commits to the main trunk of Twisted.
[18:46] <jimbaker> topi`, i just verified this works against jython trunk; import threading; threading.currentThread().ident
[18:48] <jimbaker> in this case jython returns typically a small number - it's retrieving the underlying java thread id
[18:48] <topi`> jimbaker: oh? Then my commit is not needed. Or one of them :)
[18:48] <topi`> https://github.com/tkanerva/twisted
[18:48] <jimbaker> topi`, less code is better
[18:48] <jimbaker> ;)
[18:49] <topi`> https://github.com/tkanerva/twisted/commit/220c1db6ccd08029d34e7ccf812ada7068d20a16
[18:49] <topi`> this one is about that ident
[18:49] <topi`> I chose to use try: except: there so that it has least perf impact on CPython
[18:49] <jimbaker> topi`, i do know that there was some delay in hg.python.org syncing against bitbucket
[18:50] <topi`> jimbaker: maybe I ought to get myself the bleeding edge source tree for jython and build it myself? (sounds painful, it means javac and stuff..)
[18:50] <jimbaker> i fixed this in early july and it didn't seem to appear until later
[18:50] <jimbaker> topi`, i'm afraid that's the case when you work with me :)
[18:51] <jimbaker> live on the bleeding edge
[18:51] <topi`> :)
[18:52] <topi`> jimbaker: so basically that .ident property was just plain missing from the module implementation?
[18:52] <jimbaker> btw, i made it feasible in jython in https://bitbucket.org/jimbaker/jython-big-collection-literals to now do stuff like this - eval("[" + ",\n".join((str(x) for x in xrange(64000))) +"]")
[18:52] <jimbaker> topi`, right, just a small piece like that
[18:53] <jimbaker> often we have trivial fixes to do like that
[18:53] <jimbaker> then there's the distraction that currently the _threads map currently doesn't have proper python semantics
[18:54] <topi`> did you try importing Requests with that big collection fix?
[18:54] <jimbaker> it maps not quite to a python type
[18:54] <jimbaker> topi`, still a few more pieces to that, around ssl
[18:55] <jimbaker> unfortunately the fix as is really doesn't suffice
[18:55] <topi`> it's important to proceed step by step
[18:55] <jimbaker> i want to also support eval("[" + ",\n".join((str(x) for x in xrange(128000))) +"]")
[18:55] <jimbaker> etc
[18:56] <jimbaker> which is also legal python
[18:56] <jimbaker> but then exceeds a new limit in java, this time the size of the constant pool itself is limited to a limit close to 2^16 items
[18:57] <jimbaker> that's perhaps secondary
[18:57] <jimbaker> the real reason is that it currently breaks a few tests. strangely. which is annoying because i really how this branch cleans up the code
[18:58] <jimbaker> i'm not certain why we never did this clean up of the resulting bytecode. low hanging fruit and all. a general principle when writing any sort of java is to write code that a slightly dull java programmer would write
[18:58] <jimbaker> "good idiomatic java code"
[18:58] <topi`> I get two different exceptions, Method code too large and Class file too large
[18:59] <topi`> based on the n inside that xrange()
[18:59] <jimbaker> so topi`, with the new branch it should go at least to just more than 64000
[18:59] <topi`> at 8000, Method code too large, and 16k and above return that Class variant
[18:59] <jimbaker> right
[19:00] <jimbaker> anyway, i have yet another fix in mind
[19:00] <jimbaker> this time to use the marshal module
[19:00] <topi`> oh, there are plenty of fixes to do
[19:00] <topi`> a new day, a new fix!
[19:00] <jimbaker> yeah, but i especially like fixes that hit the compiler
[19:00] <jimbaker> :)
[19:00] <jimbaker> i find them very satisfying for some reason
[19:00] <topi`> you mean the py->.class compiler?
[19:01] <jimbaker> yes
[19:01] <jimbaker> i really hadn't touched it for a while
[19:01] <jimbaker> so this was a good excuse
[19:01] <topi`> what's the division of tasks between the py->.class compiler and the PythonInterpreter?
[19:01] <topi`> I know a lot of things are interpreted inside jython
[19:01] <jimbaker> and good prep for helping shashank get a better compiler in
[19:01] <jimbaker> actually, not really
[19:01] <jimbaker> so first thing to know: PythonInterpreter is not an interpreter
[19:02] <jimbaker> worse name ever
[19:02] <topi`> just a misnomer ;)
[19:02] <jimbaker> it's actually just the runtime
[19:02] <topi`> so, a runtime in the fashion of Objective-C runtime that provides dynamic lookups?
[19:02] <jimbaker> so this is the entity that tracks loaded modules, classes, etc
[19:02] <jimbaker> yes, in that sense
[19:02] <topi`> in an otherwise static compiled language
[19:02] <jimbaker> yes
[19:02] <topi`> good, then we're on the same page :)
[19:03] <jimbaker> there's much more of a dynamic flavor in python of course
[19:03] <topi`> (at least I know ObjC internals quite well ;)
[19:03] <jimbaker> because one is always looking stuff up
[19:03] <topi`> yes, everything is a lookup. sys.args even has to do two lookups
[19:03] <jimbaker> so if i say, x.y.z, i'm going to compile a whole bunch of java bytecode that then calls back into the runtime with a getattr on each .
[19:03] <topi`> it's fairly easy to understand when disassembling simple funcs under CPython
[19:04] <jimbaker> topi`, so the other interesting piece is that we actually do have a python bytecode vm
[19:04] <jimbaker> which i wrote some years back
[19:04] <jimbaker> but hasn't really been used
[19:04] <jimbaker> need to dust that off
[19:04] <topi`> what kind of purpose would you find for it
[19:04] <topi`> ?
[19:05] <jimbaker> shashank's work actually will also allow us to frontend a python bytecode compiler
[19:05] <jimbaker> topi`, deoptimization
[19:05] <topi`> btw, any progress in documenting the ProxyMaker? :)
[19:05] <topi`> deoptimization, sounds good. good fodder for the JVM JIT.
[19:05] <jimbaker> topi`, i got this little pycon proposal to crank out
[19:05] <jimbaker> due today
[19:06] <jimbaker> and i'm procrastinating like crazy on that
[19:06] <jimbaker> so don't give me any excuses here ;)
[19:06] <topi`> jimbaker: that's how it goes ;)
[19:06] <topi`> what's the beef in the pycon proposal? or do you keep it as secret?
[19:06] <jimbaker> yeah, so i will crank it out. because i always do that
[19:06] <jimbaker> no secrets
[19:07] <jimbaker> i'm planning to give a tutorial and a talk, both on storm, and how to use jython to support
[19:07] <topi`> good. tutorials are good! :)
[19:07] <jimbaker> so in particular the conf talk will also cover a few details of proxymaker
[19:07] <jimbaker> the tutorial will go more into depth about the supporting java ecosystem
[19:08] <jimbaker> and... and... i'm hoping to use twisted in that tutorial
[19:08] <topi`> I sometimes wander into a random room and if there's a tutorial going on, join it just for the kicks ;) it'll show me a lot of stuff I'd have no idea about.
[19:08] <topi`> twisted is a good showcase :) it's been a really difficult platform to move to Py3000.
[19:09] <jimbaker> a colleague of mine (manish) made an excellent suggestion, that it would make a lot of sense to have the ability to do web hook calls through twisted
[19:09] <topi`> twisted does make a lot of sense in web cases - just because of the abundant ecosystem AND the wonderful addCallback() cb chains.
[19:10] <jimbaker> so our use of storm basically is 1) collect a lot of data from various inputs (atom feeds going against openstack, cassandra); 2) cogitate, come to a decision on rolling basis; 3) call finegrained webhooks to change the env
[19:10] <topi`> like: import treq; treq.get(url).addCallback(treq.contentJson).addCallback(print)
[19:11] <jimbaker> topi`, exactly that sort of usage, minus the print :)
[19:11] <topi`> (I might not remember correctly the methods inside treq)
[19:11] <jimbaker> another of my colleagues, david reid, wrote treq
[19:11] <topi`> jimbaker: callback chains remind me of shell pipelines. you join small tools together to make some magic.
[19:12] <topi`> even Guido himself acknowledged that callback chains are a five-star idea!
[19:12] <topi`> oh, you know dreid!
[19:12] <topi`> heh, I've bugged him so many times because I use his components (treq, klein)
[19:12] <jimbaker> topi`, our rackspace team has lots of twisted people on it
[19:13] <topi`> rackspace sounds like a very hardcore python place
[19:13] <jimbaker> starting with duncan mcgreggor (=oubiwann), my boss, who's been hardcore twisted for a long time
[19:14] <topi`> tell him to get back on irc! I asked him something on #twisted (about his email package) but didn't get a reply
[19:14] <jimbaker> topi`, i will ask him to do so!
[19:14] <topi`> so - I started out my *own* project to replace his work, and there it is: https://github.com/tkanerva/openmail
[19:14] <topi`> running it now under my own server
[19:14] <jimbaker> topi`, well, that's the way of the world isn't it?
[19:14] <jimbaker> and you will be running it with jython
[19:15] <topi`> if it makes sense, then yes
[19:15] <jimbaker> i remember trying to find a project to work with aws (back when i did that sort of thing ;) and i found duncan's work
[19:15] <topi`> currently CPython
[19:15] <jimbaker> it's more of the "small world" quality i thin
[19:15] <jimbaker> think
[19:16] <topi`> jimbaker: so if you are paranoid, and want to have secure email service, please contact me ;)
[19:16] <topi`> I should open some kind of registration page and get many more beta testers
[19:16] <jimbaker> topi`, i have paranoid friends. perhaps it has rubbed off on me
[19:17] <jimbaker> topi`, so sounds good about trying it out
[19:17] <topi`> I don't have anything to hide, but the principle of privacy is very important
[19:17] <jimbaker> one of my good friends locally in boulder is zooko
[19:17] <topi`> a Python user?
[19:17] <jimbaker> having said that, i have not yet run his tahoe lafs
[19:17] <jimbaker> and a twisted one too
[19:18] <topi`> on my current TODO list is implementing a draft version of this draft : http://tools.ietf.org/html/draft-ietf-dane-smtp-01
[19:18] <topi`> so you see, I'm really at the bleeding edge of Email, and twisted is a very friendly codebase to work with.
[19:19] <jimbaker> topi`, that looks awesome
[19:19] <topi`> I extend what I need, and then there's a lot of lowlevel plumbing that can be done as well
[19:20] <topi`> jimbaker: imagine how difficult it would be to implement all that in C - you need to import some good DNS library, then your SMTP code has to access this and that
[19:20] <topi`> python *is* the new glue language of the internet
[19:20] <topi`> like shell scripts and simple C tools were the glue language of the past
[19:21] <jimbaker> hmmm, with bouncy castle and python, let's get this working well on jython too. in particular, i think it would make a lot of sense to look at doing a twisted reactor based on netty
[19:21] <topi`> python even makes old and new code work seamlessly (mostly)
[19:21] <topi`> jimbaker: sounds like the Java way of doing it :) netty must be pretty performant
[19:22] <jimbaker> topi`, it seems to match twisted well. there was this experiment: https://github.com/fiorix/niosted
[19:26] <topi`> this fiorix guy is the one who created a Tornado clone on top of twisted
[19:29] <topi`> he says his cyclone.jar is way faster than Web.py and Django
[19:30] <jimbaker> topi`, yeah, so i think it looks promising. in principle, this should be straightforward. especially with buffer, i would expect decent to better perf
[19:30] <topi`> do you have any buffer-replacement alternatives in mind?
[19:31] <jimbaker> i mean, it's pretty easy to tune hot loops in java
[19:31] <topi`> well, there's MemoryView of course
[19:31] <jimbaker> topi`, well, i was just thinking of writing buffer
[19:31] <jimbaker> since i did write the first version of memoryview
[19:31] <topi`> I think you *could* emulate buffer with MemoryView
[19:31] <topi`> it's just different semantics
[19:31] <jimbaker> it's close iirc
[19:31] <jimbaker> so memoryview can not be used to sub in
[19:32] <topi`> but buffer has gone away in python3, right?
[19:32] <jimbaker> but the underlying impl would help support
[19:32] <jimbaker> yeah, but i care about jython 2.7 right now :)
[19:33] <jimbaker> now one of my colleagues at the univ of colorado (my other hat) plans to teach jython this spring to the intro to cs course
[19:33] <topi`> ok. let's get back to the original question: your mate wants to run twisted on jython
[19:33] <topi`> did you see my github fork?
[19:33] <jimbaker> and we will need to have a very limited jython 3.x running for that
[19:33] <topi`> I can help with 3.x work - I've worked on getting the PY3 support into twisted
[19:34] <topi`> well the original PY3 work was funded by Canonical
[19:37] <jimbaker> topi`, my former TA is working on this project
[19:37] <jimbaker> jython 3.x
[19:37] <jimbaker> i'll get you connected with dana hughes
[19:37] <topi`> I hear the parser is already ready
[19:38] <jimbaker> yes, frank wierzbicki did this a while back when he was at sun, to support netbeans
[19:38] <jimbaker> you may not know this, but our parser for 2.x is the basis of google's python code mgmt system
[19:39] <topi`> :)
[19:39] <jimbaker> so it's fairly decent/compliant :)
[19:39] <topi`> well I bet a parser written in java will be easier to work with than one written in C
[19:40] <jimbaker> exactly, especially since the rest of google's infrastructure for code mgmt is in java anyway
[19:41] <topi`> google must have a fairly big and complex infra
[19:41] <topi`> considering how many different projects they have :)
[19:42] <jimbaker> so they try to have one codebase
[19:42] <topi`> spanning desktop and mobile and cloud
[19:42] <jimbaker> so when a library is changed in one place, they push it to all dependencies
[19:42] <jimbaker> good talk on this at the jvm lang summit
[19:43] <jimbaker> also they opensourced a stub of a profiling tool they use to support their work at the summit, wonder where's that gone
[19:43] <jimbaker> in terms of people adopting. looked good
[19:43] <topi`> I have a module written in twisted (it performs timed monitoring and reports via email/sms and so on) - and I tried to integrate that into a java codebase (spring based)
[19:44] <topi`> that's how I started patching the twisted codebase for jython ;)
[19:44] <topi`> in the end, I could not get the PlyJy factory model to work. Like I told you :)
[19:44] <jimbaker> topi`, right, my darn fault
[19:45] <topi`> well, why, did you have a bug in that implementation?
[19:45] <topi`> I ended up implementing the specs in another fashion ;)
[19:45] <jimbaker> ok, i like plyjy, as i should, but proxymaker is better. so let's end here: 1) i will get my proposal out; 2) i will then write up proxymaker stuff; 3) maybe i will visit plyjy
[19:45] <jimbaker> again
[19:45] <topi`> I have a WAR for a django project that uses postgresql as backend
[19:46] <topi`> jimbaker: maybe there's a slight incompatibility between jy2.5 and jy2.7 - that PlyJy project was written for 2.5 right?
[19:47] <jimbaker> no, just saying it's my darn fault in the sense of being plyjy's creator, along with josh juneau who packaged it up/wrote the docs
[19:47] <topi`> the Jython project *also* needs better docs
[19:47] <jimbaker> so i haven't looked yet, but i don't see how 2.7 would impact
[19:47] <topi`> although the Jython Book is good
[19:47] <jimbaker> we sort of lost energy after writing that book
[19:47] <topi`> I can understand that... it's like an emancipatory moment
[19:47] <jimbaker> it was a big undertaking
[19:47] <topi`> yeah
[19:49] <topi`> ok, so now go on and get your proposal out :) I will create some tickets in Twisted trac to get them to fix the darn jython issues.
[19:49] <jimbaker> topi`, that sounds like a great plan!
[19:49] <topi`> including patches :)
[19:49] <jimbaker> :)
[20:23] <topi`> jimbaker: done submitting a ticket w/ patches for the twisted devs, now let's just wait what happens.
[20:23] <topi`> now, your turn ;)
[20:24] <topi`> time to go to bed now! have fun with the pycon proposal.
[20:33] <jimbaker> topi`, thanks! and the proposals are starting to write themselves
[20:49] * thereisnospoon_ (~thereisno@27-33-1-87.tpgi.com.au) has joined #jython
[20:51] * thereisnospoon (~thereisno@27-33-1-87.tpgi.com.au) Quit (Ping timeout: 264 seconds)
[21:17] * swingline (~swingline@cpe-98-144-23-210.wi.res.rr.com) Quit (Remote host closed the connection)
[21:28] * swingline (~swingline@cpe-98-144-23-210.wi.res.rr.com) has joined #jython
[22:38] * lheuer (~Adium@89.204.139.192) has joined #jython
[22:38] * lheuer (~Adium@89.204.139.192) Quit (Changing host)
[22:38] * lheuer (~Adium@unaffiliated/lheuer) has joined #jython
[23:35] * swingline (~swingline@cpe-98-144-23-210.wi.res.rr.com) Quit (Read error: Connection reset by peer)
[23:37] * swingline (~swingline@cpe-98-144-23-210.wi.res.rr.com) has joined #jython

Index

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