Earlier quoted context omitted.
I didn't find it slow, but: $ time julia -e 'print(1)' 1 real 0m0.438s user 0m0.300s sys 0m0.118s $ time python -c 'print(1)' 1 real 0m0.040s user 0m0.036s sys 0m0.003s it is slower.. That said, instanciating julia every step of a bash loop.. I think it requires a jvm mindset, warmup once and iterate inside rather than outside.
First of all that is ridiculously slow. Secondly, unlike Matlab you don't have everything you need available after starting the REPL. For instance if you want to plot something you might run `using Gadfly`. How long does that take? 16 seconds. Sixteen seconds. For real. This is not usable.
Why Julia
91–100 of 257 posts
Re: Why Julia
#92Earlier quoted context omitted.
First of all that is ridiculously slow. Secondly, unlike Matlab you don't have everything you need available after starting the REPL. For instance if you want to plot something you might run `using Gadfly`. How long does that take? 16 seconds. Sixteen seconds. For real. This is not usable.
Hold on how long is MATLAB boot ?
Re: Why Julia
#93Earlier quoted context omitted.
Agreed, that's my experience as well. Julia is amazing for scripts and smaller projects, but I wish there was something like Swift (which I'm increasingly convinced is closest to the ultimate general-purpose language) with all the nice things that Julia has. Specifically, these things make Julia less suitable for larger projects: - Lack of support for OOP. And no, purely functional programming is not the best way to…
> Lack of support for OOP. Please. No. Languages that try to do everything are crap. If you want to do something OOP, why don't you grab a language built for it?
Re: Why Julia
#94Earlier quoted context omitted.
> and python (a sane, real programming language) So... R is an unreal language then?
I use R daily at work, and often reach for it before Python for non-statistical tasks out of comfort. But R's functions for non-statistical tasks often break the language's idioms. Those dealing with files and connections are especially ugly. I wouldn't call it insane or unreal, but it's definitely not intended for general scripting.
As for (a bunch of) functions in the basic library (which, essentially, is a set of packages that you can discard or simply not use), I dare say it has little to do with the language itself. I don't like Python's regular expressions library, for example, but it's only a set of functions (or methods) that you can write on your own! The same goes for R's data-wrangling routines; there's this tidyverse, and you can write good, reliable, production-grade code without using a single function from the base library. Heck, you can even write your own DSL (think: Grammar of Graphics) if you think it could improve your code!
There are several quirks built so deeply into the core of the language that you cannot overcome them ("why can't I overload `+` for character strings??"), but they have nothing to do with the rather poor and unintuitive basic library.
Re: Why Julia
#95Earlier quoted context omitted.
Agreed, that's my experience as well. Julia is amazing for scripts and smaller projects, but I wish there was something like Swift (which I'm increasingly convinced is closest to the ultimate general-purpose language) with all the nice things that Julia has. Specifically, these things make Julia less suitable for larger projects: - Lack of support for OOP. And no, purely functional programming is not the best way to…
honest question, not a serious SDE here. In what ways is julia not supportive of OOP?
Re: Why Julia
#96Earlier quoted context omitted.
I actually like 1-based for numerical work. A lot of great languages (Smalltalk, APL, Lua...etc) use it too. It makes sense with matrices.
For "2D indexing" into a 1D array it's actually a little awkward. With an n×m matrix, - zero-indexed: i×m+j - one-indexed: (i-1)×m+j OTOH one-based is slightly better for trees stored in 1D arrays: - zero-indexed: parent=(child-1)/2; children=2×parent+(1, 2). - one-indexed: parent=child/2; children=2×parent+(0, 1). My favourite fact about this stuff: in VB (or was it VBA?) when you asked for an array of size n, you a…
Re: Why Julia
#97Earlier quoted context omitted.
Sorry, why do you need OOP? I haven't coded OO in about 10 years now. (Mostly Julia, elixir, and functional JavaScript). It's great. Would never go back.
I even had to write python once, so I built a class where none of the functions were passed self (so it was basically a functional module)
Re: Why Julia
#98Earlier quoted context omitted.
Agreed, that's my experience as well. Julia is amazing for scripts and smaller projects, but I wish there was something like Swift (which I'm increasingly convinced is closest to the ultimate general-purpose language) with all the nice things that Julia has. Specifically, these things make Julia less suitable for larger projects: - Lack of support for OOP. And no, purely functional programming is not the best way to…
Sorry, why do you need OOP? I haven't coded OO in about 10 years now. (Mostly Julia, elixir, and functional JavaScript). It's great. Would never go back.
Re: Why Julia
#99Earlier quoted context omitted.
Multiple dispatch and meta programming are both wonderful, irrespective of speed benefits. For example, compare linear algebra syntax in Julia with those in R and Python. Plus, the flexibility of multiple dispatch applying equally well to any of your own types really makes it feel like you can do anything in Julia. Metaprogramming, writing code that writes code, can take a while to get used to. But is extremely power…
Multiple dispach and meta programming are available in python as well. Although duck typing is usually a better solution and it's not really a killer feature to data analysts anyway. Compared to python, i'd say julia has the reputation for being generally faster for things you can't use numpy with, and you can more easily scale multiple cpu or machines.
Re: Why Julia
#100Earlier quoted context omitted.
I even had to write python once, so I built a class where none of the functions were passed self (so it was basically a functional module)
In python you’d normally just use module level functions for that. Using a class without having instances and all static functions doesn’t really buy you anything.