7 ms·
Julia is excellent. There are a lot things with Julia (think multiple dispatch) that once you learn them you can't stop noticing that other languages are doing
by t6jvcereio 4y ago
Julia is excellent. There are a lot things with Julia (think multiple dispatch) that once you learn them you can't stop noticing that other languages are doing it wrong
- wdkrnls 4y agoI don't understand why people keep talking about multiple dispatch like Julia invented it. You can do that in many other languages, even languages designed for numeric computation. What's cool about Julia is that it has brought 90s compiler technology to scientific computing: a field which still thinks MATLAB is a really good way to develop and communicate scientific ideas.
- t6jvcereio 4y agoWhat other languages?
- michaelfiano 4y agoAuthor here. How about Common Lisp, what the article talks about? :)
- t6jvcereio 4y agoSomehow, lisp ends up being really slow. so it's doing something else wrong.
- michaelfiano 4y agoWhich Lisp? What applications do you think it is slow at? Hint: It can be faster than C due to compiler macros, and infact, its regular expression engine is much faster than Perl's, which is written in C, just to give a concrete example.
- _ofdw 4y agoMy experience with SBCL disagrees with this. It's not as fast as, say, C++ for some use cases, but it's pretty quick. Significantly faster than something like Python.
- TurboHaskal 4y agoMy experience is that even writing "idiomatic", CLOS heavy code tends to be faster out of the box than most dynlangs out there. Writing close to C++ code requires a lot of manual work and is probably not even worth it unless for optimizing hot-paths.
- pfdietz 4y agoYou're probably using O(n^2) idioms, like appending to the end of a growing list.
- galangalalgol 4y agoMATLAB is fairly impressive for development. It works ok for communication. What are the areas for improvement you have in mind, and what are the alternatives I should consider?
- adgjlsfhk1 4y agoThe 2 biggest problems with Matlab are price and lack of community. The price is an issue even if you can afford it because it makes it really hard to deploy widely since anyone who wants to run the code also needs to be paying Mathworks. This closely ties in to the community issue. Almost all Matlab libraries are proprietary (and written by MathWorks). If you find a bug, your only option is to file a report and wait 3 years for it to not get fixed. In an open source ecosystem, you can dig into the code and fix the problem yourself if you need to.
- galangalalgol 4y agoBoth fair points. And the alternative? I like Julia, but i still haven't found a workflow I like. I still typically prototype in Matlab and deploy in c++/cuda.
- adgjlsfhk1 4y agoI'm using Julia, but if I wasn't, I probably would either be using Python or C#.
- galangalalgol 4y agoI'm trying to work entirely inside the repl. Its not bad but for large stuff the lack of go to definition hurts, and there isn't an easy way to copy commands that worked into my module. I'll try vscode next. That is what I use for c++/c. Is there anything else I should try?
- adgjlsfhk1 4y agoI use VSCode+repl which works well for me (although the language server for Julia isn't as good as a C/C++ one). The one other workflow to look at is Pluto notebooks. They're similar to jupyter notebooks, but they track cell dependencies and automatically dependent cells, to guarantee that you maintain consistent state.
- adgjlsfhk1 4y agoI think a lot of the reason is that most previous incarnations of multiple dispatch give you slow multiple dispatch, and a different way to define functions that don't have multiple dispatch and are faster to call. As such MD tends not to be commonly used in languages where it exists. Julia isn't the first to have multiple dispatch, but it is the first where everything is multiple dispatch. The result of this is that we put in a ton of work to make multiple dispatch fast, and all the APIs are designed around it, which gives a very different feel to the language.
- chalst 4y agoAs I noted around a year ago, there's a little puzzle here: in principle Julia's approach was available in the 90s, when decent JIT technology was becoming available. So why was MD given only toy-like treatment before Julia? (MATLAB did get a JIT in 2002, so it's not really a toy, but the performance was not good enough to prove the concept) My impression is that the complained-about inflexible division between concrete and abstract types was pretty necessary to achieving good results in practice, but this division is alien to the expressiveness-loving lisp culture. Cf. https://news.ycombinator.com/item?id=26590270 https://news.ycombinator.com/item?id=26590270
- manwe150 4y agoPerhaps because it can be equally remarkable how many other languages lack multiple dispatch, when it is not a new concept
- forgotpwd16 4y agoIt didn't invented it but made it central to the language's design (being essentially the prime paradigm rather some opt-in functionality).
- agumonkey 4y ago> What's cool about Julia is that it has brought 90s compiler technology to scientific computing that's how I read julia's praises, I don't think most people ignore the past here
- deleted 4y ago[deleted]
- agumonkey 4y agoI forgot the name of this curse but not the curse itself. /me goes back to old python OO crud