Dynamic Java (Dynamic Java)

xiaoxiao2021-03-06  36

Dynamic java (translation) (very scribbled)

"Dynamic Java" http://www.tbray.org/ongoing/when/200x/2004/12/08/Dynamicjava#p-4

Tim Bray, Sun's XML Evangelist, Recently Hosted A "Summit" to Discuss WHETER AND HOW JAVA MUGHT Provide Better Support for Dynamic Languages

Quite clear, in the software development world, dynamic language (Dynamic Languages) is a hot spot, perhaps the hottest hotspot. We need to do more work, making people who are in a Java environment (EcoSystem, ecosystem). So we held a high-end meeting in Sun on SUN, some people in our internal Java leaders, while Larry Wall and Dan Sugalski (Perl and Parrot), Guido Van Rossum, Samuele Pedroni, and Sean McGrath. Python, and James Strachan (Groovy). This is our educated day; there are some Take-Aways and pictures below.

Start now

We have quite agree with dynamic languages ​​in JavaVerse. This is Sean McGratH written by Jython, Write-Up, And Over At O'Reilly Marc Hedlund Has A Nice Little Demo of Building An RSS AGGREGATOR IN GROOVY. Gotta love this:

Class item {title; contents; string toString () {returnit;}}

However, Jython and Groovy (there are additional languages, others) are in almost no SUN's help or encouragement, we are likely to make it easier for their development activities (Implementors' Lives).

Java has a PR problem (public relationship, public service?), While Microsoft is positioned in a multilingual platform at the beginning. In fact, Java is a three-legged stool (language, JVM, and class library), all of which are written under "Java" (Gets Lost Under The Envelopeing Carpet of the One-Word Name "Java".). To some extent, this is the mist of Sun. In the early years, Java missionaries generally retain this prejudice, writing code from the language other than Java, is two other citizens. Really stupid. Java is a good language. I often like to use Perl and Python to do things, and many developers are like this.

High-end meeting

Even if Sun does not agree with additional languages ​​on the Java platform, they still appear in any case. I agree, when I ran to Sun, I found that everyone I asked is also agreed. So, I asked Graham Hamilton - he had been in the heart of the Java world, introduced a room of dynamic language experts to help us conclude how to create Java into better homes, and he thinks it is a good idea. He affirmed, and pointed out that we just stepped on the 1.5 "Tiger" version is also in the next step in the early stage of the preparation stage, it is time to do this. So I went to find our head of SOFTWARE CTO Office, Juan Carlos Soto, and he also believed this is a good idea and agrees.

actor actress

Java team, we have graham hamilton - a VP and Sun Fellow and are the main J2SE architects; Gilad Bracha - handle Java language and JVM specification; Martin Buchholz - Senior Java maintainer (once the maintenance of Xemacs) .

In Perl, we have Larry Wall - he is busy defining Perl 6; Dan Sugalski - writes Parrot (new Perl VM).

In the Python camp, there is Guido Van Rossum, Samuele Pedroni, today's Jython leader; and Sean McGrath - his company Propylon hired a small group of programmers to write Jython applications for customers who truly payment.

The representative of Groovy is its leader James Strachan..

They gave us a very small conference room, which is very crowded. I have never claimed that I am the best programmer in the world, but I rarely encounter this situation: with a group of people to discuss software issues and their starting point exceeds my understanding (The Start Going Right over My Head ). Hey, this kind of thing has taken several times, even when I ask me to record the discussion content, there is a problem. To a touch of flavor, here is part of the theme to be discussed in advance: Anonymous Code / Closures, Lvalue Methods / Functions, Variadic Call / Return,

constant / rw / copy / ref / lazy parameters, wrappers / AOP, eval, exception handling / undef / nil / unthrown exceptions, exception handlers with lexical access, temporization / hypotheticality, efficient regex with complete semantics, access to dynamic context / want / Caller, Redispatch of Methods (Fallback Upon "Fail"), Effectient Switch Statement ?, Versioned Modules / Classes, Virtual ClassNames, ContiNuations. (I don't know how to deal with these 咚咚, yqj2065) Topic: Dynamic Dispatch

When you call another Java method from a Java method, its language is far more subtle and complex than what you imagined. Of course, all these things are handled by compilers and JVM and it (refers to java-to-java method Dispatch. ?) It is also very efficient. And call - from Groovy to Jython to Java, then complicated, the Groovy and Jython programmers must write a ton of code to determine: call the method, all parameters in sequential Get to cause method calls. Regardless of Java or a dynamic language, the transmission is tricky, especially when the dynamic language is outside the Java class, design some meta-classes. (Orim: IT's tricky dispatch Both TO Java and to a Dynamic Language, especially Since The Dynamic Languages ​​TEND To Keep Meta-Classes Around for the Java Classes.) All of these are low efficiency. Perhaps it is worth adding some byte codes to the JVM to help at least part of such juggling and household management, especially considering that the cost of adding some byte codes does not seem to be too expensive.

IF this idea holds up after a bit More thought there'd Have to Be a JSR So The Whole Community Can Kick IT Around, But it looks plausible. Topic: Bytecode Generation During this time, many people are producing Bytecode - not just Jython and Groovy, as well as the AOP tools and XPath / XSLT tools and additional things. They all do this, do not rely on abstract help (do you mean that you don't have to use your brain?), This (production of bytes) is tough and confusing, they seem to be a big thing .

If there is a high-level (high-level, higher-level) - just like a AST level, let people produce bytecode, many people feel super convenient, you can be some common language (such as Switch, Cycle, etc.) automatically generate a bytecode. But it is more difficult than you think, because some things are semantically, even if you assign a variable, you will become very complicated in dynamic languages.

It seems that Janino is interested in this area, and some of the work in Kawa seems to be multiplexed, and there is a thing called Codedom in .Net-Land, it is clear, it is also busy with similar problems. So, perhaps the right way is to engage in java.net project, build a shared infrastructure in this area.

O 录 (odds & ends) we have long, fierce and interesting debate on Closures, Continuations, And Tail Recursion. Increasing the bytecode to support these things should be reasonable ideas (although the cluster can be very expensive), the problem is: How much help in this implementation of the dynamic language, for example, Jython's Implementation of Python Generators work very well. There is no other mob as a noisy, only Dan Sugalski shows us some good examples (Scenarios), which is indeed contributing to some natural and useful algorithms. Outlook (Going Forward) There were a couple of action items to report back on this or that, but the take-aways were pretty clear For my money, the important thing about the meeting was bridge-building;. The dynamic-language guys now Know Who To Shout At in Javaland, and the Java Guys Know Who in Dynamic-Language Land To Pester About What Works and what doesn't.

And i confidently precict That as time goes by, more and more of the code write......................................................................................................................................................................

转载请注明原文地址:https://www.9cbs.com/read-69145.html

New Post(0)