# 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:** 14\
**Page:** 6

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 18, 2021, 4:12pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/103 "2021-05-18T16:12:59Z")

</div>

No need for root in Android, just follow [this great post](https://discourse.julialang.org/t/using-julia-on-android-with-userland/58498).

---

<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:** [May 19, 2021, 4:41am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/104 "2021-05-19T04:41:12Z")

</div>

> [@fjfranco](#):
>
> @time sort!(rand(Float64, 10000000))

Even faster

```julia
using SortingAlgorithms
@time sort!(rand(Float64, 10000000), alg=RadixSort)

```

> [@RoyiAvital](#):
>
> ```julia
> julia> @time sort!(rand(Float64, 10_000_000));
> 0.733050 seconds (2 allocations: 76.294 MiB, 9.77% gc time)
> 
> ```

Try the above. It’s faster.

---

<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:** [May 19, 2021, 4:42am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/105 "2021-05-19T04:42:16Z")

</div>

> [@rafael.guerra](#):
>
> ```julia
> julia> @time sort!(rand(Float64, 100_000_000))
> 12.751227 seconds (25 allocations: 762.959 MiB, 0.23% gc time)
> 
> ```

Faster, I suspect

```julia
using SortingAlgorithms
@time sort!(rand(Float64, 100_000_000), alg=RadixSort)

```

---

<div class="post-metadata">

**Author:** ![viraltux](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viraltux/32/15236_2.png) [@viraltux](https://discourse.julialang.org/u/viraltux)\
**Post date:** [May 19, 2021, 5:26am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/106 "2021-05-19T05:26:09Z")

</div>

Because Julia people don’t quit(); the exit() gracefully.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [May 19, 2021, 8:08am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/107 "2021-05-19T08:08:08Z")

</div>

> [@xiaodai](#):
>
> ```julia
> using SortingAlgorithms
> @time sort!(rand(Float64, 100_000_000), alg=RadixSort)
> 
> ```

Yes, this is ~20% faster and nice to know about that package!  
However, it seems more unstable on my cellphone: sometimes the process aborts saying “Killed” or it can even abort the Julia REPL.

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [May 19, 2021, 8:20am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/108 "2021-05-19T08:20:05Z")

</div>

That’s what happens when you run out of memory on Linux.

---

<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:** [May 19, 2021, 2:21pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/109 "2021-05-19T14:21:20Z")

</div>

> [@rafael.guerra](#):
>
> sometimes the process aborts saying “Killed” o

radixsort does use double the memory.

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [May 20, 2021, 12:27am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/110 "2021-05-20T00:27:30Z")

</div>

> [@xiaodai](#):
>
> `alg=RadixSort`

Try this and MATLAB will not be faster any more. Future implementations of other algorithms into `ThreadsX` can get even faster. The Multithreading hero, aka @tkf, may give us more insights.

```julia
using ThreadsX
julia> @time ThreadsX.sort!(rand(Float64, 100_000_000));
  3.376360 seconds (4.29 M allocations: 1.973 GiB)

```

MATLAB (R2020a) for reference (multithreaded by default):

```julia
tic
sort(rand(100000000,1));
toc
Elapsed time is 3.731379 seconds.

```

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [May 20, 2021, 3:19am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/111 "2021-05-20T03:19:08Z")

</div>

> [@xiaodai](#):
>
> > [@rafael.guerra](#):
> >
> > sometimes the process aborts saying “Killed” o
> 
> radixsort does use double the memory.

I wish, in some way, all allocating functions would support given a pre allocated buffers on the function call.  
To the least the in place flavors.  
It means the user will be able to create a non allocating paradigm (Pre allocating all at the beginning of the program and from there just recycling the buffers).  
It will probably also help the GC, right?

Maybe something to think about for Julia 2.0.  
It can become very important in production.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [May 20, 2021, 7:46am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/112 "2021-05-20T07:46:14Z")

</div>

Tagging @tro3 and @stillyslalom:

> ```julia
> julia> using Unitful, Unitful.DefaultSymbols
> 
> julia> 800mV/53.55μA
> 14.939309056956116 mV μA^-1
> 
> julia> uconvert(kΩ, ans)
> 14.939309056956116 kΩ
> 
> ```

Even better with some syntactical sugar

```julia
julia> using Unitful, Unitful.DefaultSymbols

julia> 800mV/53.55μA |> kΩ
14.939309056956116 kΩ

```

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [May 20, 2021, 4:58pm UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/113 "2021-05-20T16:58:07Z")

</div>

> [@xiaodai](#):
>
> Faster, I suspect
> 
> ```julia
> using SortingAlgorithms
> @time sort!(rand(Float64, 100_000_000), alg=RadixSort)
> 
> ```

> [@Seif\_Shebl](#):
>
> Future implementations of other algorithms into `ThreadsX` can get even faster.

Yes, radix sort is great. So let’s [parallelize it](https://github.com/tkf/ParallelRadixSort.jl) 🙂

```julia
julia> using SortingAlgorithms, ThreadsX, ParallelRadixSort

julia> x = rand(Float64, 100_000_000);

julia> @time sort(x, alg = RadixSort);
  3.495047 seconds (18 allocations: 1.490 GiB)

julia> @time sort(x, alg = ThreadsX.QuickSort);
  2.001733 seconds (4.22 M allocations: 1.895 GiB, 5.03% gc time)

julia> @time sort(x, alg = ParallelMSDRadixSort);
  1.174623 seconds (134.32 k allocations: 1.496 GiB, 9.39% gc time)

julia> Threads.nthreads()
8

```

(All `@time`s are not the first run since `ParallelMSDRadixSort` seems to have a large compilation overhead ATM.)

---

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [May 21, 2021, 5:48am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/114 "2021-05-21T05:48:54Z")

</div>

Julia, you are my only hope to escape from the heavily templated clutches of evil C++ Emperor with an awful syntax!

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [May 21, 2021, 7:25am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/115 "2021-05-21T07:25:25Z")

</div>

Julia: Code that actually composes

---

<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:** [May 21, 2021, 10:41am UTC](https://discourse.julialang.org/t/in-as-few-lines-as-possible-describe-why-you-love-julia/33179/116 "2021-05-21T10:41:40Z")

</div>

> [@tkf](#):
>
> Yes, radix sort is great. So let’s [parallelize it](https://github.com/tkf/ParallelRadixSort.jl) 🙂

nice. I see the code is using MSD radix sort which only works if the data is “balanced” which happens to be the case for random data like this.

I would be interested in skewed data sorting with ParallelRadixsort!

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