Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While I'm really glad to see Java (the language) slowly evolving in a positive direction, and it might bring me some joy at work if/when we switch to 7, I can't imagine starting new projects in Java anymore if I had my way. Once you've been exposed to the much nicer languages thriving on the JVM now, it's hard to get excited about Java anymore.

I mean, I can't see this sort of thing as being very enjoyable to write all the time.

  JComboBox combo = new JComboBox();
 
  MethodHandle handle = MethodHandles.lookup().findVirtual(JComboBox.class, "setModel", MethodType.make(void.class, ComboBoxModel.class));
 
  handle.invoke(combo, new CustomComboModel());


I think these dynamic features are actually intended for alternative JVM languages.

If they're exposed via the Java reflection API at all, it's incidental to their actual purpose.


I think they could also be useful in creating little DSLs, building parser combinators, etc.


> With that new bytecode keyword, we can call method only known at runtime.

I don't know much about Java, but it sounds like they're extending the bytecode to better support those alternate languages which currently are sort of hack-ish.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: