The Artima Developer Community
Sponsored Link

Artima Developer Spotlight Forum
invokedynamic on OpenJDK

22 replies on 2 pages. Most recent reply: Sep 12, 2008 1:55 PM by Raoul Duke

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 22 replies on 2 pages [ 1 2 | » ]
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

invokedynamic on OpenJDK Posted: Aug 28, 2008 8:15 PM
Reply to this message Reply
Advertisement

In an auspicious email to the openjdk mailing list, Sun's John Rose announced the first JVM with a functioning implementation of invokedynamic:

In a modified JVM, a test program with more than one invokedynamic call site successfully linked, bootstrapped, and ran with the dynamically linked target methods.

Rose shed more light on this achievement in a blog post:

In the wee hours of this morning, the JVM has for the first time processed a full bootstrap cycle for invokedynamic instructions, linking the constant pool entries, creating the reified call site object, finding and calling the per-class bootstrap method, linking the reified call site to a method handle, and then calling the linked call site 999 more times through the method handle, at full speed. The method names mentioned by the caller and the callee were different, though the signatures were the same. The linkage was done by random, hand-written Java code inside the bootstrap methdod...

The example code is included in the Email, and also posted (as a truly rebarbative test in a NetBeans project) with the patches. As for the JVM code, it only works on x86/32; the next step is to move the assembler code into the right files, and finish the support for x86/64 and SPARC.

invokedynamic is a JVM instruction aimed specifically at supporting dynamic languages, and it has been proposed and developed in JSR 292, Supporting Dynamically Typed Languages on the Java Platform.

Java SE spec lead Danny Coward describes the significance of support for invokedynamic:

For the last few years we've been on a path towards first class support for other languages on the JVM. No small feat this, since the Java Platform was originally designed with one language in mind. Now, we still believe that Java is the best language for robust, long lived code. But we know that developers like to mix in other languages that for special reasons: for particular applications, for particular styles of development. Just as important, we've spent 13 years creating an incredibly scalable and high performing runtime across a variety of operating systems. So for developers who create applications with other languages, we figure they would like to run those apps on the best runtime around... So, as a matter of fact, do the creators of the engines for other languages like Ruby, Python, Groovy, Scala - they started creating the engines to run on the Java Platform...

Many of the languages that are attracting the buzz that have been invented since the Java language have a feature in common with each other, but not with Java: they are dynamically rather than statically typed. So the types of the variables, method parameters, return variables and so on are not known at development time, unlike in Java where you are required to declare them. All very nice for rapid prototyping and a more informal style of programming, but a big problem for compiling it down to the Java bytecode because the Java bytecode needs that type information filled out. So engines for dynamic languages have to create artificial interfaces or classes just to do the form filling. Making them brittle, difficult to maintain and slower than they could be. But not if we modify the bytecode to remove the need to fill out all the type information.

In an earlier blog post on this subject, John Rose described this as the process of decoupling the JVM from a type system: Something that allows different type systems, or dynamic type systems, to plug into the JVM.

What do you think of the significance of adding invokedynamic to the JVM?


Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Aug 29, 2008 8:08 AM
Reply to this message Reply
A big step in prolonging the life of the JVM. It will be interesting to see how it plays out with respect to evolution of the Java language.

Will this give permission to slow down or abandon evolution of Java? If so, I hope that means more focus on Scala because I do not see dynamic languages filling the shoes of Java.

Alternatively, will this allow the core language team to focus on new features that some would like to see added to Java? For me, that would include fixing generics (erase erasure) and add BGGA closures, but there are several others.

I think what happens next will be a bellwether for the future of Java.

Leo Lipelis

Posts: 111
Nickname: aeoo
Registered: Apr, 2006

Re: invokedynamic on OpenJDK Posted: Aug 29, 2008 3:25 PM
Reply to this message Reply
> Will this give permission to slow down or abandon
> evolution of Java? If so, I hope that means more focus on
> Scala because I do not see dynamic languages filling the
> shoes of Java.

I agree. As much as I like dynamic languages, knowing the types you are dealing with has proven to be very, very useful.

In my opinion, the prevailing main argument that static typing produces more bug-free code than dynamic typing is wrong. I am convinced that dynamically typed code can be as bug-free as the statically typed code. But static types serve an important function of documenting the code. It's very nice to know exactly what the function expects without have to rely on proper documentation, which programmers often fail to write. And even if the docs are written, it's very easy for docs to fall behind and diverge from the code in meaning. So when we have to rely on the code itself for documentation, statically typed code is very helpful.

I had this problem in Python. I'd use some library, and I want to fulfill the API obligations, but because the documentation is not 100% unambiguous or even missing in places, I didn't know what kind of objects the API was expecting from me. This was a big problem. Python is great if you never have to use other people's code or if you only use superbly documented code, but in "real life" I am afraid that's not possible.

This the same reason why I also like Python's indent blocks -- the language forces all the careless programmers to indent properly, or else the code won't run. I like that. You never see ugly or incorrect indent in Python. Isn't that great?

What I would like is to take some unnecessary manual labor out of programming in statically typed languages. If the compiler can easily infer a type, it should do so, as long as the meaning is not ambiguous.

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 1, 2008 8:55 AM
Reply to this message Reply
> I am convinced that dynamically typed code can be
> as bug-free as the statically typed code.

I agree it "can be" but in practice...Also, the big issue I see is that dynamic language code will be very difficult to understand and maintain as it ages. Mutating a type, for example, especially in absence of type 'documentation' is likely to cause trouble.

> But static
> types serve an important function of documenting the code.

Dynamic typing and type inference are two different things. Most dynamic languages rely heavily on type inference. Scala supports type inference but also allows type declarations optionally so you can have the self-documenting code if you wish. A developer will have to use good judgment in determining when declarations are helpful.

> And even if the docs are
> written, it's very easy for docs to fall behind and
> diverge from the code in meaning. So when we have to rely
> on the code itself for documentation, statically typed
> code is very helpful.

Documentation never saved a language from its shortcomings.

> Python is
> great if you never have to use other people's code or if
> you only use superbly documented code, but in "real life"
> I am afraid that's not possible.

This is precisely the maintainability problem I suggest.

> What I would like is to take some unnecessary manual labor
> out of programming in statically typed languages. If the
> compiler can easily infer a type, it should do so, as long
> as the meaning is not ambiguous.

Two problems with Java that are addressed in Scala are its verboseness and its lack of useful type inference. Terseness is also auto-associated with dynamic languages but is, in fact, independent.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 9:29 AM
Reply to this message Reply
> Will this give permission to slow down or abandon
> evolution of Java? If so, I hope that means more focus on
> Scala because I do not see dynamic languages filling the
> shoes of Java.

I don't see Scala filling the shoes of Java either. This isn't to say that Scala isn't a good language. It's just doesn't address the needs of the kind of development shop that needs a language like Java. Scala has too many esoteric constructs and there is too much syntax. Some of Scala's features are directly harmful in the kind of shop where Java makes sense. To me, Scala is a language for shops where Java is woefully inadequate. A true replacement for Java would have a much more balanced power to readability to ratio.

I would judge any potential replacement to Java based first on how quickly the code can be understood with 100% confidence. On that measure, Scala fails miserably IMO.

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 9:48 AM
Reply to this message Reply
It's called Visual Basic. ;-)

Based on this argument, Java has already added too many 'esoteric' features and should stop. My take is esoteric features need to be safely ignored so the language can address the problems of average staffs, yet get the heavy lifting jobs done if needed. I don't think they are mutually exclusive and Java is my evidence. Although I am uncertain if it is accidental or intentional in Java's case.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 10:11 AM
Reply to this message Reply
> It's called Visual Basic. ;-)

VB is the opposite of what is needed. Hard to maintain without being very powerful. A loser on two counts.

> Based on this argument, Java has already added too many
> 'esoteric' features and should stop.

Based on that logic, VB also has too many esoteric features. It's a non sequitur.

Your conclusion doesn't follow from what I wrote but I actually believe that generics, as implemented in Java, do fall in to the 'too esoteric' category. I believe that Java should have stopped at 1.4 plus a few minor additions.

I think we need a replacement for Java but Scala isn't it.

> My take is esoteric
> features need to be safely ignored so the language can
> address the problems of average staffs, yet get the heavy
> lifting jobs done if needed.

Why do these need to be the same language? In a shop like where I work where there are many developers working on many different projects in many different locations but all sharing the same code base, trying to use a language like Scala would be a nightmare. We don't have time for developers to try to understand what a left fold means in the context of the production job that is failing. We also have no time to evaluate the entire language document which features can and cannot be used, argue about it, document these choices, make all the developers read and memorize them, and be code wardens.

> I don't think they are
> mutually exclusive and Java is my evidence. Although I am
> uncertain if it is accidental or intentional in Java's
> case.

Can you give me an example of these esoteric features of Java prior to 1.5 that backup this point?

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 10:26 AM
Reply to this message Reply
Prior to 1.5, there weren't any. I consider generics as an case in point which I guess you'd disagree. People can use it as a client and not have to worry about the complexity. Of course it is complicated by the fact Sun hosed the implementation (erasure).

We are in a similar situation where we have a staff using common code. We ease the complexity through frameworks so we don't have that problem.

We would to the same with Scala which is designed intentionally to support complexity hiding and DSL.

Our staff can adopt Scala but we've staffed that way. We don't do esoteric stuff: Overstock.com. We do have some difficult constraints though so we hire very talented people.

I don't think there is a good language for the problem you face. Java ain't it. I like Scala because it was designed with this problem in mind. We shall see.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 11:01 AM
Reply to this message Reply
> Prior to 1.5, there weren't any. I consider generics as an
> case in point which I guess you'd disagree. People can use
> it as a client and not have to worry about the complexity.
> Of course it is complicated by the fact Sun hosed the
> implementation (erasure).

I don't completely agree that clients can ignore the complexity of generics. It comes out and bites you in unexpected ways. That's really a different discussion but an example is how generics changes how the compiler binds methods calls.

> We are in a similar situation where we have a staff using
> common code. We ease the complexity through frameworks so
> we don't have that problem.

Which problem and how does the framework eliminate it?

> We would to the same with Scala

You are asserting that and I am denying it. 'Proof by repetition' won't work here.

> which is designed
> intentionally to support complexity hiding and DSL.

That's where Scala diverges from Java. Java is a very transparent language. It has one magical abstraction mechanism: single dispatch polymorphism. It's a feature that can be baffling at first but it's a very short list of things that need to be understood. Most all of the other features of Java follow from this one concept.

Coincidentally enough I saw this today which is a perfect example of why it's not effective to have developers writing in a language they don't fully understand:

http://www.artima.com/forums/flat.jsp?forum=282&thread=237361

This used to be the core design approach to Java. Features (up until 1.5) were not added just because they were potentially desirable but because they added undeniable benefits without changing the core principles of the language.

> Our staff can adopt Scala but we've staffed that way. We
> don't do esoteric stuff: Overstock.com. We do have some
> difficult constraints though so we hire very talented
> people.

It's not whether what you are doing is esoteric. That's completely beside the point. The issue at hand is whether the language supports constructs that are not well understood by the developers that are using it. My personal opinion is that few developers really understand Scala inside and out. Java, on the other hand (prior to 1.5) can be understood fully with relative ease.

Hiring more talented developers, IMO, actually exacerbates the issue I am concerned with. The more skilled the developer, the more they will want to use the more powerful features. In a language like Java, you can expect and demand that all developers understand the full gamut of features. I think that's a tall order in Scala. You will end up with many varied levels of understanding and that's where the trouble begins.

We face this with Java too. Sometimes I use constructs that other developers find confusing. But they are invariably able to figure it out for themselves. There's a cost to this but it's limited because there are only a few such constructs in Java. In Scala, you can have code that says one thing and does something completely different.

> I don't think there is a good language for the problem you
> face. Java ain't it.

What problem do you think I face? It seems to me that you are assuming that I am making arguments that I am not making.

> I like Scala because it was designed
> with this problem in mind. We shall see.

Which problem?

Again, my argument is not that Scala doesn't have a niche but that it's niche is not the same as Java's.

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 3:29 PM
Reply to this message Reply
Sorry, I'm in a meeting and half thinking in two worlds. Actually quarter thinking which adds up to my usual half thinking.

> > We are in a similar situation where we have a staff
> using
> > common code. We ease the complexity through frameworks
> so
> > we don't have that problem.
>
> Which problem and how does the framework eliminate it?

Hiding language complexity from our staff via a framework that simplifies/limits options, and enforces practice.

> > We would to the same with Scala
>
> You are asserting that and I am denying it. 'Proof by
> repetition' won't work here.

I'm not sure what you mean, but I meant to write "We would DO the same with Scala."

> > which is designed
> > intentionally to support complexity hiding and DSL.
>
> Coincidentally enough I saw this today which is a perfect
> example of why it's not effective to have developers
> writing in a language they don't fully understand:

I agree with the assertion. Unfortunately, most developers don't truly understand ANY language! I don't think this alone is a good reason not to adopt a language.

I get into these discussions all the time about how much language complexity an organization can absorb. It depends on the organization and on how they address that complexity.

> This used to be the core design approach to Java.
> Features (up until 1.5) were not added just because they
> y were potentially desirable but because they added
> undeniable benefits without changing the core principles
> of the language.

I don't think that's entirely accurate.

> > Our staff can adopt Scala but we've staffed that way.
> We
> > don't do esoteric stuff: Overstock.com. We do have some
> > difficult constraints though so we hire very talented
> > people.
>
> It's not whether what you are doing is esoteric. That's
> completely beside the point. The issue at hand is whether
> the language supports constructs that are not well
> understood by the developers that are using it. My
> personal opinion is that few developers really understand
> Scala inside and out. Java, on the other hand (prior to
> 1.5) can be understood fully with relative ease.

No one understood Java when it first came out and many flayed it then. Scala is new and has some different (but not new) ideas. People will get comfortable with it soon enough.

After interviewing 100s of developers, I can say with certainty many so-called senior developers do not understand 1.4.

> Hiring more talented developers, IMO, actually exacerbates
> the issue I am concerned with. The more skilled the
> developer, the more they will want to use the more
> powerful features. In a language like Java, you can
> expect and demand that all developers understand the full
> gamut of features. I think that's a tall order in Scala.
> You will end up with many varied levels of understanding
> g and that's where the trouble begins.

So hire dumb developers so they don't use smart features to solve problems. Makes perfect sense. And make sure the languages stay dumbed down so the dumbed down development staffs don't get themselves in trouble. Got it.

>
> We face this with Java too. Sometimes I use constructs
> that other developers find confusing. But they are
> invariably able to figure it out for themselves. There's
> a cost to this but it's limited because there are only a
> few such constructs in Java. In Scala, you can have code
> that says one thing and does something completely
> different.

Can you give an example?

> > I don't think there is a good language for the problem
> you
> > face. Java ain't it.
>
> What problem do you think I face? It seems to me that you
> are assuming that I am making arguments that I am not
> making.

Hell, I don't know :-)
I thought you were arguing that Post 1.5 was too complex for your staff and so Scala would be even worse.

> > I like Scala because it was designed
> > with this problem in mind. We shall see.

Creating libraries that hide complexity and aid in creating DSLs.

> Which problem?
>
> Again, my argument is not that Scala doesn't have a niche
> but that it's niche is not the same as Java's.

We disagree on that point. That's ok.

I see three main camps for the future of Java. Leave it alone because it's complex enough, it's already too complex, or it is lacking important features. I fall in the last camp.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: invokedynamic on OpenJDK Posted: Sep 2, 2008 7:39 PM
Reply to this message Reply
> Sorry, I'm in a meeting and half thinking in two worlds.
> Actually quarter thinking which adds up to my usual half
> thinking.
>
> > > We are in a similar situation where we have a staff
> > using
> > > common code. We ease the complexity through
> frameworks
> > so
> > > we don't have that problem.
> >
> > Which problem and how does the framework eliminate it?
>
> Hiding language complexity from our staff via a framework
> that simplifies/limits options, and enforces practice.

Maybe you mean something different than what I read from this but 'hiding complexity', to me, is demeaning to your developers. Abstraction to me is about dividing up a problem into manageable bits. 'Hiding' reminds me of my PowerBuilder maintenance nightmares from long ago. I think the developers must be able to move up and down the abstractions freely. Nothing should be hidden.

> I'm not sure what you mean, but I meant to write "We would
> DO the same with Scala."

I forget what I meant there. I apologize. I think the gist will come out elsewhere.

<snipped for cleanliness>

> I agree with the assertion. Unfortunately, most developers
> don't truly understand ANY language! I don't think this
> alone is a good reason not to adopt a language.
>
> I get into these discussions all the time about how much
> language complexity an organization can absorb. It depends
> on the organization and on how they address that
> complexity.

I'd be interested in your approach to addressing the complexity of Scala. I thought your talk at Java One was one of the best I attended (I attended too many) so I mean this sincerely.

> > This used to be the core design approach to Java.
> > Features (up until 1.5) were not added just because
> they
> > y were potentially desirable but because they added
> > undeniable benefits without changing the core
> principles
> > of the language.
>
> I don't think that's entirely accurate.

I could be wishful thinking on my part but I still believe this is the way it should be.

<more snips>

> No one understood Java when it first came out and many
> flayed it then. Scala is new and has some different (but
> not new) ideas. People will get comfortable with it soon
> enough.

I have doubts about this. I was really excited about Scala for a while but after being on the mailing list for years while, I feel that it's lost direction. It's being steered by the interests of people with too much brains but not enough sense.

> After interviewing 100s of developers, I can say with
> certainty many so-called senior developers do not
> understand 1.4.

No question. But I think that 'real' developers will have little trouble with it. My personal experience with developers that don't really understand they tools they are using comes from my work with COBOL developers. Most COBOL developers will tell you that COBOL is simple but can't explain how it works. That makes me uncomfortable to the extreme.

> So hire dumb developers so they don't use smart features
> to solve problems. Makes perfect sense. And make sure the
> languages stay dumbed down so the dumbed down development
> staffs don't get themselves in trouble. Got it.

This is what I figured you think I am arguing but it isn't. Java isn't the most complicated language. It's not the simplest language either. I think it's about the level that anyone with a little motivation and skills in logic can get within a few years. My personal opinion for why most 'senior' developers don't understand Java is too much reliance on frameworks. They are a crutch. Every developer I've mentored with a framework background has figured out Java in no time once they were asked to actually do real Java programming.

To me your argument sounds like it is for classes (or castes) of developers. I think that's bad policy.

> Can you give an example?

Implicit conversions, especially global implicit conversions.

> Hell, I don't know :-)
> I thought you were arguing that Post 1.5 was too complex
> for your staff and so Scala would be even worse.

No, I think 1.5 takes too much focus off of what I like to call "getting shit done" and puts it what I call "circle jerks". The features are not efficient for a large team. There's too much friction. When there's only one way to do things, there's no arguments about whether you are doing it the right way. Of course there's always more than one way, but limiting the possibilities creates less of a drag on the team.

> > Again, my argument is not that Scala doesn't have a
> niche
> > but that it's niche is not the same as Java's.
>
> We disagree on that point. That's ok.
>
> I see three main camps for the future of Java. Leave it
> alone because it's complex enough, it's already too
> complex, or it is lacking important features. I fall in
> the last camp.

I think it's possible to create a new language that's more powerful than Java and less complex. That's what I'd like to see and Scala ain't it.

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 3, 2008 8:59 AM
Reply to this message Reply
> > Hiding language complexity from our staff via a
> framework
> > that simplifies/limits options, and enforces practice.
>
> Maybe you mean something different than what I read from
> this but 'hiding complexity', to me, is demeaning to your
> developers. Abstraction to me is about dividing up a
> problem into manageable bits. 'Hiding' reminds me of my
> PowerBuilder maintenance nightmares from long ago. I
> think the developers must be able to move up and down the
> abstractions freely. Nothing should be hidden.

We get many benefits from our frameworks. Abstraction which helps hide complexity, reuse of common code, enforcement (or maybe encouragement is better) of practice, and quality in the sense that much of the very tricky code is abstracted within the framework.

AFAIK, there's no way to prevent people from not using a language feature, and we don't prevent anyone from doing so. Therefore, I see nothing demeaning about it. In fact, our staff is entirely mid- and senior level developers. We expect them to be able to use generic classes (although not necessarily write them), we expect them to be clients of most all Java features.

Using features like generics is a much lower bar than creating generic classes. We find it is a good balance and since JEE-style environments have the same expectations, I don't see this expectation as a stretch.

To help keep people on track, we provide quality JavaDoc, Wikis, mentoring, etc. Our staff is about 60 developers.


> I'd be interested in your approach to addressing the
> complexity of Scala. I thought your talk at Java One was
> one of the best I attended (I attended too many) so I mean
> this sincerely.

Like with Java, an organization can choose to proliferate or limit the use of language features. We don't discourage people using difficult features but we provide easier alternatives. In Java, most organizations can easily avoid the difficult parts if they choose.

Our model, which is not revolutionary by any means, is to have a small team (we call it Architecture) that tackles the tricky stuff and provides it for the staff. They also provide consulting when the teams need to do something tricky themselves. Provides a great learning opp.

The first thing about Scala is you have all the benefit of Java in the sense that you get to use all the libraries and you can create your own.

Additionally, you have ways to extend to language easily to create internal DSLs that seem as though they are part of the language. This, in our organization, would be build primarily by the Architecture team.

As before, being a client of code that was built using "complex" features is much more approachable than writing the code that uses those features. There's nothing in Scala that would prevent us from utilizing this approach that has been successful with Java.

In a different direction, I think that many who declare Scala complex are really misinterpreting "different" as "complex." Most mainstream programmers haven't been exposed to functional programming. The same was true when C++ was introduced; few people had been exposed to OO and it was considered complex but was actually simpler but different. Hell, C++ IS complex but not because of OO.

Some think that the inclusion of operator overloading and multiple inheritance Scala is a bad idea and point to experience with C++. Those features were problematic in the C++ implementation but not nearly as much in Scala.

So I think 1) our team already has the tools to deal with complexity, 2) Scala actually will help us more than Java has, and 3) I think the complexity issue isn't as big as people fear. People just are fearful of change.

> I have doubts about this. I was really excited about
> Scala for a while but after being on the mailing list for
> years while, I feel that it's lost direction. It's being
> steered by the interests of people with too much brains
> but not enough sense.

I think people forget how long C++ and Java took to mature. The champions were perceived as brainiacs but the languages became mainstream quite quickly.

At JavaOne there was quite a bit of uptake on Scala. I think it is far from stagnant. I think developers have gotten hooked on measuring viability according to hype. Scala hasn't been hyped. My initial reaction to hype is usually an allergic response.

> > After interviewing 100s of developers, I can say with
> > certainty many so-called senior developers do not
> > understand 1.4.
>
> No question. But I think that 'real' developers will have
> little trouble with it. My personal experience with
> developers that don't really understand they tools they
> are using comes from my work with COBOL developers. Most
> COBOL developers will tell you that COBOL is simple but
> can't explain how it works. That makes me uncomfortable
> to the extreme.

"Real Developers" have no trouble with 1.5 either. I don't think there is anything simple about COBOL ;-)

> > So hire dumb developers so they don't use smart
> features
> > to solve problems. Makes perfect sense. And make sure
> the
> > languages stay dumbed down so the dumbed down
> development
> > staffs don't get themselves in trouble. Got it.
>
> This is what I figured you think I am arguing but it
> isn't. Java isn't the most complicated language. It's
> not the simplest language either. I think it's about the
> level that anyone with a little motivation and skills in
> logic can get within a few years. My personal opinion for
> why most 'senior' developers don't understand Java is too
> much reliance on frameworks. They are a crutch. Every
> developer I've mentored with a framework background has
> figured out Java in no time once they were asked to
> actually do real Java programming.

I agree that certain frameworks have led to the dumbing down of the development community. They don't need to understand the language, just a few constructs and annotations. I refer to them as "Bean Programmers." Very dangerous folk if you have hard problems to solve. We hire people that have a good understanding of the language first.

Here's my view: Frameworks (IDEs, etc) are power tools. In the hands of a craftsman, great things can be built. In the hands of a neophyte, someone is going to get hurt.

> To me your argument sounds like it is for classes (or
> castes) of developers. I think that's bad policy.

Not in our environment. Hopefully I've made that clear. But, I do believe the marketplace HAS created classes of programmers.

> > Can you give an example?

> Implicit conversions, especially global implicit
> conversions.

Take them or leave them. You can be explicit in Scala. Fortunately, unlike other languages, the IDE can help here. IDE support is very important.


> No, I think 1.5 takes too much focus off of what I like to
> call "getting shit done" and puts it what I call "circle
> jerks". The features are not efficient for a large team.
> There's too much friction. When there's only one way to
> o do things, there's no arguments about whether you are
> doing it the right way. Of course there's always more
> than one way, but limiting the possibilities creates less
> of a drag on the team.

We gain great productivity (and maintainability) thanks to features like generics. It's an organizational issue, not a language issue. Understand what the team can tolerate and arrange to avoid anything beyond that. I've described what we do in that regard.

> I think it's possible to create a new language that's more
> powerful than Java and less complex. That's what I'd like
> to see and Scala ain't it.

I'm waiting for that language too! In the meantime, our company needs something more powerful than Java 1.6. The blowing wind seems to indicate generics might not get fixed (erasing erasure), BGGA won't be included, and instead more crap will be stuffed in. I harken to the inclusion of XML, CORBA, JAXB, etc, into the JVM rather than leaving them as extensions. These sorts of 'enhancements' have truly undermined productivity for us as we try to work around them.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: invokedynamic on OpenJDK Posted: Sep 3, 2008 11:06 AM
Reply to this message Reply
> AFAIK, there's no way to prevent people from not using a
> language feature, and we don't prevent anyone from doing
> so. Therefore, I see nothing demeaning about it. In fact,
> our staff is entirely mid- and senior level developers. We
> expect them to be able to use generic classes (although
> not necessarily write them), we expect them to be clients
> of most all Java features.

There are ways to prevent people from using language features and none of them are efficient or worthwhile, IMO. I'd much rather just use a language that doesn't include undesirable features. Sometimes 'undesirable' means that the feature is merely a redundant way of accomplishing something with no significant benefits over the other ways to do the same thing. For example Java has an undesirable syntax for array creation:

String array[];


This provides no value and when used it makes the code harder to read than the more commonly used syntax. Java would be better without this syntax.

Java's syntax up until 1.5 was relatively limited compared to it's competitors at the time. Out of a huge array of features available in C++ and other languages, it distilled out a set that could solve most any problem. This drove a lot of C++ developers crazy. The idea that you could only pass by value seemed like a huge step backwards. But in my opinion, it was the right decision. It was a language that made it easier to manage large groups of developers. There's definitely a cost to not having some of those features but the gain is that the expertise required for understanding Java code is much lower. I can't count the number of times I've been debugging undocumented and uncommented code and been thankful that the sadists that wrote it had less options for abusing me.

> Using features like generics is a much lower bar than
> creating generic classes. We find it is a good balance and
> since JEE-style environments have the same expectations, I
> don't see this expectation as a stretch.
>
> To help keep people on track, we provide quality JavaDoc,
> Wikis, mentoring, etc. Our staff is about 60 developers.

But if you say you won't require people write generic classes, you essentially require that no one use generic interfaces as parameters.

> Like with Java, an organization can choose to proliferate
> or limit the use of language features. We don't discourage
> people using difficult features but we provide easier
> alternatives. In Java, most organizations can easily avoid
> the difficult parts if they choose.

Like I said above, I think this is a really bad way to go. It's time consuming and problematic.

> Our model, which is not revolutionary by any means, is to
> have a small team (we call it Architecture) that tackles
> the tricky stuff and provides it for the staff. They also
> provide consulting when the teams need to do something
> tricky themselves. Provides a great learning opp.

Where do developers for the Architecture team come from? If you leave the rest of the developers to do only the non-tricky parts, how will they gain the experience required to do tricky things? How do you deal with the morale problems caused by being placed on the 'dumb' teams? How do you keep the Architecture team from losing touch with the challenges of the mere mortal developers?

My experience with this kind of team structure is that the architects crap all over the other teams while thinking that they are so wonderful while everyone else thinks they are a bunch of arrogant pricks who can't solve real problems.

> As before, being a client of code that was built using
> "complex" features is much more approachable than writing
> the code that uses those features. There's nothing in
> Scala that would prevent us from utilizing this approach
> that has been successful with Java.

I don't consider that approach successful. It's the root of most Java programming issues I deal with: not using the language effectively.

> In a different direction, I think that many who declare
> Scala complex are really misinterpreting "different" as
> "complex." Most mainstream programmers haven't been
> exposed to functional programming. The same was true when
> C++ was introduced; few people had been exposed to OO and
> it was considered complex but was actually simpler but
> different. Hell, C++ IS complex but not because of OO.

I say Scala is complex because it's complex. Complexity can be evaluated by the number of distinct atomic rules required to describe something. In some ways Scala is less complex than Java. For example, the elimination of the distinction between primitives and objects in Scala reduces complexity. But overall, Scala's includes most features of Java and adds many more than it removes.

I think that Scala has a very non-complex core but this seems to be reserved for high-priests only. I've not seen any widely accessible documentation for this. Perhaps Programming in Scala does. I've been meaning to get it.

> Some think that the inclusion of operator overloading and
> multiple inheritance Scala is a bad idea and point to
> experience with C++. Those features were problematic in
> the C++ implementation but not nearly as much in Scala.
>
> So I think 1) our team already has the tools to deal with
> complexity, 2) Scala actually will help us more than Java
> has, and 3) I think the complexity issue isn't as big as
> people fear. People just are fearful of change.

Maybe Scala's perfect for your team. I just think that if it is, your team is atypical. Most large development teams deal with a lot of turnover and consultants/contractors with questionable skills floating through the codebase.

> I think people forget how long C++ and Java took to
> mature. The champions were perceived as brainiacs but the
> languages became mainstream quite quickly.

I don't mean that. I mean there are a lot of people trying to turn Scala into their favorite functional language. They don't seem to get that Scala is an OO language that act's as a bridge to the functional world not a pure functional language.

> At JavaOne there was quite a bit of uptake on Scala. I
> think it is far from stagnant. I think developers have
> gotten hooked on measuring viability according to hype.
> Scala hasn't been hyped. My initial reaction to hype is
> usually an allergic response.

Whether it's over-hyped or not is pretty irrelevant. It doesn't really tell you anything about whether it's a good choice aside from perhaps avoiding being all alone in using it.

> "Real Developers" have no trouble with 1.5 either.

My experience is that most developers that think they understand Java generics are just unaware of what they don't know about it. I expect a rash unstable APIs in the near future based on the simple fact that most 1.5 developers cannot explain adequately why Map.get() takes Object and not K.

> I don't think there is anything simple about COBOL ;-)

It's simple to use as a client, as you say. The vendors provide anything you can want. Highly analogous to your Architecture team delivering their APIs to the unwashed masses.

> I agree that certain frameworks have led to the dumbing
> down of the development community. They don't need to
> understand the language, just a few constructs and
> annotations. I refer to them as "Bean Programmers." Very
> dangerous folk if you have hard problems to solve. We hire
> people that have a good understanding of the language
> first.

I like to hire smart people that understand how to solve problems and understand programming first. Which languages they know is a secondary question. I can teach Java. I can't teach people to think.

Have you considered how you will find experienced Scala developers to replace people who leave? I think it will take a lot longer to produce an expert Scala developer than an expert Java developer and you will likely have to absorb the cost of that training.

> Here's my view: Frameworks (IDEs, etc) are power tools. In
> the hands of a craftsman, great things can be built. In
> the hands of a neophyte, someone is going to get hurt.
>
> > To me your argument sounds like it is for classes (or
> > castes) of developers. I think that's bad policy.
>
> Not in our environment. Hopefully I've made that clear.
> But, I do believe the marketplace HAS created classes of
> programmers.

You've made it clear that you do. You have the 'Architects' and the 'others'.

> Take them or leave them. You can be explicit in Scala.
> Fortunately, unlike other languages, the IDE can help
> here. IDE support is very important.

Like I said above and in previous posts, I don't want to play feature cop. It's not worth it. I also don't want any implicit conversions in my code.

> I'm waiting for that language too! In the meantime, our
> company needs something more powerful than Java 1.6. The
> blowing wind seems to indicate generics might not get
> fixed (erasing erasure), BGGA won't be included, and
> instead more crap will be stuffed in. I harken to the
> inclusion of XML, CORBA, JAXB, etc, into the JVM rather
> than leaving them as extensions. These sorts of
> 'enhancements' have truly undermined productivity for us
> as we try to work around them.

If you want power, Scala is a great choice. What I have a problem with is trying to call Scala the next Java. I don't see how you can compare a language that eliminated a lot of features to one that adds exotic (to most developers) features. Java was a purge, Scala is something very different. My concern with Scala is not that it's powerful but that it's power is not measured. It's all engine, no brakes.

Sean Landis

Posts: 129
Nickname: seanl
Registered: Mar, 2002

Re: invokedynamic on OpenJDK Posted: Sep 3, 2008 5:31 PM
Reply to this message Reply
> But if you say you won't require people write generic
> classes, you essentially require that no one use generic
> interfaces as parameters.

I don't see that.

> Like I said above, I think this is a really bad way to go.
> It's time consuming and problematic.

We have found that our approach is neither.

> Where do developers for the Architecture team come from?

Internal and external.

> If you leave the rest of the developers to do only the
> e non-tricky parts, how will they gain the experience
> required to do tricky things?

I don't think you read carefully. I never said we prohibit people doing tricky things. I also said our architecture team mentors and consults to help expand the capability of our staff.

> How do you deal with the
> morale problems caused by being placed on the 'dumb'
> teams?

We have no dumb teams and our problems are quite hard. Our morale is quite high as is our retention.

> How do you keep the Architecture team from losing
> touch with the challenges of the mere mortal developers?

Our architecture team is very hands on. You seem to have a preconception associated with the title "architect." Our Architecture team is not your typical. They are our best developers with the deepest language knowledge. They don't do paper architecture or ivory tower architecture. The teams like to run their questions past them because of the value they provide. Staying in touch is not a problem. They are the most interactive people in the organization.

> My experience with this kind of team structure is that the
> architects crap all over the other teams while thinking
> that they are so wonderful while everyone else thinks they
> are a bunch of arrogant pricks who can't solve real
> problems.

I know the stereotype you are referring to. That's not what we do.

> > As before, being a client of code that was built using
> > "complex" features is much more approachable than
> writing
> > the code that uses those features. There's nothing in
> > Scala that would prevent us from utilizing this
> approach
> > that has been successful with Java.
>
> I don't consider that approach successful. It's the root
> of most Java programming issues I deal with: not using the
> language effectively.

Well, I can only say "It works for us." I think the nature of our architecture team is very important to the success, as is the nature of our staff. Without these pieces working together, this approach would probably fail. The nature of our staff is not an accident.

> I say Scala is complex because it's complex.

A tautology?

> Complexity
> can be evaluated by the number of distinct atomic rules
> required to describe something.

Do you have those counts for Java and Scala?

> In some ways Scala is
> less complex than Java. For example, the elimination of
> the distinction between primitives and objects in Scala
> reduces complexity. But overall, Scala's includes most
> features of Java and adds many more than it removes.

I think one of the interesting things about Scala is how the pieces work naturally together. That seems to reduce some of the complexity. Whereas, some additions to Java feel like additions in the sense of adding a carport to a luxury home.

> Maybe Scala's perfect for your team. I just think that if
> it is, your team is atypical. Most large development
> teams deal with a lot of turnover and
> consultants/contractors with questionable skills floating
> through the codebase.

Our team is definitely atypical by design. We would fail otherwise. We have very low turnover - by design, we avoid contractors - by design.

> They don't seem to get that Scala is an OO
> language that act's as a bridge to the functional world
> not a pure functional language.

I do. The original research money was for exploring the hypothesis that OO and FP were a natural fit together.

> > At JavaOne there was quite a bit of uptake on Scala. I
> > think it is far from stagnant. I think developers have
> > gotten hooked on measuring viability according to hype.
> > Scala hasn't been hyped. My initial reaction to hype is
> > usually an allergic response.
>
> Whether it's over-hyped or not is pretty irrelevant. It
> doesn't really tell you anything about whether it's a good
> choice aside from perhaps avoiding being all alone in
> using it.

You were saying you hadn't heard much recently. I was responding to that. I've heard a lot but not the kind of hype associated with other technology road kills.

> I like to hire smart people that understand how to solve
> problems and understand programming first. Which
> languages they know is a secondary question. I can teach
> Java. I can't teach people to think.

Everything we are able to do starts with hiring great people. We do, however, hire strong Java developers rather than train them in-house. Even with that, there's still plenty to learn for these folk and we do that in a variety of ways.

> Have you considered how you will find experienced Scala
> developers to replace people who leave? I think it will
> take a lot longer to produce an expert Scala developer
> than an expert Java developer and you will likely have to
> absorb the cost of that training.

Yes, we are looking at least a year out before we contemplate moving to Scala. I think somewhere way back I mentioned that when/if we move is contingent on what happens with Java 7.

We are a very capable organization and if we needed to develop Scala training, we could easily do that. We have already started leveraging a lot of free or piggybacked opportunities. We sent 10 to JavaOne and most went to the Scala presentations. Several went to the Scala 'unconference' afterwards. We have talks and a regular program at our Java User Group for Scala. Several on our staff are getting up to speed on their own. By the time we have to make a decision, we will have a critical mass.

> You've made it clear that you do. You have the
> 'Architects' and the 'others'.

I definitely sense a prejudice toward the title 'architect.'

> Like I said above and in previous posts, I don't want to
> play feature cop. It's not worth it. I also don't want
> any implicit conversions in my code.

Then don't do it. Java lets you. What's your position on using them in Java?

> If you want power, Scala is a great choice. What I have a
> problem with is trying to call Scala the next Java. I
> don't see how you can compare a language that eliminated a
> lot of features to one that adds exotic (to most
> developers) features. Java was a purge, Scala is
> something very different. My concern with Scala is not
> that it's powerful but that it's power is not measured.
> It's all engine, no brakes.

We'll see. I don't see any other options out there as the next Java. Maybe we are still a decade away. The forces that drive these things are very unpredictable and capricious.

Raoul Duke

Posts: 127
Nickname: raoulduke
Registered: Apr, 2006

Re: invokedynamic on OpenJDK Posted: Sep 3, 2008 6:33 PM
Reply to this message Reply
(uh, gosh, you 2 want to actually talk about invoke dynamic *at all*? :-) :-)

re: scala - how about http://www.google.com/search?q=guidewire+gscript as a viable alternative, meant to be less complex? i don't work there and i've never used it, but i would like to get to take it for a spin some day.

Flat View: This topic has 22 replies on 2 pages [ 1  2 | » ]
Topic: Service Locator Pattern Revisited, Part 1 Previous Topic   Next Topic Topic: Defining

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use