Live data from Hacker News

Why Julia

ucidatascienceinitiative.github.io

91–100 of 257 posts

Re: Why Julia

#91

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.

Hold on how long is MATLAB boot ?

Re: Why Julia

#92

Earlier 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 ?

maybe he was thiking about Octave, that is an interpreter for the same language as Matlab and it starts much faster.

Re: Why Julia

#93

Earlier 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?

I do. Many languages have excellent support for both OOP and FP. I think Swift is currently the best-designed general-purpose language and wish that it would improve in areas where Julia is better, e.g. standard library and available packages or REPL.

Re: Why Julia

#94
post #82

Earlier 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.

I don't argue that R is not insane ;-)

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

#95

Earlier 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?

It doesn't have interfaces for example. It doesn't have access modifiers. Also, not sure if this belongs to OOP but working with optionals is cumbersome.

Re: Why Julia

#96

Earlier 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…

Forgive my ignorance, but are you saying you use A[(i-1)×m+j] to get the element in the i-th row and j-th column? Why not use A[i, j]?

Re: Why Julia

#97

Earlier 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)

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.

Re: Why Julia

#98

Earlier 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.

Because sometimes it's better for readability and conceptual simplicity to structure the code as objects connected to each other. Most of large-scale successful projects, often written by better developers than me or you, use OOP.

Re: Why Julia

#99
post #7

Earlier 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.

Multiple dispatch has to be coded by hand in Python, it isn’t a feature of the language.

Re: Why Julia

#100
post #97

Earlier 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.

Iirc, modules have a dependency on bareword paths that can get awkward. I'm not a professional python programmer, so the fastest way for me to deliver something that I could be 100% guaranteed to work was that way. Maybe I'm wrong, but that was my logic.
Post reply on HN