Domain: jython.org
Stories and comments across the archive that link to jython.org.
Comments · 163
-
Re:Any language?
What about Jython? Sort of Python...Sort of Java. Does that count?
-
Jython to the rescue!
-
How to make Accessible Java
Sorry, I misread the headline as how to make Java Accessible to Progammers
Jython
Welcome to the Jython homepage. 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.
[I even previewed it, saw that the url was wrong but pressed submit without changing it!] -
Platform Competition?
Check out Artima if you want to see Bruce Eckel's take on the Python language which, incidentally, with the addition of things like a logging API, and with long-existing additions like Jython, is beginning to look more and more like a viable competitor to Java.
Why?
Python carries a LOT of the same advantages, but with a dramatically accelerated prototyping and general development speed, and a few tricks of its own. Plus, via Boost, it interoperates with C++, too. I'm an avid Perl hack, but I have to admit that Python, which even has a whole API for basic game programming is looking more and more attractive for quite a number of things.
Download soon and often. -
Jython
After describing two ways that one can (somewhat inelegantly) bridge PHP with Java using current technologies, the author of this article then mentions Erik Hatcher's weblog lamenting something to the effect of 'it would be nice if this were not limited to serverside app development'. I find this interesting, because there is a great scripting language (Python) which already has a Java-compatible implementation (Jython) -- so compatible that the language is actually written in Java and runs in a JVM! Yes this means you can access just about any Java class from a Python script, and not only that, the final Python scripts are Java executables.
-
Re:I still don't get the allure of Java
if I didn't read
/. I wouldn't know what Python is
Check it out - or you might find Jython useful. -
Re:The problem: Improving programmer productivity
Actualy, try looking at Jython
Sure, for small programs its not perfect (as you'd have to still run the VM), but this way you can integrate Java applications and use Python to script these applications. -
Re:The problem: Improving programmer productivity
Firstly, as someone else already pointed out, javascript has nothing to do with java.
Secondly, if you want a (as you say) "powerful multi-purpose high-level [scripting] language like Python" in java, why not use Jython? (note : I don't know python, I don't know jython, just making a suggestion) -
Re:Who cares?
Java would take a huge leap forward in utility if you could just overload the =, +, -, *, and / operators
Perhaps you should take a look at Jython. It's an implementation of Python in Java which allows you to execute Python scripts within Java code or to build Java classes with Python code. Since Python supports operator overloading and has a nice clean syntax it may well be helpful in your situation. -
Java-based RAD? Try Jython!
I've just gotten interested in Jython, although I've been using Java and Python (separately) for quite a while. I can't believe I came to it this late. Imagine having the simplicity of an award-winning dynamically-typed yet fully object-oriented scripting language at your finger tips for busting out scripts and relatively simple code, but with complete "native" access to Java libraries. (Quotes because it seems oxymoronic to use the word "native" to refer to Java.)
It's not quite the same as VB or even JavaBean-based "programming" (using a GUI-based code generator), but if you need to glue some Java classes together and don't want to go through all of the boilerplate required by straight Java programming, it's worth checking out.
-
Re:Python's "vs" issuepythonistas don't raise any stink about java because of Jython. and the ones that do raise a stink about Perl aren't worth listening to; they're the equivalent of the sort of linux zealot who wastes all their time posting to
/. about the evils of microsoft, instead of actually doing something good and useful with the free software they claim to love so much. most sensible python users don't have time to start any anti-[insert language] flamewars.about regexps, i won't bother to flame myself; i'll just paraphrase jamie zawinski about them - "you have a problem, so you decide to solve it with a regexp. whoops, now you have two problems!".
-
Re:Yes, and partly language designers' doing
-
Re:I agree, but...
Yes. Jython would be an excellent choice here, as it can be compiled to/talk to Java stuff.
-
Re:In a nutshell
I was under the impression that any language that is semantically rich enough to produce bytecode for objects, inheritence, etc. would have no problem inheriting from a java
.class file that was itself generated from any java compiler. (or any bytecode generating compiler)Certainly Jython allows for this and I don't see what's to prevent other my-favorite-language-to-java-bytecode compilers from doing this as well.
-
Re:From the article...It has always bugged you that Java had no good mechanism to compile simple expressions on-the-fly? Here are a few options for you:
- Jython is a Python scripting engine for Java. There, now you can use Python within the JVM! <sarcasm>Get the worst of both worlds!</sarcasm\>
- Rhino is a Javascript engine for Java.
- Jacl is a TCL engine for Java.
- Bean Sripting Framework is a generic wrapper for including scripting languages within your application. It's from IBM, and is intended to abstract away the implementation of the scripting language. It supports Jython, Jacl, and Rhino now. It seems like I remember IBM releasing something for REXX as well.
Performance isn't great, but reports have indicated that Jython is about 75% of the performance (near the end of the article...search for the word "performance") of CPython. It's slower than Java code of the same type. But, hey, if you wanted speed you wouldn't be using interpreted code (or byte-code interpreted code, for that matter), right?
-
Re:I think a very cool feature would be..Seriously, if that is important to you, have a look at Jython, in particular working with properties.
def exit(event):
or (using an anonymous function)
java.lang.System.exit(0)
button = awt.Button("Close Me!", actionPerformed=exit)button = awt.Button("Close Me!",
actionPerformed=lambda: java.lang.System.exit(0)) -
Re:I think a very cool feature would be..Seriously, if that is important to you, have a look at Jython, in particular working with properties.
def exit(event):
or (using an anonymous function)
java.lang.System.exit(0)
button = awt.Button("Close Me!", actionPerformed=exit)button = awt.Button("Close Me!",
actionPerformed=lambda: java.lang.System.exit(0)) -
Libraries Comparison
Heh, hehe, okay.
According to Bagley's site, we should all be using Ocaml anyway. Who knows, he may even be right...
In reference to the Bagley test, Java was more performant than Python, true. But Python won over Java on both memory and lines of code. Also, his tests, as all artificial benchmarks, are both accurate only for the point-in-time and are only accurate within the limits of the test conditions themselves. More recent versions of both Java and Python are faster. On top of that, special-purpose optimizations exist for both Java and Python if you really need that extra spurt of speed -- think Jikes or TowerJ for Java and Psyco for Python. More to the point, though, Java may be faster than Python, but it isn't faster by an order of magnitude. The difference in speed between them is not enough to worry about -- if you really need that much speed, you won't be programming in either Java *or* Python, you'll be coding in C and assembler. Your performance argument is irrelevant.
Your libraries argument is somewhat more compelling. However, you may not be aware that there are two major versions of Python, standard Python implemented in C and Jython, implemented in Java. Using Jython, you can write Python that has full access to all of Java's libraries.
On top of that, I'll make a very rough comparison between the various projects on Jakarta and extant Python libraries. I don't think I've seen anything like this, as Python has a poor record for collating their libraries and apps in one place, so the effort is worth it simply for educational purposes, if nothing else.
Disclaimer: I am not terribly familiar with most of these projects, and they have varying states of completeness and maturity. I merely aim to show that analogs of the various Jakarta projects do exist in the Python world. Please feel free to peruse them yourself and come to your own conclusions.
Jakarta Ant -- PyAnt , SCons
Alexandria -- I don't know of any comparable Python applications. However, the individual components of Alexandria (doc generation, CVS access, etc.) are available: check out HappyDoc , and various modules for use with the Zope application server, including CVSFile
Okay, now I'm going to lump together a bunch of Jakarta projects. Individual authors and users of these projects will inevitably scream, but my justification is that they are all web application servers of one sort or another. Their purposes are all the same. They have many differences in approach, philosophy, scope, and implementation, but at heart, they are all web application servers or web application server frameworks. Those projects are: Avalon, Jetspeed, Struts, Turbine, Velocity, Slide, and Tomcat itself. Oh, and I might as well throw James in here, too. Python web app servers and frameworks are equally numerous, and several are in advanced stages of maturity: again Zope, Twisted, Webware, Quixote, CherryPy, and SkunkWeb. There are more, but I'll leave that as an exercise for the reader. Google is your friend.
Lucene has no real counterpart in Python. David Mertz has put together a text indexer and search program, available at his site, but it looks small compared to Lucene. There is also something called WePaSe, but there is no information on it aside from its freshmeat release announcement.
Gump also has no counterpart. Cactus has an equivalent in WebUnit and PyUnit. Log4J's Python copy is called, naturally, Log4Py.
ORO and Regexp provide regular expressions for Java. Python has regular expressions built in to the standard library.
OJB provides an object-relational bridge for Java, similar in concept to Sun's JDO specification. Python counterparts are Modeling , PyDO, which is a subproject of the above-mentioned SkunkWeb, and MiddleKit, a subproject of WebWare.
ECS, JMeter, and POI have no Python counterparts. BSF also has no counterpart, since it embeds a scripting language in compiled Java. Perhaps its "counterpart" is Jython. Likewise, BCEL has no counterpart, nor does Watchdog.
Taglibs has no direct counterpart. Instead, Python has Spyce, Cheetah, PSP, and probably close to a dozen other implementations of the ASP/JSP theme, each with their own library of tags. Lack of a standard is perhaps not a good thing, but the existence of bunches of competing implementations is not a bad thing. Perhaps the most direct counterpart would be Zope's built-in technologies, DTML and ZPT. ZPT has also been built out into a standalone version, SimpleTAL.
Jakarta Commons has too many small projects for me to want to research Python equivalents. If you are looking for something in particular, check the Vaults of Parnassus first.
As for Apache XML, Python has SOAPy and ZSI implementing SOAP, and DOM, SAX, and XML-RPC are built in to the standard library. 4Suite implements DOM, SAX, RDF, XSLT, XInclude, XPointer, XLink and XPath, and has an XML and RDF data repository and server built on top, which would make it very roughly equivalent to both Cocoon and Xindice. I don't know of any Python equivalents for Batik, FOP or XMLSecurity.
Python has relational database access through its DBAPI standard, with adaptors for just about every database. There are a number of object databases coded specifically for (and often in) Python, the most well known being ZODB, which was developed by Zope. There are adaptors for other object databases as well.
There are really two spaces where Java outstrips Python, and the second space is IMHO directly caused by the first: standardization, and J2EE. Python puts out a language implementation and a lot of very useful libraries, but does not have any standardization body like the JCP. The result is lots of fragmentation. Individual developers write their own libraries and applications that compete with each other while offering wildly differing APIs and programming approaches. There has been some push to organize, through the official Python SIGs, but their efforts, while noble, have not been massively effective. Only this month has an initial implementation of a Python library repository similar to CPAN been released. Kudos to Andrew Kuchling, who made it happen, but it is LONG overdue.
Regarding J2EE, the only viable competitor is Zope. Even then, Zope really doesn't address the same problem space. The shortfall here comes from a number of different factors: corporate buy-in, public perception, lack of an established problem-space solution, and lack of published standards. Zope is a great solution, and has been used by a number of high-profile companies, but its focus is different.
Well, I hope you find this comparison to be useful. *I* certainly found it enlightening. -
Re:Yes they did...But language-specific processors have always been losers and this was always a stupid idea.
I think that it's important to draw a distinction between the Java language and the Java bytecode. The language, IMHO, isn't very good; I much prefer Python, or if I'm developing for the Java platform, Jython. But Java is a form of bytecode that can be compiled to from all sorts of languages, so programs compiled for picoJava cold also be run transparently on many other OSes. Although I think that JIT compilers and Hotswap optimization have made this less important, it still might be nice to have a processor that could run Java bytecode natively.
Still, I'm not too enthusiastic about it.
-
Othere JVM LangsLanguages Using JVM covers
:- Scripting Languages for Java
- Interactive Languages
- Non-interactive Languages
-
Jython
Anyone know of any projects to compile JVM bytecode from other languages?
Jython
# Dynamic compilation to Java bytecodes - leads to highest possible performance without sacrificing interactivity.
# Ability to extend existing Java classes in Jython - allows effective use of abstract classes.
# Optional static compilation - allows creation of applets, servlets, beans, ...
# Bean Properties - make use of Java packages much easier.
# Python Language - combines remarkable power with very clear syntax. It also supports a full object-oriented programming model which makes it a natural fit for Java's OO design. -
reply to next article -- The Future Of JavaIdiotic Slashdot won't let me reply to the next article, as it thinks we're all going for 'first post's -- so I'm posting to this article instead.
"Anyone know of any projects to compile JVM bytecode from other languages?"
The first Google search I tried yielded this page as the first result. It includes a link to Jython -- a reimplementation of the Python programming language which is completely integrated with Java.
-
Re:Confusion?
I'm not sure you understand here. The .NET Framework is a collection of objects (similar to the Win32 API's) that all .NET managed code has access to.
I know.
Managed .NET code must be written with certain constraints, however.
C++ is not designed with these constraints in mind.
But, C# and VB.NET aren't the only languages out there. ActiveState has Python.NET and Perl.NET, there's COBOL.NET, Fortran.NET, Forth.NET, and even Pascal.NET (and many others).
According to this article, Perl.NET wraps the normal Perl interpreter (running as unmanaged code) and lets Perl code access the .NET runtime via special modules ("use perlNET") and special comments in the source code. I'm not saying that this is not useful, but it certainly doesn't make Perl a fully integrated .NET language like C# or VB.NET. (I haven't looked at the other languages you mentioned)
Jython, for example, has a better integration to the JVM (it's written in Java), and it does include a Python-to-Java bytecode compiler (though I don't know how well that one works).
But, managed code is a new addition to .NET that requires some adoptions in the programming languages.
The "some" depends. You should have a hard time integrating things like multiple inheritence, multiple dispatch, first-class functions or dynamic object systems (like Ruby's or CLOS's) into to the CLR as it stands today. AFAICS, you would either add these features yourself on top of the CLR (sacrificing a great deal of efficiency), or leave them out altogether, thereby making the language more similar to C# semantically.
I'm not stating that .NET isn't useful. I merely object to the claim that now that we have .NET, we can potentially use any programming language we want without significant problems. -
Re:Confusion?
I'm not sure you understand here. The .NET Framework is a collection of objects (similar to the Win32 API's) that all .NET managed code has access to.
I know.
Managed .NET code must be written with certain constraints, however.
C++ is not designed with these constraints in mind.
But, C# and VB.NET aren't the only languages out there. ActiveState has Python.NET and Perl.NET, there's COBOL.NET, Fortran.NET, Forth.NET, and even Pascal.NET (and many others).
According to this article, Perl.NET wraps the normal Perl interpreter (running as unmanaged code) and lets Perl code access the .NET runtime via special modules ("use perlNET") and special comments in the source code. I'm not saying that this is not useful, but it certainly doesn't make Perl a fully integrated .NET language like C# or VB.NET. (I haven't looked at the other languages you mentioned)
Jython, for example, has a better integration to the JVM (it's written in Java), and it does include a Python-to-Java bytecode compiler (though I don't know how well that one works).
But, managed code is a new addition to .NET that requires some adoptions in the programming languages.
The "some" depends. You should have a hard time integrating things like multiple inheritence, multiple dispatch, first-class functions or dynamic object systems (like Ruby's or CLOS's) into to the CLR as it stands today. AFAICS, you would either add these features yourself on top of the CLR (sacrificing a great deal of efficiency), or leave them out altogether, thereby making the language more similar to C# semantically.
I'm not stating that .NET isn't useful. I merely object to the claim that now that we have .NET, we can potentially use any programming language we want without significant problems. -
The best debugger ever
The best debugger I have ever used is Log4j. There is really no substitute for a good logging subsystem and grep. The chainsaw log viewer that is part of Log4j is also an excellent tool that can be used instead of grep.
I have also found that an interactive scripting language can be very handy. I use Jython for peeking into the state of Java objects and manually working with them. In my experience, this kind of manipulation can provide much better insight into the runtime behaviour of your code than an interactive debugger can. It can even be used to probe objects for which you do not have the code.
Of course, for non-Java development, there are usually analogs to these tools (syslog, perl, etc)
-
Re:worry about Sun patents, not MS patents
Python is a decent language. But it has a number of problems
Python is a great language. It has problems, but not those you mention.
It does not have a clear cross-platform GUI (Tkinter doesn't work on OS X, wxPython isn't a standard part of the platform binary distributions).
Those that actually care about client GUI libs can install their own. In this respect, Python is no different from C, and in fact, has more GUI bindings than C!
Many packages rely on native code in shared libraries.
And your point is...? That's like saying "many parts of my house rely on the shared frame".
Python byte code is orders of magnitude slower than Java or C# code.
For real-world tasks, Python execution speed is more than fast enough. When it's not, the bottlenecks can be easily identified and moved to C, or optimized away by the machine using Psyco. Using Psyco, my neural net code ran 5x faster. But the real thing you're missing here is this: developer time is more valuable than machine time, as machine time can be saved using other methods.
Python does not have optional static type checking.
And I thank God it does not! Static type checking solves a very narrow programming problem and requires a tremendous amount of coding for the developer.
It is hard to make standalone, self-contained applications out of it.
No, it's not hard to make stand-alone, or to embed it in other applications. There are multiple proven techniques to bundle the interpreter with a parts of the standard library and third-party code. That you don't know this makes me believe you don't really know python, either.
Python does not have a well-defined language standard, nor does it have multiple independent implementations.
Oh, my! The language definition is quite well-defined and very consistent. And there are two open-source implementations on separate platforms: python in C and python on Java
Python could be more of a contender if someone built a good native code compiler for it. None of the current attempts are very good or result in much speedup.
Psyco speeds up python by optimizing chunks of code at run time. The neat thing is that it does this against python code, so python becomes faster by more of it being written in python.
The way it is, Python is good for many scripting and prototyping applications. But for a general-purpose, high-quality programming language, we still have to look elsewhere.
NASA. ILM. Google. Please.
-
You mean Jython?How about somebody write a Python installer in Java? Let's get something genuinely useful out of this
Jythons 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.
-
Re:Definitely useful
ttfkam wrote:
Do it in a higher-level language first. Make sure your algorithms are clean and efficient. If and only if you see a performance or resource problem do you rework portions(!!!) in C. As a bonus, the higher level language acts as a code template for faster C development.
Amen.
Kragg wrote (in his reply to ttfkam):
Prototyping in a higher-level language (c# is easy, java everyone knows) is a superb idea, provided you
- can release the final product as interpreted, with slow execution speed
Most programs spend 90% of their CPU time executing 10% of their code. If that 10% is optimized in a low-level language such as C, a large-scale interpreted program can boast performance that's virtually indistinguishable from an equivalent program written entirely in a low-level langauge. However, there's likely to be a huge difference in programmer productivity.
As a reference, see this Dr. Dobbs article, which states:
""" ... 90 percent of the software's running time occurs in only 10 percent of the code. This is the whole basis for virtual memory: Potentially, a program can run at full speed with only 10 percent of itself--or whatever the working set is--loaded into memory at any given time. Unlike that nasty segment stuff, the programmer does not specify any of this in advance. The operating system "discovers" a program's working set on-the-fly, through page faults.
"""
- can afford the time to port all to C, in which case DO, this is an excellent way to make a watertight C program
Why port 90% of the application's code to a low-level and less productive programming language, when that 90% will inevitably evolve and require maintenance as the program is utilized in unforeseen ways? I've never written a large program that didn't end up having features added incrementally over a long period of time after the initial release.
- are happy to learn how to make managed code/vm code call to native and vice-versa (this is far from a trivial problem)
If it's "far from a trivial problem", you're using the wrong tool.
Take Python, for example: it's simple to interface between Python and C using Python's C API. Recently, a tool named Pyrex has appeared that makes it almost trivial. Pyrex is amazing.
Kragg suggested prototyping in C# or Java, but Python surpasses both of those as a prototyping tool. Python is higher-level than C# or Java (and thus better suited to prototyping and/or malleable fusion with C) because it features:
- dynamic typing ("dynamic", not "weak" like Perl)
- no obession with a particular programming paradigm; use procedural, functional, or OO as appropriate
- high-level data structures built into the language
- more convenient dynamic code loading
- interactive development at a "Python prompt" (the value of this cannot be overestimated)
- no separate compilation step in the edit-test-debug cycle
- more concise syntax
- excellent interface capabilities to C (or C++ via Boost.Python, or Java via Jython)
I suggest that the fusion of a truly high-level (higher than Java-level) language with C is far more broadly applicable than Kragg claims. -
my experienceUnfortunately, there really is no ideal solution.
I would not be scared of learning Objective-C--it is a very simple language and easy to learn, and its object model is very convenient. But in other ways, Cocoa using Objective-C is a somewhat outdated programming environment: the GUI design tools were great in the 1980's, but they are pretty dated by today's standards. And resource management in Objective-C and Cocoa is a lot more work and a lot more error prone than in Java or C++. On the plus side, Cocoa is what Apple really wants you to use, and that's where they seem to be putting a lot of their efforts.
Cocoa using Java is probably in a certain sense "the best" programming environment for the Mac: it's modern, easy to develop in, and mostly safe. It's also pretty well supported. But it retains many of the warts of the Cocoa APIs and, as you observed, is not all that well documented.
With either Cocoa-based solution, you also have to ask yourself whether you believe that Cocoa has a future and whether it's worth learning it. I don't see much of a future for Cocoa, at least in its current form. Apple has made no moves to standardize it or open it up, so it is Mac only. Even if Apple pushed for more widespread adoption, they'd have to make big changes to make it palatable to industry, like adding precise garbage collection and better error checking to Objective-C, with the resulting changes to the APIs. An example of work in that direction can be found here (yes, that is "gerbil.org", but it's a site about programming, really).
Swing Java is probably the least hassle: it's well documented, it works very well on Macintosh, and you still get the native look-and-feel. It has modern resource management and modern layout management. Knowing Swing is useful and helps you on other platforms as well. And its object system is fairly similar to that of Objective-C. But some of the more advanced features have been buggy in the past (e.g., audio input, etc.). You can, however, combine Swing and Cocoa APIs, using Swing for the GUI and dropping down into native APIs only when Sun's cross-platform APIs fail you.
If you use one of the Java-based solutions but find the Java type system too constraining, you can use Jython, a Java-based implementation of Python. You can choose to run it interactively or compiled. It's great for exploring the Cocoa APIs (or the Swing APIs).
Another choice you may want to consider is wxWindows. Recent versions run very well on MacOSX and look native. If you want to see an example of an application written in wxWindows, take a look at Audacity.
I tried all these different approaches, and I ended up doing most of my Mac programming in Java/Swing and wxWindows.
-
So dump JavaThere is an interesting article on zdnews about Sun betting the company on Java - if that is true, this might not be quite the way to do it. Getting bad press like this is only going to make more people to look around and notice that, for example, Python (or rather Jython, the variant of Python based on Java instead of C) is a powerful and free alternative for quite a number of applications.Once you start with alternatives like that, you might not want to come back to Sun.
It never ceases to amaze me how stupid large companies can be. What did they think, nobody would notice?
-
The coming "Age of Virtual Machines"
Traditionally, computer programming languages have competed against one another, but now we seem to be moving towards a world in which a programmer will be able to choose from a set of virtual machines (VM's) as well as from a set of programming languages. The Perl 6 VM (dubbed "Parrot?") can execute Java source-code (because Java source can be compiled into Perl 6 bytecode) as well as Perl source-code, and, indeed, almost any programming language can be compiled into Perl 6 bytecode. The same is roughly true of Java. Because the source-code of nearly any programming language can be compiled into Java bytecode, a JVM can execute code written in nearly any programming language provided that a compiler has been written to transform the source code into Java bytecode. Examples of such compilers include Jython (which compiles Python source-code into Java bytecode), NetRexx (which compiles Rexx into Java bytecode), and JRuby. And, of course, there is Microsoft's
.Net, which, IIRC, also contemplates (or at least permits?) the compilation of nearly any source-code into a bytecode specified by MS (of course, MS wants the bytecode's execution to take place on a MS O/S exclusively). Furthermore, there's no reason (that I can think of) that would prevent, say, Java or Perl from being compiled into Python bytecode and executed by a Python VM.There are many implications and consequences of giving software developers this degree of choice. In your opinion, what are the most significant of these consequences?
-
Re:More Python Please!
Oh, you can make J2EE sing and dance with Python, too, if you want.
You have heard of Jython (nee JPython), haven't you?
(And you can add new features to Java applications at run time too (ClassLoader? JavaBeans? hello?). But of course you knew that. :) -
Python & Java
The Python home site is the place to go for any information on the subject. Links and documentation galore. And you Java guys should check out Jython -- a wonderful way to write and work with Java.
-
Re:You are wrong.
Don't bring perl into a Java discussion or else I'll counter with Jython and then it'll all be over.
-
Re:Java != .NET
Java limited people to one language, a language that many coders didn't like.
Which language would that be, then? Would it be BASIC, or COBOL or ADA or Python or FORTH or PASCAL or C or PERL or FORTRAN or LISP or Scheme or Smalltalk or one of these?
In fact, surprise, surprise, there are over 200 different programming languages you can use to write Java VM programs in.
-
Re:A T*roll....
-
Re:Ruby is Swell but...
Ever given Jython a try?
-
Re:Mod parent up
-
Re:Advantages of C# over Java
Jython is an example of just this. Here is a quote from the Freshmeat page.
Jython is a Java implementation of the Python programming language. It allows users to compile Python source code to Java byte codes, and run the resulting bytecodes on any Java Virtual Machine. -
Wyvern
For those of you looking for a fun Online RPG, check out Wyvern. It's written in Python and Jython. I'm not sure if the engine code is open source, but the author funds the server himself and only asks for contributions if you can spare them. If you know Jython, you can become a wizard and write your own additions to the game (new maps, towns, monsters, items, etc.).
-
Re:CLR solves some common and obvious problemsI can write a Perl program that defines a CLR compliant
.Net framework class (blessed package). I can then inherit that class in a C# class. Or vice versa. You cannot do that with Java.Well, you might not be able to do that with Perl and Java today, but you can do it with Python and Java today -- check out Jython, the JVM implementation of Python.
Microsoft spent the effort (money) to implement Perl on CRL; anytime that someone wants to do the work to implement Perl on top of the JVM, you'll be able to do what you want. Given that Parrot development continues, you may yet get Perl for JVM courtesy of Jython and Python and Parrot.
-
Java lies
Microsoft lies through their teeth: Java was designed for use with a single programming language -- Java. Developers have no option to choose the best tool for the task and cannot use knowledge or code from other languages.
Jython, for instance, lets you run Python programs natively on any Java machine. I've also seen Java-targeted compilers for other languages, but I can't find a link at the moment. -
Talk about ugly and inconsistent ...
-
Python in a browser
JPython is a pretty complete version of Python in Java. So you don't even need a plugin to use Python on a Web page. But, you do have to wait foor the jpython jar file to download.
-
JythonWith Jython it is possible to make "Java" applets in Python. The first time you use a Jython applet, it downloads the Jython runtime which is slow. But it is much faster and more convenient than downloading a Java, Flash, Acrobat or ShockWave runtime, which many people do without complaint.
Standard Python could also be used in Mozilla through XPCOM but you would have to be careful from a security point of view. You could only really run trusted code.
-
JythonWith Jython it is possible to make "Java" applets in Python. The first time you use a Jython applet, it downloads the Jython runtime which is slow. But it is much faster and more convenient than downloading a Java, Flash, Acrobat or ShockWave runtime, which many people do without complaint.
Standard Python could also be used in Mozilla through XPCOM but you would have to be careful from a security point of view. You could only really run trusted code.
-
Jython (code in Python, run on a JVM)
If you like Python, you can code Java applets in Python syntax, using Java components. See Jython's SourceForge page. In particular, read Compiling Python Source to Real Java Classes
-
Re:Sandboxes...Yessiree. The important thing isn't the language, but portability & security. Implementing something equivalent to a jvm for your favorite language is decidedly not a trivial task.
That said, there are over 160 languages apart from java which can be compiled to java bytecode. Jython is quite robust & can be used to create java applets w/ python. There's also a perl->java byte codes compiler under development. (Though maybe it's been abandoned?
...) -
But grail *does* have python applets
The Grail browser has python applets and has had them for many years (almost as long as Java applets have been out there). It even has a sandbox (or so the web site says, haven't looked too deeply myself). Rather than downloading a bytecode, it just downloads source code (a fairly clean approach). Now Jython or maybe even Parrot someday might be better ways of running Python applets but the Grail one is interesting at least as a historical footnote.
Last time I tried Grail it wasn't really fast or reliable enough to be my main browser, but that was many versions ago.
-
Re:Other languages and bytecode?
The bytecode idea is a really good one, especially with the large (although shrinking) number of platforms you have to support these days, and the possible rise of VLIW processors on the horizon. I don't really like coding in Java all that much, though. Is anyone working on a compiler for another language that compiles to bytecode that will run on a JVM (rather than a internet-c or c# vm)?
Jython (Used to be JPython) does exactly that. Jython is a python intrepreter written in Java, that can compile your script into Java bytecode if you want. And, according to the preface of Programming Python, there's a company that's building yet another python compiler for the .NET framework.Not to meantion that python is OO, and being Free Software will probably overtake Java in a couple years anyway.
;=)