3 ms·
> dynamic language like Java Java is a static language.
by gher-shyu3i 6y ago
> dynamic language like Java
Java is a static language.
- kaba0 6y agoStatic in itself doesn’t have a strict definition. You are right that for example java is statically (and strongly) typed, but it has many dynamic elements like class (re)loading, reflection.
- gher-shyu3i 6y agogolang (and D I think) have reflection, yet they're AOT languages. The JIT does a tremendous job of yielding strong performance, and in several (or many cases) being dynamic in this sense bears a negligible penalty. These use cases end up with Java being faster than AOT languages for example.
- kaba0 6y agoYou are right that Java can easily surpass go for example in performance, especially in garbage-heavy programs —- but I didn’t read this thread as if it would be the point of it. My only remark was that Java while statically typed can be quite dynamic (and what is actually more meaningful, the JVM itself can often times swallow the performance impact of even really dynamic code constructs)
- pjmlp 6y agoEven C++ does it, this is not related to the type system.