3 ms·
Julia is all three, yet it's fast (allowing for jit, which in Julia is a one time cost). It's worth noting that those properties themselves are not what's crit
by dnautics 9y ago
Julia is all three, yet it's fast (allowing for jit, which in Julia is a one time cost). It's worth noting that those properties themselves are not what's critical, so much as designing around it and allowing for fast paths through critical code (locking down the dynamic types, first class array datatypes with packed forms)...
- azag0 9y agoIt's rather the degree to which Python is dynamic that makes it slow. PyPy could be considered an implicit JIT compiler for Python, yet it is still far slower than Julia. The level of magic you can apply to Python objects that the interpreter/compiler must support is just a different league than Julia. I'd be interested if someone could compare to JS.
- pjmlp 9y agoLisp, Smalltalk, Dylan and SELF allow for the same kind of magic. The JIT developed for SELF is the genesis of Hotspot. JRuby guys have a quite good implementation making use of Graal, and Ruby is not less magical than Python. In the end it boils down to how much the community prefers to keep on using C, or improve PyPy. EDIT: Fixed auto-correction induced typo.
- shellac 9y agos/Gradle/Graal/? In the case of python it's clear that the heavy reliance on c extensions is a blessing and a curse: it's kept python relevant in communities like science even though it isn't very fast. However one of the lessons of Graal seems to be that such extensions can seriously prohibit improving performance, since they are opaque to JITs. There's a few talks by Chris Seaton (e.g. https://www.youtube.com/watch?v=YLtjkP9bD_U https://www.youtube.com/watch?v=YLtjkP9bD_U) on the topic.
- pjmlp 9y agoYeah, typo due to auto-correction.
- _Wintermute 9y agoIf Julia had better support for DataFrames I would jump ship in a heartbeat, but it's just not comparable with R and python/pandas.
- pjmlp 9y agoJust give it a bit more time to mature.
- Sean1708 9y agoI'm not sure I'd call Julia a dynamically typed language, each variable can have one and only one (possibly abstract) type which allows the JIT to avoid boxing and opens up plenty of optimisations. I'm not particularly convinced that Julia's object model leads to inefficient memory access either.
- StefanKarpinski 9y agoJulia is absolutely dynamically typed [1]. > each variable can have one and only one (possibly abstract) type This is generally untrue except for a rarely used feature allowing declaration of local variables with a certain type (assignment to such variables automatically converts to the declared type). Is this documented incorrectly somewhere? Julia's object model allows a spectrum of array types. At one end, `Vector{Any}` is a Python-like array, and at the other, `Vector{Float64}` is a C-like (or NumPy-like) array with a concrete element type. If the element type is abstract but more constrained than `Any` then you get something in between these extremes. This includes array types like `Vector{Union{Float64,Void}}` and `Vector{Real}`, both of which have abstract element types smaller than `Any`. The former can still store values inline like C arrays, thanks to recent work on efficient representation of unions small values. The latter needs Python-like vector-of-pointers representation because the set of kinds of values it can hold is unbounded since you can add new subtypes of `Real` at any time. [1] https://stackoverflow.com/a/28096079/659248 https://stackoverflow.com/a/28096079/659248
- Sean1708 9y ago> Is this documented incorrectly somewhere? No, I just got myself massively confused at how code_warntype works. Please just disregard everything I said in the above comment.