Hacker News new | ask | show | jobs
by cwufbt08 4426 days ago
In what way is Java a "dynamic language" ?
5 comments

Contrary to popular belief Java is highly dynamic. You can introspect the fields, methods, interfaces of any object at runtime, inject new / redefine classes, methods, fields, etc. The problem is that it's very awkward and unwieldy to do so. Hence the tendency to build new JVM languages rather than attempt to use Java's dynamic features directly.
I think "dynamic platform" would be more accurate. Java has typically been a fairly conservative language sat on a much more interesting VM, a VM which has rather more features in common with dynamic languages like Smalltalk than you'd expect.
but you can always escape with cglib and rock out.

So even though java the language isnt dynamic, you can do a lot more at runtime, than with these new-fangled languages like Go and Rust.

"Dynamic language" != "Dynamically typed language".
Java has a lot of runtime knowledge about itself, it can do a lot with that.

As a result, you see things in Java that are more typical of dynamic languages, rather than C++ for example.

I think he meant dynamic as in ability to adapt rather than a dynamic language like python