Domain: jython.org
Stories and comments across the archive that link to jython.org.
Comments · 163
-
Re:What is this Groovy?
You're entirely wrong. Groovy is another language that targets the JVM. Groovy is either compiled to Java bytecode (and from there, JIT compiled to machine code by the JVM), or it's compiled at runtime in a JIT fashion. There is no interpreter written in Java that runs Groovy code. Groovy is just another language that targets the JVM.
This is indeed a good way to integrate seamlessly with Java.
Jython takes the same approach with Python (Python source is compiled to Java bytecodes) to allow tight Java integration. It has a nice intereactive shell (dynamically compiles to Java bytecodes) so you can do dynamic experimentation/debugging of large Java programs. Pretty cool.
http://www.jython.org/ -
Re:the best thing about this
The JVM and the J2SE class libraries are the most important contributions made by Sun under the Java technology umbrella. The Java language itself is irrelevant. Many people dislike the language syntax, and they have the right to do so. Syntax is a matter of taste - everybody should be able to program using the language they like the most (for the task at hand). But portability, interoperability, security, and other core features of the Java runtime are often underestimated.
People should stop fighting over language syntax and recognize that what we should be striving for is a feature-rich platform independent runtime, and that is what Java is in its essence. Groovy, Jython and JRuby are initiatives that recognize that.
-
Java has language independence too!Perhaps the most important benefit of using the Mono architecture is that you gain language independence.
This is by far the most hyped feature of C# but it's also present in Java. If you look at the large incompatibilities between Visual Basic and VB.NET you'll see that
.NET is not really that language independent and that each language is really more of a "skined" version of C#.As far as alternative languages go in Java there are many. Among the most popular are: JRuby
# interpreter written in 100% pure Java
# Most builtin Ruby classes provided
# Support for interacting with and defining java classes from within ruby
# Bean Scripting Framework (BSF) support
# Distributed under a tri-license (CPL/GPL/LGPL)
Jython (Python)
Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform.
Groovy
Groovy is an agile dynamic language for the Java 2 Platform that has many of the features that people like so much in languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax.
There's a lot more smaller projects like JavaScript and Rhino, Jelly, BeanShell, Tcl/Java, Sleep, ObjectScript, Pnuts, Judoscript. Some people event think there are too many alternative languages for the Java Virtual Machine.
-
Re:Yeay! Security plus portability minus cost...
-
Re:People are looking at this the wrong way"is lightyears ahead of anything python simply because it gets compiled into machine code"
Actually,.NET introduced a new programming language environment that compiles all source code into an intermediate language.
Now that is also not quite true, because people have written various JVM bytecode compilers for their languages, or implemented their languages in Java. (See Jython for the latter, or The Tcl/Java Project, or The scheme package for Java based scheme. lists some 200 languages that have been ported to the JVM.) .NET languages are compiled into the Microsoft Intermediate Language (MSIL), which is executed by the Common Language Runtime (CLR) software in the Windows computer. The MSIL is similar to Java's bytecode, except that whereas Java is one language, .NET supports multiple programming languages... -
Java or Python. Jython, maybe?
I like Python for its clean and simple, while still somewhat string, syntax. The OO is a bit clumsy, however.
Java has good OO concepts, and a widely spread and known syntax.
Perhaps Jython, the Python interpreter running inside a JVM, would be a good combination for leveraging the best of the two environments? -
Re:Not Java but JVM.
so how many people are writing code that gets output as Java bytecode but is not written in Java?
How many people are using Jython?
-
Re:Not Java but JVM... so how many people are writing code that gets output as Java bytecode but is not written in Java?
Anyone who writes in Groovy, Python, ObjectScript, JavaScript, NetRexx, and many others. There's a scripting JSR as well. I don't think the original poster had this specifically in mind though.
-
Re:"blessing" doesn't matter
It's interesting to note that there are several re-implementation of Python, at various levels of maturity (Jython,stackless Python,PyPy, and IronPython)
-
Re:And what would be better?I'd use Python. Java is slow too, slower in practice since it makes much less use of native code.
In that case, click here to make your head explode...
Seriously, that argument hasn't been true for years. In fact, Java makes more use of native code. The Java APIs mostly call native implementations (like zlib for instance), and bytecodes are turned into native code with JIT compilation.
If you want a JIT compiler extension for Python, you can try Psycho.
-
Re:Considered Python?I agree that Python is a great language. It's my favorite for small things. (Well, for really small things I use the shell or awk.)
If you're using Java already, I strongly recommend checking out jython, an implementation of Python in Java. I love it for small GUIs because it gives me access to Swing with much simpler syntax than Java.
-
Re:Please enlighten me
One only has to visit http://www.refcofx.com/FinanceChart.html?symbol=E
U R/USD to see java in action, (assuming the java runtime is installed). Can one use Python to do the same? Where would it play its role? The backend or on client machines? -
Re:Please enlighten me
One only has to visit http://www.refcofx.com/FinanceChart.html?symbol=E
U R/USD to see java in action, (assuming the java runtime is installed). Can one use Python to do the same? Jython -
Re:Already ditched
For small programs, Java can get very wordy and very verbose, especially if you coming directly from C/C++, or from a language like Perl or Python. [...] However, once you start making larger programs, Java isn't that bad, and all of those words are there for a reason.
Exactly. Java is for large programs. Who cares how many lines Hello World is.
And the cool thing is, if you want to write short maintenance/testing scripts that use your huge Java library, or you want to manually call some functions from an interactive interpreter prompt, you can do that with Jython. I love the combination of Java and Jython.
-
Re:That would be nice..Mohammed to mountain.
Already done: Jython
-
jython
-
Re:Top problem: GUI
I develop in a range of languages, but mostly Java for its cross-platform-ness and GUIs, and Python for its clear syntax.
If i had a combination of the two - python's pureness and cleanliness and Java's x-platform libraries - i would be pretty happy. However, i would still be stuck with Swing for GUI work.
This isn't my problem, but it sounds like Jython would be a perfect fit for you.
I prefer Common Lisp, and for those pesky apps that have to run on a Java runtime I've had good luck with Armed Bear Common Lisp -
Re:why?
For the uninformed, you can already run Python on
.NET Common Language Runtime and Python on the Java Virtual Machine. -
Sounds like someone
needs an introduction to Jython.
-
Jython
You might want to try Jython and the Numerical Python for Jython.
I have not used either for a long time, but use plain Python and Numerical Python a lot; sure beats Matlab and Mathematica for most things. Right now for solving optimization problems with 10k+ s.t. constraints. -
Re:like Jython...
Jython is not a bridge in the java to native sense, if that is what you mean. It is an interpreter of the Python language fully made in Java.
-
Pictures of the TopcodersClick here for a gallery of Topcoder mugshots.
PS: Why won't Topcoder allow any dynamically typed languages? The least they could do is allow Jython -- it runs right on the JVM so they would hardly have to lift a finger to allow it. This conspicuous absence of dynamically typed languages just maybe excluding the greatest programmers according to Paul Grahams's "Python Paradox". Why not find out whether dynamically typed languages really are all they're cracked up to be by guys like Paul Graham by making Topcoder a really fair contest that includes at least one dynamically typed language?
-
Chickens won't even allow JythonIf Topcoder isn't going to allow any of the major dynamically typed langauges like Python or Perl or even Jython (if Topcoder really needs Java compatibility because they don't have the resources to provide a new language), then isn't it an admission that Paul Graham is right and that all contests based on the Topcoder selections are simply demonstrations of subgreatness?
What are all these guys afraid of? A fair contest?
-
Re:The Java Problem
Yes Python is easy to use/understand/remember, but then again there are some time when I would need several pages of python code to do something that I can use one or two pre-made classes in Java for.
If the Java library is Java's main strength, well, you know what people are going to say... Check this out, Java dudes. -
Re:Java programmer's viewpointUntil there is an IDE for Python that's as extensive, capable and sophisticated as Eclipse I'm going to stay with Java.
Actually, you can use Eclipse as an IDE for Python: http://www.python.org/cgi-bin/moinmoin/EclipsePyth onIntegration.
And why choose between Java and Python when you can have both? -
cover all the bases!and learn to use Jython!
You can put Java on your resume to get the job, and then use Python to glue components together!
All kidding aside, I am currently working on a pretty complex java project. I've written various small programs as utilities, and these programs would have been better off as scripts accessing some of the java classes I had already written.
The downside of java -- in this circumstance --- was having to deal with classpath and compiling cycles and whatnot. What I really wanted was to write the program/script easily, have it leverage what I had already done, and not bloat the resulting
.jar files with little utility programs that would be better off as scripts.I learned Python a little too late for this project, but you can bet your ass Jython will be embedded in my next.
-
Re:Driving users to windows, where the tools are b
You can't win with either java or mono(c#).. Maybe its time ffor python/perl/php/ruby.....
Well, with IronPython mono is Python. Alternatively, you can always use Jython and have Python being Java. The real benefit here is this: There's no need for constant updates to the pyGTK and pyGNOME libraries every time GTK of GNOME changes if you're using IronPython, because IronPython automatically gets the latest GTK# stack through mono - your bindings are always automatically up to date.
Of course, you can always go with Parrot if you want the completely new and different open source implementation of the concept. Parrot will run both Perl and Python happily, not sure about PHP and Ruby, but I imagine someting is in the works, and while it is a lot less complete than the others, it promises to do a lot more, and potentially do it notably faster than either Java or Mono/.NET
Plenty of options, and they all make some sense. Time to let OpenSource Darwinian practices see who survives in the long run - there are more baskets for these eggs, so there's no reason to panic.
Jedidiah -
Re:SUNW: 2 billion in cash / NOVL : 3 billion cap
"[2] The libraries are actually pretty damn awesome. They are the crown jewels at this point - complete enough to make the host OS irrelevant."
You aren't the only one who thinks so! -
Re:parrot?
-
I'm confused...
If the best hackers program in python.. but not in java can someone explain jython? (python IN java)
/me gives stupid idiot look
So thats an interpreter written by non hackers for hackers? Go figure.. -
Re:Yahoo = Dumboo
Oh yes, yes it is: Jython baby!
-
Lisp bad, python good?
I'd like to see a standardized lisp that I can write and read as quickly and Python.
It's been tried - see Dylan. As near as I can tell, Dylan didn't take off because:
The Lisp people saw no major advantages to it other than the syntax, and they'd already gotten past that barrier
The non-Lisp people apparently didn't understand that it really was better than C++/Java
Lisp does need a better ... community ...
Like the one growing here?
and one standard open source implementation.
Now I'm really confused. Multiple implementations with a common specification hurt Lisp, but Jython and stackless python are not drawbacks for Python? -
Re:I don't actually care hugely about performanceJava doesn't play well with others, and it was seemingly designed not to.
-
Trying to predict the next 2 years...Being regular Python user/fan, each news, which features Python makes me happy. How do you think, will Python become more and more popular in the next years? I think so.
- web development: Not only Zope and Plone, there's a lot of interesting development going on with Twisted... and, well, Twisted is not only about the web, it is about networking in general;
- .NET / Java development in general: Python in Java exists already... Java gaining more and more popularity? No problem, Python is already there.
.NET/Mono taking the market away from Java? The industry will perhaps support more and more .NET techniques - with IronPython (featured recently on /.), Python is already there. No problem; - some people might wonder if you really need that stinkin'
.NET/Java stuff at all - Python is already very portable, but that's not everything - it already supports a wide range of MacOS/Unix/win32-specific functionalities. - anything else makes you wonder, if Python is a good choice at all? What about realtime applications, like a VOIP phone (GUI included, win32/unix compatible) in Python? Do you read "interpreted" as "slow", do you wonder if Python is good enough to be useful in CPU-demanding programs like games? Anything else against it? Perhaps you're worried about Python's extensibility?
- if software telephony sucks for you, perhaps you should try a real mobile phone
;) -
Re:Response to Mono?
(Plus,
.Net does some things that Java will never do, like multiple language support in the VM.)
100% wrong: JYthon -
java and jython
While albeit not that radical, and definitely not applicable to all environments. One of the most effective methods I have used for debugging java code is by using jython I find using jython about an order of magnitude faster for writing test cases, and debugging code than Java. Furthermore, having the ability to pop open an interpreter and try methods out whilst you program is invaluable. Eclipse added a feature (jpages I think it is called) which you can write code in, but the value of python lies in the dynamic data structures, and no compile time type checking (no class casting which is what you spend a good bit of your time doing when writing java test code)
-
Re:Under the Rug
A language that lacks the tools necessary to implement such a regime needs GC, so the presence of GC may actually (as in the case of Java) indicate a fundamental weakness in the language.
Please explain to me exactly how you can implement a resource management system (or regime as you call it) in C++ for, lets say, managing socket connections, that has no equivlent in Java. You are aware of this method, right?
Then, please, further explain to me how a task performed by a software platform, in this case the Java Virtual Machine, can show a weakness in a programming language. Do you mean to imply that If I use Jython or Groovy that I won't have this problem? Or are you just making the rookie mistake of confusing the Java 2 platform with the Java language?
-
I still like The Grinder better
I looked through the article, it doesn't look like much more than a slightly sophisticated wget for loop
:). Seriously though, this seems similar to a few other basic stress testers out there. For the projects I've worked on you need session management, interactive processes, ... basically hitting 5 urls isn't gonna stress test anything of value.
The Grinder on the other hand, allows for distributed workers, following the same or different 'scripts' all controlled from a single console. It provides you with a slew of configuration options and all sorts of data at your fingertips. The scripts are jython which is easy to learn and very flexible. If you want to stress test a complex app, especially something interactive, or requiring sessions, check out the grinder, it's a god send. -
Re:Python: Everything you want from Lisp -- and le
Python is Free as in Speech, Free as in Beer, a unified language with no spun-off dialects.
I have to disagree on your last point. Python is an implementation-defined language, and there currently is more than one implementation. You mention Psyco, which has "some subtle semantic differences (i.e. bugs) with the way Python works; they should not be apparent in most programs." This is not too bad, but there is also Jython, which has some significant deviations from the main Python implementation. Most of these are in terms of Unix hooks and the lack of C FFI, but I consider these to be the strongest features of Python.One thing I'd like to see cleaned up in Python is support for functional programming. Proponents like to go on and on about how well Python handles FP, but in reality it is awkward at best. The first thing that jumps out is that a lambda body can contain only one expression. This doesn't sound terribly restrictive until you realize that Python has a sharp divide between "expressions" (they may return values) and "statements" (they don't return values, and may have an implicit block), and that there is no explicit block construct. The former makes it kind of hard to make useful closures (since assignment statements are statements, after all), and the latter makes lambdas useless for all but the most trivial uses (after which you have to fall back on named functions for their implicit block). The obvious solution would be to make an explicit block-making expression, but I don't know how this would work with the current practice of specifying all (implicit) block scope through identation. Another annoying thing is the inability to pass operators as HOFs (but then again, this ends up as one of the few uses for the crippled lambda).
One thing that Python totally rules at is structured imperative programming. Here is where the block-indentation really pays off - it allows a minimal syntax in terms of irrelevant punctuation, and mandates a legible writing style. Indeed, in C (and especially in C++), it is very easy (in the case of C++, I think it's encouraged) to write unreadable code - all the Python I've seen and done so far makes me think that one has to work against the language to produce hard to read code. And the C++ integration of Python can't be beat (the only Qt I like is PyQt). As I've stated in a recent posting, I think the best way to write C++ applications is in Python.
-
Re:Let Me Get This Straight
such as JDBC drivers, XML parsers, SOAP tools and 3rd party components
Semi-check, built-in, check, and check (including a lot of real winners, particularly including multiple cross-platform GUIs).
(The semi-check is because I'm not 100% certain the python modules match the JDBC completely.)
The only advantage Java offers is when it has an actual library that you can't get in Python (or likely anywhere else); capability for capability the languages and libraries are pretty close to the same. I mean, we have "Web Application Servers" for Python (like Zope), but maybe you absolutely need some Java thing for some other reason. There's no one language that meets all needs. But there's no reason Python can't be used in very large scale projects successfully, as evidenced by the fact that it has been so used.
Personally, I'd much rather use Python for the larger scale projects since for a variety of reasons I think it scales better then Java; Java projects IMHO survive because they get a lot more resources thrown at them, not because the language does very much to hold large projects together. But that's just my opinion.
(Oh, and Jython, though I know it's been mentioned elsewhere.) -
Re:Me either ...
I don't know if you are talking about invoking scripts from Java, in which case you a lot of alternatives, from beanshell to jython (the python implentation in Java) and most of them could be run through BSF to have an uniform API.
DinamicJava on the other hand is an interpreter of a superset of Java.
I don't know what you find annoying: compiling and executing. That's the norm for most programs. Java programs are Just In Time Compiled but that is done transparently by the virtual machine and is faster than interpreted. -
Other languages that produceJava bytecode
- The java bytecode format is so specific that it is impossible or rather hard (there was once a java backend for egcs, admitted) to get other languages like C/C++ to run on it. Why does one have to chose the platform java with the language java? I don't know
.NET, but from what I heard, multiple frontends for arbitrary languages are possible.
There are several languages with which you can write Java bytecode programs, like Jython .
See here, so it is possible with Java bytecode as well. -
Re:Helping MS own the platform
Python with a native JIT compiler, plus wxPython, would rock.
Have you tried Jython? Essentially Python running on the Java VM.
-
Re:steps toward Python
Have you tried jython?
"Jython is an implementation of the high-level, dynamic, object-oriented language Python written in 100% Pure Java, and seamlessly integrated with the Java platform. It thus allows you to run Python on any Java platform."
This means you can even run python on a palm pilot or a cell phone.
jython code can even be compiled into java bytecode (*.class files)
/* ---- */ -
Re:Come on.
How the hell to you get the IBM JVM without signing up as a websphere developer?
My biggest problem with Java is that the best VM (IBM's) is not a free download even though eclipse is. I have to use Suns JVM instead. Eclipse is much faster on IBMS's JVM than Suns.You go there to get the JDK. You do have to register though, but I sure never developed on Websphere. I never paid IBM for anything either., so you're just lying.
2. The CLR works with multiple languages. Java's VM is only Java.
I hear this all the time. First of, all, it isn't true: I'll give you 2 examples: Jython and Groovy. I'm sure there are plenty more examples you can find if you want.
Besides, does it really matter? The strength of Java and .Net are mostly the class libraries and APIs you can find. When programming WinForms, does it really matter if you're using C#, VB.Net or any of the CLR languages?Apart from syntax, your form will end up looking exactly the same anyway, with the same functionality. It's just a matter of which syntax you prefer.
C# is an open standard. Java is a closed one. Microsoft did this on purpose of course, in order to kill Java. Regardless of whether it's open or not, Microsoft will always have the strongest influence in the C#-platform's direction. It's Microsoft's baby. The same goes for Sun and Java, whether or not it's a closed standard. Why Sun hasn't opened Java is beyond me...it does them no good being closed. It just makes me want to write C# code for Mono::
Anything that matters in
.Net is not standardised. ADO.Net, ASP.Net, ... all thoser things are proprietary as hell. At least with Java, many important API's are open to be implemented by those who want to (J2EE, JAXP, JSLT, ...). In the Java world, you can actually choose your implementation, as opposed to what MS force-feeds you with .Net.But would I like to see Java standardised? Sure, but even without it, it still is more open than the entire
.Net platform.4. If you really must insist on Java, just use J#. The languages are syntactically identical (with only 'generics' differing). What you gain by this is better byte code running on a better VM.
Really? And could you tell me when I could get that J# code to run on all the OSses that Java supports?
-
It's Just Byte Code, DIY
As you probably know there are a ton of languages that will compile down to Java bytecode and run on any JVM (e.g. jpython).
So why don't you just grab an OpenSource Java compiler and add a --case-insensitive compile switch?
You could then code merrily in whatever case your caps lock key happened to be set in, and it would run on anybody's JVM.
Or just suck it up and get used to case sensitive programming like the rest of 3 million Java developers
-
Re:They should benchmark development time
Personnaly I think Jython/Tapestry
/Hibernate may be the ultimate web development platform, but I haven't used Zope much... I've witnessed that the Struts/EJB approach is not very productive. -
Re:They should benchmark development time
Stop fighting. The solutions for the two of you is jython.
-
Re:Didn't we do this once before?
Cross language inheritance is nothing unique. Jython has it. Jython and C# came about at roughly the same time.
As other posters suggest, problems start when you realize that Java has single inheritance and Python has multiple. The same problem occurs when bridging C# and Python.
I guess everything looks better when it comes from M$ PR department.
-
My List for Everyday Use
These are some of the free (speech or beer) software I'd install on a family, non-gaming machine:
- Web Browser: Mozilla or Mozilla Firebird
- E-mail: Mozilla (cross-platform), Mozilla Thunderbird (cross-platform), Evolution (Gnome), or KMail (KDE)
- Office Suite: OpenOffice.org
- Media Player: QuickTime (Windows), Zinf (cross-platform), RealPlayer (cross-platform), WinAmp (Windows), MPlayer (Windows), XMMS (Linux)
- Image Viewer: IrfanView (Windows)
- Instant Messaging: Gaim (cross-platform)
- Personal Information Management: Palm Desktop Software (great PIM suite even if you don't own a Palm)
- Other: Acrobat Reader (although I'm weary of their DRM), Java 2 Runtime Environment, Macromedia Flash and Shockwave players, Ad-Aware (spyware remover for Windows), ZoneAlarm, Sygate Personal Firewall (firewall, alternative to ZoneAlarm), Grisoft AVG Anti-Virus, FileZilla, WinRAR (not free, shareware with nag window), Ofoto desktop software (basic photo album and touch-ups, even if you don't use Ofoto's online services)
Some other software I'd install on my own desktop (dev), in decreasing order of importance:
- Cygwin, bascially all packages
- UltraEdit32 (45-day trial shareware)
- TightVNC
- Ghostscript and GSView
- Java 2 SDK
- Eclipse
- Borland JBuilder Personal
- ActiveState Perl, Python, Tcl/Tk (yes, even though they are in Cygwin), Jython
- GIMP
- POV-Ray
- At least one of Apache, Tomcat, or Plone (Zope)
- HTTrack (a website copier)