# In as few lines as possible describe why you love julia

**URL:** <https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179>\
**Category:** New to Julia\
**Created:** [January 10, 2020, 2:07am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179 "2020-01-10T02:07:29Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [January 10, 2020, 2:28pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/21 "2020-01-10T14:28:18Z")

</div>

> [@Tamas\_Papp](#):
>
> I think that Julia reduced my frustration with programming by a factor of 10, but there is still plenty of it left.

Same here. Right now, I could be happy because 50 lines of Julia code do what would have taken me 200 lines of code before I learned Julia. But since making the code run on the GPU is so easy in Julia (and gives me a 10x speedup) I want to do that. And then I end up being frustrated about AD routines that allocate more memory than my GPU has, and thinking I need to write my own GPU kernels for some operations. This wouldn’t even have been an option before! My code would run on the CPU, and if it took a week there’d be nothing I could do about it, and I’d be happy!

I think the trick might be to not have higher ambitions just because the language can do more.

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [January 10, 2020, 3:00pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/22 "2020-01-10T15:00:19Z")

</div>

The trick is to keep refining the foundations. What I’m willing to do is keep revisiting the foundations. If the foundational aspects are iterated and well designed, then the higher level code will work better. If one starts programming at too high of an abstraction layer without redesigning the low level foundations properly, then one might have the programming issues you describe. To mitigate that, one has to not lose sight of redesigning the foundational building blocks. It is easy to lose sight of that, with so many high level abstractions available. The more solid and refined math foundation is built from, the better and more interoperable the higher level building blocks become. However, Julia is fantastic precisely because it is possible to work on refining both low level foundations together with the higher level abstractions.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 10, 2020, 3:14pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/23 "2020-01-10T15:14:14Z")

</div>

For me it has a lot to do with the trade-off between nice abstract user interfaces and fast code. I feel that because Julia specializes on generically written functions, even “low-level” functions deeper inside packages have kind of nice APIs and can be understood without much effort. In other languages, the further down you go, the worse it gets (especially behind the Java / C++ / C barrier for Matlab or Python.

Having fast custom structs encourages nicer APIs as well, because a Point in plotting is allowed to be a point, and a collection of points doesn’t have to be a 2D Array just because that’s how matplotlib expects it.

And I love broadcasting because it’s so much clearer than “hidden” vectorization.  
So, for a short example… Maybe something like this:

```julia
a_range = 1:20
a_vector = rand(20)
a_generator = (1//x for x in LinRange(0, 1, 20)
result = a_range .* a_vector .+ a_generator

```

Three different iterable objects, three different data types inside them, one short broadcasting expression, and it will be pretty fast because of specialization through multiple dispatch. So easy to write and understand, too!

---

<div class="post-metadata">

**Author:** ![bashonubuntu](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Post date:** [January 10, 2020, 4:25pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/24 "2020-01-10T16:25:12Z")

</div>

Personally, I had little experience in serious programming prior to Julia. I had used R/MATLAB/Python heavily but I never really felt I had a deeper understanding of what’s under the hood and thought all this is too hard for the uninitiated. 9 months into Julia, I can talk about and answer questions on parametric types, multiple dispatch, inplace operations and how to debug inefficiently written code (and, even have little intuitive understanding of what native code _might_ look like for something I am coding). I think the ability for a newbie to pickup and become decent at Julia in a short span of time is an underrated aspect of the programming language. The other great aspect is that there are only a few tricks you need to master to go from beginner to being good at Julia: avoid non-constant globals, focus on inplace operations, write for-loops and try best to minimize type-instabilities. Just these few things will make your code speed up relative to most languages and you’ll begin to appreciate how good of a language Julia really is!

---

<div class="post-metadata">

**Author:** ![pistacliffcho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pistacliffcho/32/8518_2.png) [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Post date:** [January 10, 2020, 7:29pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/25 "2020-01-10T19:29:32Z")

</div>

Testing code that runs at C++ speed in a REPL.

Nuff said.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [January 12, 2020, 2:43am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/26 "2020-01-12T02:43:52Z")

</div>

I am a little more demanding than you, XD.

_I do want to be as far from the metal as possible,_ **except when I need to be as close to the metal as possible** , and I want the same language to do both things seamlessly. Julia gets close to achieving that.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 12, 2020, 7:17am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/27 "2020-01-12T07:17:37Z")

</div>

Being “close to the metal” is mostly an illusion on modern x86 architectures. You almost never are (in the sense of having a mapping from code, even assembly, to what is going on in the hardware), and it is rarely a useful mental model any more.

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [January 12, 2020, 4:18pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/28 "2020-01-12T16:18:37Z")

</div>

I ❤ the Julia community. I’m someone who just kind of found myself (quite unexpectedly) working in a data analytics capacity almost a full decade after graduating with a BS in Economics and several years after finishing an MS in Finance/Economics. My previous experience coding was limited to some moonlight web development work that I had been doing on the side for several years. Making the leap from JavaScript/Node.js to Julia was very intimidating at first, given that this community is made up of quite a few PhDs and scientific types. There were times in the beginning (about a year and 3 months ago) where I was uncertain if Julia was right for me and I was questioning whether or not I should stop trying to learn it and switch to Python where it seemed that I might fit into the community a bit better. After signing up for discourse and posting lots of questions/getting involved in the community here all of those anxieties just kind of evaporated. I’ve been truly amazed at how much time some people are willing to take to help a complete stranger and I’ve grown immensely in the past year or so as a data analyst as a result. Not only that, the help I’ve received here has literally allowed my small organization’s fledgling data analytics capacity to increase in a very tangible way.

Thanks to all of you - there are several who have posted here that have taken time to respond to questions that I’ve posted and I’m so grateful for it, every single day 🙂 🤝

---

<div class="post-metadata">

**Author:** ![rapus95](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rapus95/32/3773_2.png) [@rapus95](https://discourse.julialang.org/u/rapus95)\
**Post date:** [January 13, 2020, 12:09pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/29 "2020-01-13T12:09:39Z")

</div>

Tbh I have a strong tendency to being [nerd sniped](https://xkcd.com/356/) 😃 and I guess, that there are a few more people that tend to it aswell.  
But I’m sure, from the outside I look like a nice, welcoming member of this community 😁. In fact I even think, that tendency contributes to a nice community because it leads to a large portion of shared interest in finding the cleanest solution for a given problem. Nevertheless, most members of this community are plain nice and helpful in its own right. I like the community too and I really love the cleanliness of the code one can achieve even for complex stuff.

---

<div class="post-metadata">

**Author:** ![rapus95](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rapus95/32/3773_2.png) [@rapus95](https://discourse.julialang.org/u/rapus95)\
**Post date:** [January 13, 2020, 12:29pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/30 "2020-01-13T12:29:39Z")

</div>

I also wanted to add a new point regarding cleanliness and design of Julia:  
Many members probably remember the introduction of the current call operator definition syntax:

```julia
function (obj::SomeType)(args...)
  [...]
end

```

On the first sight it might seem like it tries to be some special case of function definition. But looking closer reveals that standard function definition since then is just some convenient syntactic sugar\* for function-type objects:

```julia
function fname(args...)
[...]
end

#corresponds to

function fname end #defines the function object `fname`
function (fun::typeof(fname))(args...)
[...]
end

```

\*Implementation might differ 😛

Constructors also fit into that universal syntax with being able to be written as

```julia
struct MyType end
(::Type{MyType})(args...) = ...

```

Thanks to this focus on overall design the language mostly feels inherently consistent and capable.

Another “feature” with a similar level of unification is the idea of [Invariant Tuples](https://github.com/JuliaLang/julia/issues/24614). Which again, once it hopefully arrives, will turn special cases in language design (only tuples are covariant) to syntactic sugar while maintaining and even increasing the expressiveness of the type system!

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 13, 2020, 4:10pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/31 "2020-01-13T16:10:17Z")

</div>

I love that `Rational`

1. is available in `Base` (so handy when you need it for exact calculations — for me, mainly plotting),

2. but not built into _the language_: rather, it is _written_ in Julia

3. in a way that is so exemplary that it works fine as an demo of a lot of features (parametric types, inner constructors, validation, promotion) without major modifications.

It is but a tiny thing, but serves so many orthogonal purposes.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [January 13, 2020, 5:55pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/32 "2020-01-13T17:55:37Z")

</div>

Julia seems to be able to avoid “surprises” (you know, the ones which leave you fuming after a debugging session “what were they thinking?”. Looking at you Matlab, C++, …).

---

<div class="post-metadata">

**Author:** ![RainerEngelken](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rainerengelken/32/3942_2.png) [@RainerEngelken](https://discourse.julialang.org/u/RainerEngelken)\
**Post date:** [January 14, 2020, 2:29am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/33 "2020-01-14T02:29:37Z")

</div>

Event-based simulation of chaotic spiking neural network of quadratic integrate-and-fire neurons including Poincaré section for visualisation:

```julia
using PyPlot,StaticArrays
function poincare()
              n,ϕ,𝚽=SMatrix{3,3}(0 .<[0 0 0;1 0 1;0 1 0]),randn(3),[] # define adjacency matrix, initialize network
              for s=1:8^7 # number of spikes in calculation
                  m,j=findmax(ϕ) # find next spiking neuron j
                  ϕ.+=π/2-m # evolve phases till next spike time
                  ϕ[n[:,j]],ϕ[j]=atan.(tan.(ϕ[n[:,j]]).-1),-π/2 # update postsynaptic neurons, reset spiking neuron
                  j==1 && append!(𝚽,ϕ[2:3]) # save neuron 2 & 3 whenever neuron 1 spikes
              end
              plot(𝚽[1:2:end],𝚽[2:2:end],".k",ms=.1);axis("off")
              end

```

![poincareMinimal](https://global.discourse-cdn.com/julialang/original/3X/e/a/eab8028fae27f805603dd4ff45eae84b082b0c00.jpeg)

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [January 14, 2020, 2:51am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/34 "2020-01-14T02:51:07Z")

</div>

> [@bashonubuntu](#):
>
> . I think the ability for a newbie to pickup and become decent at Julia in a short span of time

Would u say the same about python? Why and why not? Just curious

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [January 14, 2020, 3:55am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/36 "2020-01-14T03:55:22Z")

</div>

Collaboration without consternation.

---

<div class="post-metadata">

**Author:** ![alirezamecheng](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@alirezamecheng](https://discourse.julialang.org/u/alirezamecheng)\
**Post date:** [January 14, 2020, 2:19pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/37 "2020-01-14T14:19:19Z")

</div>

Frankly, I loved Julia for its high speed yet being a high-level language. At the early versions that I started using the language (V 0.5) it was amazing. But now I see the performance of the language is somehow fading. It makes me sad.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [January 14, 2020, 3:56pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/38 "2020-01-14T15:56:38Z")

</div>

Do you have the impression that the language is getting slower? That’s pretty surprising.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 14, 2020, 4:06pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/39 "2020-01-14T16:06:23Z")

</div>

> [@alirezamecheng](#):
>
> But now I see the performance of the language is somehow fading. It makes me sad.

It would be great to see some specific code that demonstrates this, ideally opening an issue.

Please note that performance is tested extensively:

> **[GitHub - JuliaCI/Nanosoldier.jl: A package for running JuliaCI services on...](https://github.com/JuliaCI/Nanosoldier.jl)**
>
> A package for running JuliaCI services on MIT's Nanosoldier cluster - GitHub - JuliaCI/Nanosoldier.jl: A package for running JuliaCI services on MIT's Nanosoldier cluster

and reports of [regressions](https://github.com/JuliaLang/julia/issues?q=is%3Aopen+label%3Aperformance+label%3Aregression) are taken seriously.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [January 14, 2020, 7:11pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/40 "2020-01-14T19:11:54Z")

</div>

I would be interested in hearing about evidence to that effect. We take regression reports very seriously, but if you don’t report regressions, then we can’t investigate them. The general trends seems quite the opposite: Julia has gotten significantly faster since 0.5. Back then it was typical that well-tuned Julia code would be somewhere between as fast as C and half as fast as C. These days, well-tuned Julia code is often faster than C, sometimes by quite a bit. It’s very common that old code has just automatically gotten faster from a combination of LLVM improvements and Julia compiler improvements.

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [January 14, 2020, 9:01pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/41 "2020-01-14T21:01:51Z")

</div>

My guess is that _on average_, julia code being run in the wild is slower, but only because more people are running poorly tuned code. Mea culpa 😓

[Previous page](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179.md?page=1)

[Next page](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179.md?page=3)
