News for hackers. Stuff that matters.
Re:Ask HN: Why do we use interpreters instead of compilers? by manidoraisamy on Monday October 27, 2014 @06:41PM (#8518589)
Productivity. Interpreters load code changes during development without any issue. Compilers usually create incompatible versions of the same class, throw errors and hamper productivity.
Re:Ask HN: Why do we use interpreters instead of compilers? by mbrodersen on Wednesday October 29, 2014 @03:20AM (#8525946)
There is nothing stopping a compiled language from dynamically loading new code. That is what .so and .dll's are used for all the time.
Re:Ask HN: Why do we use interpreters instead of compilers? by rdc12 on Monday October 27, 2014 @09:39PM (#8519129)
Plenty of compilers allow for on the fly changes
Re:Ask HN: Why do we use interpreters instead of compilers? by manidoraisamy on Monday October 27, 2014 @09:58PM (#8519171)
Classloaders usually reject incompatible versions of the same class when you do that. Plus they don't come with default SDK.
Re:Ask HN: Why do we use interpreters instead of compilers? by mbrodersen on Wednesday October 29, 2014 @03:21AM (#8525948)
Java does not represent the limits of what is doable when compiling.
Re:Ask HN: Why do we use interpreters instead of compilers? by manidoraisamy on Wednesday October 29, 2014 @10:14PM (#8531007)
I used java classloader as a canonical example. In general, compilers outputs object code during development and the runtime doesn't expect syntax errors. Compiler like JIT are meant for runtime optimization and not to handle the development workflow like syntax parsing. That's why errors in development workflow compilers (like JSP compiler) are incomprehensible, when you start writing code inside it.

On the other hand, dynamic language interpreters already handle both syntax parsing and execution at runtime. Therefore loading changes during development is not a big deal for them.