On Tue, Jul 12, 2016 at 7:09 PM, Zhong Pan <[email protected]> wrote:
> One big problem of dynamically typed languages is type mismatch errors only
> pop up at run time. When I say "type mismatch" I refer to the case when the
> compiler/interpreter cannot reasonably guess a conversion, therefore e.g.
> assigning an integer value to a double variable does not count.
>
> It'll be nice to allow quick coding leaving out type annotations for fast
> prototyping; later on to reach production, the programmer can improve
> reliability and reduce run-time errors by annotating types as much as
> possible.
>
> Is there an option or separate tool that can perform a best-effort type
> check on the source code before it starts running? I heard that type
> mismatch may be caught by JIT compiler early if all parameters of a function
> have been type annotated; however JIT compilation happens at run time in
> user's perspective. I think it's desirable to be able to catch problems even
> before running anything. And the option / tool does not (and will not be
> able to) catch all type mismatch problems; but it should be able to flag
> clear violations.

Depending on what's you definition of type error (i.e. Julia **never**
guess any conversion) `@code_warntype` should do a decent job of
catching errors.

>
> Thanks,
> -Zhong
>

Reply via email to