Hacker News new | ask | show | jobs
by jez 2556 days ago
Have you seen Julia?

https://julialang.org/

The first three selling points on their home page are Fast, Dynamic, Optionally Typed.

2 comments

Meh. Julia does nothing to help me catch errors before runtime, it's no different than Python in this regard. Although it does use the types to generate fast code (and in my experience it does live up to its performance claims).

I've seen some talk of Julia doing compile time checks, maybe in the future it will?

Julia's type system works to make the language more dynamic instead of more static, instead of one slow program in which types have to be checked at runtime a Julia program is a superposition of every optimized implementation of an algorithm and explicit types are used to access and manipulate a subgroup of implementations. So in general you don't use types to increase performance (the compiler already infers all types to generate fast code, including optimized union types for nullable fields for example), but when you want to restrict the polymorphism to work in more specific code.

But since the JIT compiler infers all types, regardless of explicit hinting, it's possible to create tools to evaluate all types before a function is called [1], which combined with the efforts in better precompiling the code (which increases the amount of code that will have the type inferred before running) could make some good tooling for compile time checking.

[1] https://nextjournal.com/jbieler/adding-static-type-checking-...

> a Julia program is a superposition of every optimized implementation of an algorithm and explicit types are used to access and manipulate a subgroup of implementations.

That is an amazing description of what it is!

Isn't Julia optionally dynamically typed, not optionally statically typed?