Edit: missed one, natively compiled or VM based.
Edit: missed one, natively compiled or VM based.
- It is functional (including lisp-like macro programming) but has a strict type system along with multiple dispatch, which effectively allows for OOP constructs.
- It allows for dynamic typing but since it is JIT compiled using LLVM, you can specify static types for variables and thus take advantage of lots of smart optimisation.
- There is garbage collection but also the ability to get right in there and reach into pointers and memory-allocation manually.
It's truly a pleasure to work with once you appreciate what's possible.
Dynamic with optional typing. General consensus is that it has a pretty great type system. Union types, language level implementation of high performance missing types. Garbage collected. JIT compiled using LLVM backend; entire language is written in itself, so the compiler doesn’t have any “black boxes”, I.e. it can optimise everything. Great multiple dispatch system. Imperative technically I guess? But feels like it’s lifted a bunch of good ideas from various functional and domain specific languages.
Anything I missed?
You are talking to the llvm compiler, sure you are talking in Julia most of the time, but if you happen to want to talk in C or FORTRAN or ASM in the middle of your high level script, just do. No marshalling of I/O or data structure impedance it all compiles the same.
[0]https://docs.julialang.org/en/stable/base/c/#Core.Intrinsics...
Though I guess you are talking about libraries?
JIT is better described as "extremely lazy ahead of time compilation" (not my words). Except for globally-scoped commands, e.g. REPL (I think?) code is always going to be compiled before it is run.
Some examples of fantastic things I've done with julia:
1) wrote a drop-in replacement to IEEE floating point and evaluated numerical performance in operations like FFT, linear algebra, machine learning... I only had to write the basic operations + - * /, and a few algebraic functions like one(T). Everything else (matrix mult, linear solving, complex numbers) came for free.
2) wrote a Galois field type and ran experiments on Reed-Solomon erasure coding. Didn't have to rewrite the linear solver \ function. The builtin one worked just fine - well, in version 0.5 I had to patch it, but it worked great in 0.6 and beyond.
3) wrote a DSL that would "write verilog for me". I could pass an integer type and validate easily that the wires had the result I expected, then use the multiple dispatch on a "semantic type" which was a wrapper on String, which literally generated verilog instead of doing operations on numbers. Then I used verilator (an open source verilog -> C transpiler) to dynamically generate the verilog into a .so file, upload it back to julia, and then run full set of unit tests against both. This suite took me a week to write.
* A lot of packages are incompatible with the latest versions of Julia. Though because it has stabilized, this is likely to stop being an issue soon.
* There isn’t any major organization that has adopted it yet, which may impact its long term success in contrast to other new languages like go swift rust etc that have a major sponsor. Garbage collector makes it unsuitable for certain real time uses, which is unfortunate given its otherwise predictable performance characteristics.
* Although there are web frameworks for it, I’m not sure whether they are mature enough for production use.
* Personal pet peeve: no infix operator for integer division. I haven’t looked recently whether there is a package for this. I should probably make my own if not.
(To be clear, I really love the Julia language, and use it quite a bit in personal projects - I'm just hoping that it gets strong adoption, since adoption is what drives the development of miscellaneous libraries and packages).
Sure there is
julia> 10 ÷ 3
3
type as``` 10 \div<tab> 3 ```
in any decent julia-capable environment (REPL, editors, notebooks, etc)