Julia is built around multiple dispatch - when making a call, the method to execute is chosen based on the run-time types of all of the arguments.
Once this choice has been made, Julia compiles the method, specialised for the exact types of the arguments.
So, the dispatch process and the JIT compiler are linked - both are reliant on type information every time a function is called.
This specialisation is the only way the Julia JIT uses runtime type information. Unlike JavaScript JITs, Julia does not track things like the types of local variables during execution (although it may do some static inference). Therefore type annotations for local variables can improve performance.
> Genuinely curious, what makes Python look more like pseudocode? The use of colons?
I used to think it was significant indentation, but if you look at the pseudocode on e.g. Wikipedia, there is no significant preference for either whitespace or begin/end.
Therefore, it’s probably things like `if value in my_map` vs `if my_map.contains(value)` and `[x * 2 for x in my_list]` vs `my_list.map(x -> x * 2)`.
> I am sure method_missing could be implemented in python using various tricks but nobody, afaik, is doing that.
You could probably implement method_missing in Python using either __getattribute__ or __getattr__.
I think this is a small example of why nobody is doing so. It’s not just culture - Python’s object model is so complex that it would be hard to get right.
> why don't people just write clear, explicit, maintainable code instead of trying to be clever
But that’s boring. Seriously, it always amazes me how many programmers allow their decisions to be guided by what’s best for their personal enjoyment rather than what’s best for the project.
> how would you showcase an experimental feature to the community?
How do other languages do it? Python has the PEP process for discussing design on paper, but I don’t know how they handle experimental implementations.
> A guy who [...] wants to be known as the creator of something.
I have this problem. I’m frequently distracted from doing what I want to do by ideas for things that I want to have done (and wouldn’t enjoy actually doing day-to-day).
The search for prestige is about the only reason to switch paths and start working on any of these ideas, but it’s hard to ignore.
Once this choice has been made, Julia compiles the method, specialised for the exact types of the arguments.
So, the dispatch process and the JIT compiler are linked - both are reliant on type information every time a function is called.
This specialisation is the only way the Julia JIT uses runtime type information. Unlike JavaScript JITs, Julia does not track things like the types of local variables during execution (although it may do some static inference). Therefore type annotations for local variables can improve performance.