Hacker News new | past | comments | ask | show | jobs | submit login

>So what is the difference between Java and Python to make this weird double standard?

For one, a Python syntax issue in a function that's not called will never emerge even if the source file is read and run.

With Java you wouldn't even get that source to bytecode format to begin with.




That’s property of the JIT compiler though, not a lack of compilation. You want to keep compiler times low so you only analyse functions on demand (and cache the byte code).

If CPython behaved identical to Javas compiler people would moan about start up times.

Some AOT languages can mimic this behaviour too with hot loading code. Though a lot of them might still perform some syntax analysis first given that’s an expectation. (For what it’s worth, some “scripting languages” can do a complete check on the source inc unused functions. Eg there’s an optional flag to do this in Perl 5).

I will concede things are a lot more nuanced than I perhaps have credit for though.




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

Search: