3 ms·
Why not use Python? Do you mean Python 2.7 or Python 3.x? Multiple dispatch lets the user define several functions with the same name and have the compiler pic
by Stubb 13y ago
Why not use Python? Do you mean Python 2.7 or Python 3.x?
Multiple dispatch lets the user define several functions with the same name and have the compiler pick the right one based on the arguments. For example, you could have three versions of the foo() function, one for reals, another for complex, and a third for matrices. You could define your own types and write additional versions of foo()—the compiler will pick the right one based on the underlying types. Julia's type system makes a lot of sense once you've gotten the hang of it.
I'd suggest fiddling with Julia if you have some time, as I think it rolls together some good ideas. But it still has a way to go IMHO. Redefining functions with dependencies in the interactive toplevel doesn't work quite right, and you can't delete entries from the symbol table. It concerns me that these things don't work. I figure that I'll give it another look as a tool for serious work when 1.0 gets released.
I'll stick with R in the mean time—less change of unpleasant surprises. But I could see Julia replacing R for me in a few years if it's done right.
- cabinpark 13y agoI'll admit that is an interesting feature honestly the first thing on the list? It's certainly a cool and interesting idea, but I'll admit it's not a super important feature in my view. Thinking back on all the research I've done I can't think of a single time where I would need such a feature. I never use any data strucures beyond matrices, which Matlab handles by default. Since 1x1 matrices are just numbers, every function that works for matrices, works for single numbers. I do use Python, but it came into it late on my project. Future projects will definitely use Python since it's good enough for data processing stuff. Hard core numerics will still be done in Fortran/C. I definitely do see Julia being the better version of Matlab but it certainly has a ways to go.
- Fomite 13y ago> I'd suggest fiddling with Julia if you have some time This is my biggest problem with Julia. I'd love to tinker with Julia, port some code over, especially some slow Python code, but it's hard to do trying to shove papers out the door and knowing it'll be days/weeks before I'm up to speed, and that there's libraries I may have to reimplement (probably poorly, what with being a scientist rather than a programmer).