You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Benjamin C. <bc...@cs...> - 2001-03-09 19:22:18
|
hi there so I've got these packages, and I want to import classes from them. how do i manage this? an example. the java source file Agent has this at the top: package org.tagents.examples; import org.tagents.agents.*; from jython, i tried "import org.tagents.agents.*," "import TAgents" (the jar file name), "import TAgents.jar", and so on, but nothing works. so how do I import this stuff? thanks ben |
From: <bc...@wo...> - 2001-03-09 18:52:06
|
[D-Man] >Perhaps it would better for Jython to match CPython and C with respect >to the open() function, Keep in mind that CPython have two string types (8bit and 16bit), Jython have only one (16bit). Matching CPython's current ability to write unicode string to file objects would completely cripple all file I/O in Jython <0.0 wink> Python 2.1b1 (#11, Mar 2 2001, 11:23:29) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> f = open("x", "w") >>> f.write(u"\u20ac") Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeError: ASCII encoding error: ordinal not in range(128) When you think about it, what should the above write into the file? The CPython developers though (and fought) about this *a lot*, and their best answer is: You can't! Not all of the 30+ developers on CPython agree on that decision. In Jython we can write such a euro-sign to a file. What it write to the file depends on the binary flag and the encoding for your platform. When writing in binary the byte 0xAC is always written. In text mode and on my danish windows it write 0x80, which is Microsoft's position of the eurosign in the danish codepage. All in all this have worked remarkably well both during the errata's and with Jython-2.0. It is not perfect because it overload the meaning of the 'b' flag. So it is f.ex. not possible to get newline translation without the encoding. Guido has on several time said that the unicode support for file objects is not yet complete. When CPython is improved we will improve Jython as well. >but require people to construct the other >Reader/Writer objects using the Java classes? You can do that too. It just isn't a requirement. >I am curious as to why the "format string" style of argument was >chosen instead of an enum style (for CPython, Maybe Guido chose a string based mode argument because the C stdio uses it. I dunno. >Jython Because CPython uses it. >and C). I think >that it would be simpler for the libary implementer and easier on the >client to use an enum type, or even different classes similar to Java >(but easier to get one that does what you want ;-)). regards, finn |
From: Richard G. <rg...@in...> - 2001-03-09 16:16:54
|
Sorry, it was simply because I was launching my script from an editor that reads the environnement on startup, and I had changed the CLASSPATH meanwhile ! Richard Gruet wrote: > Hi all, > > This is a Jython beginner's question. > > I'm using Jython 2.0 on Windows NT 4.0, mainly for testing a Java > framework of our own. > This framework is in a package com.intraware.b2b.ifwk, which is in the > CLASSPATH envt variable. > In interactive mode: > >>>import com.intraware.b2b.ifwk.client > will work, whereas if the same statement is in a script > "M:\ifwk\scripts\testClient.py", launched by: > jpython.bat M:\ifwk\scripts\testClient.py > > The script will launch but give an error: > Traceback (innermost last): > File "M:\ifwk\scripts\testClient.py", line 12, in ? > ImportError: No module named intraware > > So it looks like the CLASSPATH is different in the 2 cases. But I don't > know why. > Any suggestion would be greatly appreciated. > > Richard |
From: D-Man <ds...@ri...> - 2001-03-09 16:10:14
|
On Fri, Mar 09, 2001 at 08:17:02AM +0000, Finn Bock wrote: | | Incorrect. It is Jython that does this mangling. The issue basicly is: | should a read from a file into a unicode String read the data as binary | (and always set the top 8 bit to zero) or as text by passing the data | through the default encoding. | | Without the 'b' flag, Jython is reading and writing the data as if using | a Reader/Writer class. When you use the 'b' flag it uses a | InputStream/OutputStream. | | This overloading of the 'b' flag (the flag also controls the platform | dependent newline translation) is not a good thing, but it was the best | I could come up with. Normally is works as expected and I think that | also goes for John's case. Perhaps it would better for Jython to match CPython and C with respect to the open() function, but require people to construct the other Reader/Writer objects using the Java classes? I am curious as to why the "format string" style of argument was chosen instead of an enum style (for CPython, Jython and C). I think that it would be simpler for the libary implementer and easier on the client to use an enum type, or even different classes similar to Java (but easier to get one that does what you want ;-)). Thanks, -D |
From: Samuele P. <pe...@in...> - 2001-03-09 16:04:24
|
Hi. A) Some general considerations [John Mudd] > Maybe there's a market for this sort of scenario. Use a subset of > Jython in exchange for the ability to switch to Java after the > prototype solidifies. Maybe both languages would benfit from > collaboration. As philosophy (unrelated to java) that's the niche (at least in term of promises) of Common Lisp System vendors, which still give a lot of dynamism in the delivered version, and the pontential niche of dylan (that didn't catch up), where you lose most of the dynamism for performance in the delivered version of a program, but you have full dynamism during development. Having both dynamic language features (very good for RAD) and performance is not that simple: the runtime/compiler should understand when you are not using them ;) some possible approach are 1) optional static typing over a basically dynamic typed language and/or giving up (implicitly/explicitly) with some dynamic aspects of semantic in deployed versions. 2) dynamic (at runtime) compilation and optimisation techniques 3) closed world assumption (take a whole program and compile it => you lose dynamic linking or dynamic linked stuff is much slower than the rest) this simplifies type inference and allows vtbls like techniques etc 4) type inference (much a reasearch field in absence of any explicit type information or implicit rules (like in ML)), mostly an open problem if one want dynamic loading: type inference for an object oriented program need whole call graph construction that needs type inference results, a difficult fix-point problem , algorithms exist but are "slow" and there are problems dealing with reflective/introspective features of a language. * java takes 1) to the extreme (it has static typing) and its runtimes use 2), you have dynamic linking * dylan uses 1) and 3), AFAIK no dynamic linking in deployed versions of a program * Self (a sun/stanford univerty project) takes 2 to the extreme, and some of the results of the project are used in java runtimes, such runtimes (java and even more Self) are very complex and complicated piece of software, AFAIK there is no open source project trying to do that kind of stuff, these techniques are not simply JIT. Python and jython at the moment do not exploit any of these things, 1) and using a bit of 4) as an idea has been around for a long time, let see if and what will happen with P3K. What JimH was trying (as far as I have understood) was very experimental and implied a lot of assumptions that are not true in general for python semantic, he was using 3) and mostly trying to detect numeric types. Maybe a bit of 2) can be put in jython to improve its performance, but using dynamic techniques over a static typed, typesafe and dynamic compiling/optimizing runtime (the actual JVMs) is likely to be difficult or impossible, memory consuming, and not worth the effort, and the increased code base complexity. Jython is ideal if you don't want performance or can solve your problems with adding a reasonable amount of pure java. **************************** [D-Man] > Besides, unless the VM's do some > real intelligent runtime optimizations it can't be as fast as C. It > is implemented in C. Every Java instruction takes several C > instructions to execute. The actual jvms try to do some intelligent runtime opt, on the other hand what java gives you and what C gives is very different, java has an effective oo dynamic linking, and when a program crash you always get a nice stack trace etc Java gives some performance, effective dynamic linking and gc, a growing and rich set of libs. But it's verbose and e.g. swing is slow. For some kind of application the cons are very important, like complicated server frameworks that dynamicly load modules at runtime... but in other cases one is better served elsewhere. regards, Samuele Pedroni. |
From: D-Man <ds...@ri...> - 2001-03-09 15:28:40
|
On Fri, Mar 09, 2001 at 06:40:38AM -0800, John Mudd wrote: | I tried CPython first and I was thrilled to get 2-3 times better | performance. But it doesn't support multi-threading. (Unless I | completely misunderstand which is possible.) My impression is that | CPython threads serially take turns using the interpreter. CPython does support multi-threading. I don't know to what extent it does time slicing, but you can use threads with it. (I haven't written a threaded python app yet) Java doesn't specify how the VM time slices. At school with a particular Sun jdk (I don't remember the version) on Solaris 8 the VM did no time slicing. The only way for a different thread to become the current one is for the current thread to share nicely (ie Thread.wait() or Thread.sleep()). | That was a dead end for me. That plus the need to use Jython (Java) | classlibs to access our CORBA orb. Plus the push in our group for | Java. You need to use a particular Java library. Ok that's a good reason to use Java instead of a different language. Does that orb have bindings for other languages? If it has C or C++ bindings it might not be too difficult to create a Python wrapper using SWIG. Just a thought. Since you wrote this in Python to start with I'll assume you like python and are convinced of its merits. It would probably be advantageous for you to determine why your group is pushing for Java. If it is because of simpler coding, portability, etc, then maybe you could present Python as an alternative. If you can manage to get Python bindings for your CORBA orb that would help as well. (BTW, ORBit has Python bindings, it's the free open source orb that GNOME uses) | Convert to C or C++. My impression is that I can only expect about 50% | better performance than using Java. Plus my code now has reached the In my experiences Java has been quite slow for involved applications. For example, JBuilder InstallAnywhere and NetBeans. All use Java + Swing. At times the GUI is quite unresponsive. On a Win2k box, PIII ~400 MHz, 128MB RAM it takes a while for JBuilder to redraw the screen if it has been minimized for a while. On the other hand, if Java's higher level of coding allows the developer's to create the app faster and more correctly IMO the performance hit is not a big deal. (Otherwise I would use machine code and not python ;-)) Someone else replied to me similarly saying the C/C++ doesn't give a large performance improvement, but "java implementations will continue to get better". Sun has been touting this excuse for poor implementations for years. Of course it is getting better (we hope ;-)), but so is everything else. Besides, unless the VM's do some real intelligent runtime optimizations it can't be as fast as C. It is implemented in C. Every Java instruction takes several C instructions to execute. IMO Java was released WAY before it was mature enough, and then got marketed like a silver bullet. | limits of the hardware and so, in that respect, there is no room for | further improvement. Although I agree that it would still be better to | put less stress on the machine that I have to share with many other | processes. A more efficient program would help in that respect but... Hmm, if you're at the hardware's limits I don't think there is much you can do except try and reduce the resource requirements of the program. | Recode in C?? The app is tooo complicated. By design, 'C' doesn't | afford implementing such deep abstraction. I don't know about that. Sure, it might (will) not be as easy as Python, but the GTK+ developers use C to create a highly OO and polymorphic toolkit. | C++ was an early attempt to solve this fundamental problem with OOP but | I consider it the 286 (the predecessor to Intel's 386 processor) of OOP | languages. A necessary step but I'm proud to have never coded in it | the same way I'm proud to have never owned a 286 PC. I think this is a fairly accurate statement. From my understanding C++ was originally created with 2 main design goals : speed (in OO) and compatibility with the large amount of existing C code. OO languages like Smalltalk and Modula were around, but didn't have the performance of C. I don't know very much about the 286's architecture other than it is very different from the 386. One of the reasons Linux needs at least a 386 to run. I do know a bit about the x86 architecture (pre-Pentium at least) and how it compares to the M68K architecture. If you want to read a good article comparing several languages and their performance vs. code size, check IEEE Computer magazine from a few months ago. It compared C, C++, Java, Python, Perl, Tcl, and Rexx. The conclusion is basically this: well-written C and C++ is faster than anything else. It also takes less memory. HOWEVER it is still possible (even easy IMO) to write poor quality C/C++ that has terrible performance, memory leaks, etc. The speed difference between traditional compiled languages and newer interpreted langauges is not an issue except when it is (for example your case where experimentation shows a performance boost is necessary). The article did _not_ compare the design of the language and the readability of the code. It did give measurements of LOC for each language and LOC/hour of the developers. Those numbers are, of course, approximate and can vary greatly depending on developer skill and motivation. The other replier said: """Sure you could use CPython but who wants to write c extensions when you can whip them out in java!!""" I don't find Java to be particularly cool, but I do find Jython's seamless integration of Python and Java to be very cool. I've never written a C extension to Python so I don't know how painful it may be, but writting Java extensions to Jython seems to be extremely easy. The key to remember is that performance is the least significant factor when choosing a language. Language design and its ease of use are far more important. In John's case, however, he has determined that his current implementation doesn't meet the performance criteria that he has and must rework it. That's fine since he took the proper perspective on saving performance considerations for last. -D |
From: Tim H. <tim...@ie...> - 2001-03-09 15:17:03
|
----- Original Message ----- From: "John Mudd" <joh...@ya...> > I tried CPython first and I was thrilled to get 2-3 times better > performance. But it doesn't support multi-threading. (Unless I > completely misunderstand which is possible.) My impression is that > CPython threads serially take turns using the interpreter. That's more or less right. Note that calls out to C-extenstions generally release the interpreter lock, so some multithreading is supported. How much depends on how much you spend in the interpreter versus how much time is spent calling out to extensions. At various times there have been free threading patches for the C-interpreter (by Greg Stein I believe). I don't know what the status of that patch is right now. > That was a > dead end for me. That plus the need to use Jython (Java) classlibs to > access our CORBA orb. Plus the push in our group for Java. That's a big plus for Jython. The way Jython "just works" with java libraries has always amazed me. > Convert to C or C++. My impression is that I can only expect about 50% > better performance than using Java. Plus my code now has reached the > limits of the hardware and so, in that respect, there is no room for > further improvement. Although I agree that it would still be better to > put less stress on the machine that I have to share with many other > processes. A more efficient program would help in that respect but... This might be true unless you're using Swing, which in my experience is dog slow.... [SNIP] -tim |
From: John M. <joh...@ya...> - 2001-03-09 15:01:34
|
Actually, they (I won't mention the company name) ran into a bug and will try to compile the app after they get their stuff working. I'm not thrilled about using a Jar-to-'C' compiler. One of the reason to switch to Java is to avoid past nightmarish problems with building platform specific deliverables and actually getting them properly delivered. A Jar compiler may solve a problem but, like a lot of solutions, it creates a problem in the process. And then there's the fact that their stuff did not run on the first try... --- Bill Scherer <Bil...@Ve...> wrote: > If you have the budget for it, TowerJ can substanially improve your > performance. I can provide some more details if you wish. > > John Mudd wrote: > > > > I tried CPython first and I was thrilled to get 2-3 times better > > performance. But it doesn't support multi-threading. (Unless I > > completely misunderstand which is possible.) My impression is that > > CPython threads serially take turns using the interpreter. That > was a > > dead end for me. That plus the need to use Jython (Java) classlibs > to > > access our CORBA orb. Plus the push in our group for Java. > > > > Convert to C or C++. My impression is that I can only expect about > 50% > > better performance than using Java. Plus my code now has reached > the > > limits of the hardware and so, in that respect, there is no room > for > > further improvement. Although I agree that it would still be > better to > > put less stress on the machine that I have to share with many other > > processes. A more efficient program would help in that respect > but... > > > > Recode in C?? The app is tooo complicated. By design, 'C' doesn't > > afford implementing such deep abstraction. > > > > C++ was an early attempt to solve this fundamental problem with OOP > but > > I consider it the 286 (the predecessor to Intel's 386 processor) of > OOP > > languages. A necessary step but I'm proud to have never coded in > it > > the same way I'm proud to have never owned a 286 PC. > > > > IMHO, of course. A lot of this stuff is over my head and so it's > easy > > for me to draw incorrect conclusions. > > > > --- D-Man <ds...@ri...> wrote: > > > On Thu, Mar 08, 2001 at 09:59:58AM -0800, John Mudd wrote: > > > | Any thoughts about developing a tool to convert Jython to Java? > > > Unlike > > > | jythonc (which is a great tool!), something to ease the job of > > > porting > > > | to Java in order to get better performance. > > > > > > You are converting to Java for performance? I haven't heard that > one > > > before. Why not try CPython first? I have heard that CPython is > > > ~2-3 > > > times faster than Jython. > > > > > > Also, why not convert the Python code to C++ or C if you really > want > > > performance? Well-written C or C++ is lots faster than equally > > > well-written Java. (This isn't to say that you can't make poorly > > > written C that is slower than well written Java) > > > > > > -D > > > > > > > > > _______________________________________________ > > > Jython-users mailing list > > > Jyt...@li... > > > http://lists.sourceforge.net/lists/listinfo/jython-users > > > > __________________________________________________ > > Do You Yahoo!? > > Get email at your own domain with Yahoo! Mail. > > http://personal.mail.yahoo.com/ > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > http://lists.sourceforge.net/lists/listinfo/jython-users > > -- > William K. Scherer > Sr. Member of Applications Staff - Verizon Wireless > Bill.Scherer_at_VerizonWireless.com __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: John M. <joh...@ya...> - 2001-03-09 14:54:08
|
Yes, binary mode of course. I think I have a mental block in this area. This is twice that I've asked about this sort of thing. Thanks for your patience. $ jython Jython 2.0 on javaVM-1.3.0.01 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> tiffObj = open('john.tif', 'rb').read() >>> open('junk.tif', 'wb').write(tiffObj) >>> $ sum -r junk.tif john.tif 16525 25 junk.tif 16525 25 john.tif $ --- Finn Bock <bc...@wo...> wrote: > [D-Man] > > >On Thu, Mar 08, 2001 at 05:09:42PM -0800, John Mudd wrote: > >| This should be easy. Reading a binary file in Jython causes > changes to > >| the data? But it works in Python. > > > >You forgot to mention that you are using a kernel/OS that likes to > >mangle your data. ;-) > > I strongly suspect that John is using a *nix for the Jython test. > > >Use _binary_ mode for writing _binary_ data. > > Correct. > > >| $ jython > >| Jython 2.0 on javaVM-1.3.0.01 (JIT: null) > >| Type "copyright", "credits" or "license" for more information. > >| >>> tiffObj = open('john.tif', 'r').read() > >| >>> open('junk.tif', 'w').write(tiffObj) > > ^ > >This is "text" mode and Windoze likes to replace every \n with \r\n > in > >such streams. This is what causes your data corruption. > Fortunately > >on *nix systems the kernel doesn't mangle your streams under the > hood. > > Incorrect. It is Jython that does this mangling. The issue basicly > is: > should a read from a file into a unicode String read the data as > binary > (and always set the top 8 bit to zero) or as text by passing the data > through the default encoding. > > Without the 'b' flag, Jython is reading and writing the data as if > using > a Reader/Writer class. When you use the 'b' flag it uses a > InputStream/OutputStream. > > This overloading of the 'b' flag (the flag also controls the platform > dependent newline translation) is not a good thing, but it was the > best > I could come up with. Normally is works as expected and I think that > also goes for John's case. > > regards, > finn > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: Bill S. <Bil...@Ve...> - 2001-03-09 14:50:03
|
If you have the budget for it, TowerJ can substanially improve your performance. I can provide some more details if you wish. John Mudd wrote: > > I tried CPython first and I was thrilled to get 2-3 times better > performance. But it doesn't support multi-threading. (Unless I > completely misunderstand which is possible.) My impression is that > CPython threads serially take turns using the interpreter. That was a > dead end for me. That plus the need to use Jython (Java) classlibs to > access our CORBA orb. Plus the push in our group for Java. > > Convert to C or C++. My impression is that I can only expect about 50% > better performance than using Java. Plus my code now has reached the > limits of the hardware and so, in that respect, there is no room for > further improvement. Although I agree that it would still be better to > put less stress on the machine that I have to share with many other > processes. A more efficient program would help in that respect but... > > Recode in C?? The app is tooo complicated. By design, 'C' doesn't > afford implementing such deep abstraction. > > C++ was an early attempt to solve this fundamental problem with OOP but > I consider it the 286 (the predecessor to Intel's 386 processor) of OOP > languages. A necessary step but I'm proud to have never coded in it > the same way I'm proud to have never owned a 286 PC. > > IMHO, of course. A lot of this stuff is over my head and so it's easy > for me to draw incorrect conclusions. > > --- D-Man <ds...@ri...> wrote: > > On Thu, Mar 08, 2001 at 09:59:58AM -0800, John Mudd wrote: > > | Any thoughts about developing a tool to convert Jython to Java? > > Unlike > > | jythonc (which is a great tool!), something to ease the job of > > porting > > | to Java in order to get better performance. > > > > You are converting to Java for performance? I haven't heard that one > > before. Why not try CPython first? I have heard that CPython is > > ~2-3 > > times faster than Jython. > > > > Also, why not convert the Python code to C++ or C if you really want > > performance? Well-written C or C++ is lots faster than equally > > well-written Java. (This isn't to say that you can't make poorly > > written C that is slower than well written Java) > > > > -D > > > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > http://lists.sourceforge.net/lists/listinfo/jython-users > > __________________________________________________ > Do You Yahoo!? > Get email at your own domain with Yahoo! Mail. > http://personal.mail.yahoo.com/ > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users -- William K. Scherer Sr. Member of Applications Staff - Verizon Wireless Bill.Scherer_at_VerizonWireless.com |
From: John M. <joh...@ya...> - 2001-03-09 14:38:51
|
I tried CPython first and I was thrilled to get 2-3 times better performance. But it doesn't support multi-threading. (Unless I completely misunderstand which is possible.) My impression is that CPython threads serially take turns using the interpreter. That was a dead end for me. That plus the need to use Jython (Java) classlibs to access our CORBA orb. Plus the push in our group for Java. Convert to C or C++. My impression is that I can only expect about 50% better performance than using Java. Plus my code now has reached the limits of the hardware and so, in that respect, there is no room for further improvement. Although I agree that it would still be better to put less stress on the machine that I have to share with many other processes. A more efficient program would help in that respect but... Recode in C?? The app is tooo complicated. By design, 'C' doesn't afford implementing such deep abstraction. C++ was an early attempt to solve this fundamental problem with OOP but I consider it the 286 (the predecessor to Intel's 386 processor) of OOP languages. A necessary step but I'm proud to have never coded in it the same way I'm proud to have never owned a 286 PC. IMHO, of course. A lot of this stuff is over my head and so it's easy for me to draw incorrect conclusions. --- D-Man <ds...@ri...> wrote: > On Thu, Mar 08, 2001 at 09:59:58AM -0800, John Mudd wrote: > | Any thoughts about developing a tool to convert Jython to Java? > Unlike > | jythonc (which is a great tool!), something to ease the job of > porting > | to Java in order to get better performance. > > You are converting to Java for performance? I haven't heard that one > before. Why not try CPython first? I have heard that CPython is > ~2-3 > times faster than Jython. > > Also, why not convert the Python code to C++ or C if you really want > performance? Well-written C or C++ is lots faster than equally > well-written Java. (This isn't to say that you can't make poorly > written C that is slower than well written Java) > > -D > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: <bc...@wo...> - 2001-03-09 08:17:19
|
[D-Man] >On Thu, Mar 08, 2001 at 05:09:42PM -0800, John Mudd wrote: >| This should be easy. Reading a binary file in Jython causes changes to >| the data? But it works in Python. > >You forgot to mention that you are using a kernel/OS that likes to >mangle your data. ;-) I strongly suspect that John is using a *nix for the Jython test. >Use _binary_ mode for writing _binary_ data. Correct. >| $ jython >| Jython 2.0 on javaVM-1.3.0.01 (JIT: null) >| Type "copyright", "credits" or "license" for more information. >| >>> tiffObj = open('john.tif', 'r').read() >| >>> open('junk.tif', 'w').write(tiffObj) > ^ >This is "text" mode and Windoze likes to replace every \n with \r\n in >such streams. This is what causes your data corruption. Fortunately >on *nix systems the kernel doesn't mangle your streams under the hood. Incorrect. It is Jython that does this mangling. The issue basicly is: should a read from a file into a unicode String read the data as binary (and always set the top 8 bit to zero) or as text by passing the data through the default encoding. Without the 'b' flag, Jython is reading and writing the data as if using a Reader/Writer class. When you use the 'b' flag it uses a InputStream/OutputStream. This overloading of the 'b' flag (the flag also controls the platform dependent newline translation) is not a good thing, but it was the best I could come up with. Normally is works as expected and I think that also goes for John's case. regards, finn |
From: D-Man <ds...@ri...> - 2001-03-09 02:47:36
|
On Thu, Mar 08, 2001 at 09:59:58AM -0800, John Mudd wrote: | Any thoughts about developing a tool to convert Jython to Java? Unlike | jythonc (which is a great tool!), something to ease the job of porting | to Java in order to get better performance. You are converting to Java for performance? I haven't heard that one before. Why not try CPython first? I have heard that CPython is ~2-3 times faster than Jython. Also, why not convert the Python code to C++ or C if you really want performance? Well-written C or C++ is lots faster than equally well-written Java. (This isn't to say that you can't make poorly written C that is slower than well written Java) -D |
From: D-Man <ds...@ri...> - 2001-03-09 02:44:21
|
On Thu, Mar 08, 2001 at 05:09:42PM -0800, John Mudd wrote: | This should be easy. Reading a binary file in Jython causes changes to | the data? But it works in Python. You forgot to mention that you are using a kernel/OS that likes to mangle your data. ;-) Use _binary_ mode for writing _binary_ data. | | | $ jython | Jython 2.0 on javaVM-1.3.0.01 (JIT: null) | Type "copyright", "credits" or "license" for more information. | >>> tiffObj = open('john.tif', 'r').read() | >>> open('junk.tif', 'w').write(tiffObj) ^ This is "text" mode and Windoze likes to replace every \n with \r\n in such streams. This is what causes your data corruption. Fortunately on *nix systems the kernel doesn't mangle your streams under the hood. For other systems use open( 'junk.tiff' , 'wb' ).write( tiffObj ) ^ | >>> | $ sum -r junk.tif john.tif | 04308 25 junk.tif | 16525 25 john.tif | $ cmp junk.tif john.tif | junk.tif john.tif differ: char 170, line 1 | $ python | Python 2.0 (#3, Feb 1 2001, 04:39:53) | [GCC 2.7.2.3] on hp-uxB | Type "copyright", "credits" or "license" for more information. | >>> tiffObj = open('john.tif', 'r').read() | >>> open('junk.tif', 'w').write(tiffObj) | >>> | $ cmp junk.tif john.tif | $ | Your jython invocation gives no indication of your platform (I use the same utilities and prompt on a Win2k box via cygwin), but your CPython invocation indicates you are using HP-UX. This explains why the code works in CPython. HP-UX follows the Unix precedent of not mangling streams simply because you opened it in "text" mode. IMHO there should only be one mode for opening files -- the app, not the kernel, should do ALL stream handling, ASCII and binary. In any case, the proper documented way of writing binary data (such as your TIFF image) is to use "wb" as the file mode (in Python, C, C++, Java, etc). HTH, -D |
From: John M. <joh...@ya...> - 2001-03-09 01:07:57
|
This should be easy. Reading a binary file in Jython causes changes to the data? But it works in Python. $ jython Jython 2.0 on javaVM-1.3.0.01 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> tiffObj = open('john.tif', 'r').read() >>> open('junk.tif', 'w').write(tiffObj) >>> $ sum -r junk.tif john.tif 04308 25 junk.tif 16525 25 john.tif $ cmp junk.tif john.tif junk.tif john.tif differ: char 170, line 1 $ python Python 2.0 (#3, Feb 1 2001, 04:39:53) [GCC 2.7.2.3] on hp-uxB Type "copyright", "credits" or "license" for more information. >>> tiffObj = open('john.tif', 'r').read() >>> open('junk.tif', 'w').write(tiffObj) >>> $ cmp junk.tif john.tif $ __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: John M. <joh...@ya...> - 2001-03-09 00:35:13
|
Yes, I not only used vanilla Jython but also used Java classlibs for I/O and checksums instead of Python. I originally used Python but started using Java where I could to help performance. That wasn't enough and so then I started switching completely to Java. Maybe there's a market for this sort of scenario. Use a subset of Jython in exchange for the ability to switch to Java after the prototype solidifies. Maybe both languages would benfit from collaboration. --- Multiple inheritance? Yes, it's upsetting to me that the Java techs left this out and have the nerve to defend their gutless decision with bs. In reality, Java does support multiple inheritance. Well, in one necessary case where the Java techs painted themselves into a corner... the ability to inherit from Thread and one other class. They don't support this explicitly... no, that would require admitting their error. Instead they hatcked the language itself to get that it. Ugh. That's makes two mistakes. --- CPython? I'm not sure about that anymore. It's faster than Jython in most cases but I have multi-threaded apps... on HP. Maybe I misused it but CPython crumbles... each thread taking a turn with the interpretter. The performance falls to near zero. Correct me if I'm wrong but the micro-threads in stackless Python is no better. --- Finn Bock <bc...@wo...> wrote: > > >BTW, after spending hours adding braces and semicolons and "new" and > >*obvious* data types, etc. to transform Jython to Java, I now think > of > >Java as simply Jython dressed in drag. (Not that there's anything > >wrong with that!) > > Probably because you only use a small subset of python's dynamics. > Think > about converting an application that changes the __class__ field, add > or > replace methods on class, use multiple inheritance or build > codestrings > to be exec'ed. > > regards, > finn > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: Ype K. <yk...@xs...> - 2001-03-08 22:46:12
|
Originally alreadu sent to: John, >Any thoughts about developing a tool to convert Jython to Java? Unlike >jythonc (which is a great tool!), something to ease the job of porting >to Java in order to get better performance. > >I'm porting code by hand now. It's pretty mechanical. And the >performance gain is dramatic. If only it wasn't sooo tedious. > >BTW, after spending hours adding braces and semicolons and "new" and >*obvious* data types, etc. to transform Jython to Java, I now think of >Java as simply Jython dressed in drag. (Not that there's anything >wrong with that!) Try adding changing a method of an object in Java to remember the differences.... Seriously, in case you will have to spend many more hours dressing Jython in drag, you might consider getting your hands on the Python pretty printer module and change its output to do a lot of the work for you. You'll spend some hours before becoming productive, though. Ten years ago I would have used /usr/bin/sed to do a thing like this. It might still work, too. I never got to know awk in depth, but it might even be better. Some alternatives: Try and use a profiler to determine which code to move to Java first. Where is that Jython profiler anyway? Also it is quite possible to create a Java superclass for your jython classes. This allows you to concentrate on the time critical methods first, instead of moving whole classes at a time. Actually I think creating Java superclasses and doing a bit of manual profiling in Jython is the most effective use of your time. Normally 80-90% of time is spent in 10-20% of the code. Good luck, Ype |
From: D-Man <ds...@ri...> - 2001-03-08 22:32:59
|
[moving this to jython-users list] On Sat, Mar 03, 2001 at 10:03:06PM -0800, Michael Vanier wrote: | | Hi, | | So, I've been playing with jython for a few hours, and I'm *really* | impressed. This is a kick-ass system for doing portable graphics | programming. Just bear in mind that Jython runs in a JVM. Thus is brings with it some of the limitations of the JVM. Namely Swing descends from AWT, and AWT requires a native peer for everything. Thus you can't use, for example, java.awt.Image or javax.swing.Timer without having a native display. (ie no headless *nix servers unless they have an external Xserver or Xvfb running) Large companies don't always do the logical thing. | | However, the online docs are a bit sparse, and one problem I've been having | is in trying to call a protected superclass method from a subclass which | overrides the method. The offending superclass is javax.swing.JPanel. I | have a subclass of this (let's call it MyJPanel) which needs to override the | protected paintComponent() method of JPanel. The naive approach: | | class MyJPanel: | # ... lots of code ... | | def paintComponent(self, g): # g == Graphics object | JPanel.paintComponent(self, g) | # extra code goes here | | doesn't work, because paintComponent is not accessible from the MyJPanel | namespace. Not quite. You are taking the class "JPanel" and trying to access it's member "paintComponent". In Java/C++ syntax, only items declared as "static" are actually in the /class/. All others are in /instances/ of the class they are written in. This is one area where Python is much more consistent. | The online jython docs say this: | | In Python, if I want to call the foo method in my superclass, I use the | form: | | SuperClass.foo(self) | in Python ... (not Java) | Instead you have to use the "self.super_foo()" call style. This is correct. In Python you call the method on the /class/ object passing it the instance ("this" in Java/C++) as the first argument. In Java, only /static/ methods can be called on the /class/. | | Well, I couldn't get this to work. I'm not sure if the above statement means | that you're supposed to write (in my case) "self.super_paintComponent(g)" or | self.JPanel_paintComponent(g) but neither one works. What is the magic | invocation? self.paintComponent( g ) should do the trick. | Also, I was surprised to find that MyJPanel, just by subclassing JPanel, gets | its own public version of the protected JPanel methods! So if I don't | override the method, I can call it directly. I assume this is intentional, | but maybe the jython developers can comment. MyJPanel gets all the methods that are in JPanel (except maybe private ones). Since Python does not have an access restriction model, they all become public. HTH, -D |
From: <bc...@wo...> - 2001-03-08 22:27:48
|
[John Mudd] >Any thoughts about developing a tool to convert Jython to Java? Unlike >jythonc (which is a great tool!), something to ease the job of porting >to Java in order to get better performance. > >I'm porting code by hand now. It's pretty mechanical. Yes, but not entirely. >And the performance gain is dramatic. Yes. >If only it wasn't sooo tedious. Yes. Keep in mind that since you wrote the original python version, you are familiar with the exact type of all the variables in the application. Creating a tool that can figure out this information from a data flow analysis is not that easy. JimH though it was possible and his original jpythonc2 was intended to such a type analysis tool. However, it is not a tool I can create. >BTW, after spending hours adding braces and semicolons and "new" and >*obvious* data types, etc. to transform Jython to Java, I now think of >Java as simply Jython dressed in drag. (Not that there's anything >wrong with that!) Probably because you only use a small subset of python's dynamics. Think about converting an application that changes the __class__ field, add or replace methods on class, use multiple inheritance or build codestrings to be exec'ed. regards, finn |
From: Richard G. <rg...@in...> - 2001-03-08 20:35:14
|
Hi all, This is a Jython beginner's question. I'm using Jython 2.0 on Windows NT 4.0, mainly for testing a Java framework of our own. This framework is in a package com.intraware.b2b.ifwk, which is in the CLASSPATH envt variable. In interactive mode: >>>import com.intraware.b2b.ifwk.client will work, whereas if the same statement is in a script "M:\ifwk\scripts\testClient.py", launched by: jpython.bat M:\ifwk\scripts\testClient.py The script will launch but give an error: Traceback (innermost last): File "M:\ifwk\scripts\testClient.py", line 12, in ? ImportError: No module named intraware So it looks like the CLASSPATH is different in the 2 cases. But I don't know why. Any suggestion would be greatly appreciated. Richard |
From: John M. <joh...@ya...> - 2001-03-08 17:58:57
|
Any thoughts about developing a tool to convert Jython to Java? Unlike jythonc (which is a great tool!), something to ease the job of porting to Java in order to get better performance. I'm porting code by hand now. It's pretty mechanical. And the performance gain is dramatic. If only it wasn't sooo tedious. BTW, after spending hours adding braces and semicolons and "new" and *obvious* data types, etc. to transform Jython to Java, I now think of Java as simply Jython dressed in drag. (Not that there's anything wrong with that!) __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/ |
From: Samuele P. <pe...@in...> - 2001-03-08 15:52:01
|
Hi. [D-Man] > | If I don't use jythonc, what other ways do you all find to work well? Can I > | take the .class files built by Jython and use another tool (like > | ClassWrangler on the Mac) to build a jar that I could distribute with > | jython.jar? > > AFAIK jythonc merely takes the .class files it outputs and the .class > files necessary from the jython.jar file and puts it into a new jar > file. (Ok, a simplification since it first generates Java source and > also figures out dependencies) If you want to do that by hand, the > 'jar' part of the JDK should be able to handle it. jar is run very > similarly to tar except it produces a .jar file instead of a .tar > file. > Not that simple, jythonc produces code with information on the java and python packages that will end up in the jar archive, the runtime will use this info to make imports (python import stmt) work, to do the same by hand one need to use sys.add_package("foo.java.pkg") for java packages, and there is no direct support for python stuff assuming the jar is run through java -jar (or something equivalent)... adding support and tools for this kind of deployment (let's call it "poor man freezing") is one of the jython specific goal for jython 2.1 ... regards, Samuele Pedroni |
From: D-Man <ds...@ri...> - 2001-03-08 15:08:07
|
On Thu, Mar 08, 2001 at 08:18:37AM -0600, William Dozier wrote: | My first guess at the easiest way to distribute this code was to use jythonc | to build a single jar that would hold all the Jython classes. That way the | users would only have to install a jre and Swing. However, I have not had I think that this would be the easiest way. | any success in getting jythonc (I get a very long list of compiler errors) | to complete this task and the documentation for it seems to be useful more | as a reference for experienced users than a tutorial for new ones. It would | be helpful to me if someone would post a detailed how-to for the complete | task of using jythonc to prepare a jar suitable for distribution to users | that will not have Jython installed. Hmm, when I tried jythonc I had no trouble at all. I simply gave it the --jar and --deep (or --all) options and it built a jar file containing java bytecodes for my python source and the jython interpreter bundled together. Could you post the errors you are getting? | If I don't use jythonc, what other ways do you all find to work well? Can I | take the .class files built by Jython and use another tool (like | ClassWrangler on the Mac) to build a jar that I could distribute with | jython.jar? AFAIK jythonc merely takes the .class files it outputs and the .class files necessary from the jython.jar file and puts it into a new jar file. (Ok, a simplification since it first generates Java source and also figures out dependencies) If you want to do that by hand, the 'jar' part of the JDK should be able to handle it. jar is run very similarly to tar except it produces a .jar file instead of a .tar file. HTH, -D |
From: William D. <wdd...@ma...> - 2001-03-08 14:19:02
|
Hi, I've been working on a project that I want to distribute as open source and, now that I am about to the alpha stage, I am trying to determine how to do that. I am sure that there is ample guidance at the Sun and Python/Jython websites about the legal aspects, but I am a bit stymied at the technical ones. The source (right now) is all Jython; my long-range plan is to port most of the code to Java and just leave the highest-level stuff in Jython and use Jython for a macro/scripting language for the app. I have done most of the development on a Windoze 2000 laptop (I work on this while I am commuting to work on a train) but, though I want the final product to be as platform-independent as possible, my main user base will be Mac users. My first guess at the easiest way to distribute this code was to use jythonc to build a single jar that would hold all the Jython classes. That way the users would only have to install a jre and Swing. However, I have not had any success in getting jythonc (I get a very long list of compiler errors) to complete this task and the documentation for it seems to be useful more as a reference for experienced users than a tutorial for new ones. It would be helpful to me if someone would post a detailed how-to for the complete task of using jythonc to prepare a jar suitable for distribution to users that will not have Jython installed. If I don't use jythonc, what other ways do you all find to work well? Can I take the .class files built by Jython and use another tool (like ClassWrangler on the Mac) to build a jar that I could distribute with jython.jar? Thanks! Bill |
From: Peter B. <bri...@ma...> - 2001-03-07 22:12:10
|
Riccardo: > I'm using Jython 2.0 on MacOS 9.1 with mrj2.2.4. >I can run the interpreter and a few simple python scripts seem to work. >I can also import string and other mods. >But whenever I try one of the demos with awt/swing I obtain an error >such as this: > > >Traceback (innermost last): > File "/MacHD/Developer/Jython/demo/awt/simple.py", line 15, in ? >TypeError: can't set arbitrary attribute in java instance: actionPerformed I've posted the patch for this problem on one of my pages, at http://www.math.uiuc.edu/~brinkman/software/jython/macpatch.html It's probably a good idea to install this patch if there's the slightest chance that someone may want to use your jython code on a Mac. Best, Peter |