# How does Julia compare with Nim, Go and Crystal for Artificial Intelligence?

**URL:** <https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631>\
**Category:** Offtopic\
**Tags:** question\
**Created:** [June 27, 2021, 5:52am UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631 "2021-06-27T05:52:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![development\_mentor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/development_mentor/32/26533_2.png) [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Post date:** [June 27, 2021, 5:52am UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/1 "2021-06-27T05:52:31Z")

</div>

Hello, I’m new to programming and I considered these languages. Firstly I choose Julia as it is simple and said it’s built for computing specifically. But when compared with other languages like nim it is slower in that area. Is Julia becoming general language?

---

<div class="post-metadata">

**Author:** ![Tomas\_Pevny](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomas_pevny/32/25466_2.png) [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Post date:** [June 27, 2021, 9:08am UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/2 "2021-06-27T09:08:23Z")

</div>

But julia is general purpose programming language.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [June 27, 2021, 9:14am UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/3 "2021-06-27T09:14:58Z")

</div>

> [@development\_mentor](#):
>
> when compared with other languages like nim it is slower in that area

what is slower?

> [@development\_mentor](#):
>
> Is Julia becoming general language?

Julia has always been. If you think Python is general language (it is a glue in reality), then Julia is no less general.

---

<div class="post-metadata">

**Author:** ![development\_mentor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/development_mentor/32/26533_2.png) [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Post date:** [June 27, 2021, 12:56pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/4 "2021-06-27T12:56:09Z")

</div>

It is slower when calculating digits of pi, matrix multiplication(by some tests) and this one: [https://lh3.github.io/2020/05/17/fast-high-level-programming-languages](https://lh3.github.io/2020/05/17/fast-high-level-programming-languages) it shows that nim and crystal are both faster.  
For the general language part, I don’t really know what I meant by that, guess I just did too little research.

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [June 27, 2021, 1:54pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/5 "2021-06-27T13:54:32Z")

</div>

> [@development\_mentor](#):
>
> calculating digits of pi, matrix multiplication(by some tests)

these are examples of highly optimized (down to assembly code) subroutine, there’s not reason to think Julia should magically be faster.

I don’t know what that bio stuff benchmark is doing, see:

> [@lhe/Biofast benchmark | FASTQ parsing \[Julia,Nim,Crystal,Python,...\]](https://discourse.julialang.org/t/lhe-biofast-benchmark-fastq-parsing-julia-nim-crystal-python/39747/53):
>
> Just to be more explicit about the complete logical fallacy here, extrapolation from pre-v1.0 makes absolutely no sense. In the last few months before v1.0 was out, all of the dev discussions were like “okay, we have 6 months left to break anything. After v1.0, they are fixed forever. So what are all of the syntax choices you don’t like? What are all of the naming choices you think are inconsistent? What are all of the weird workarounds you think should be removed? Okay, let’s triage, make decis…

but there are plenty of examples where Julia is faster than X:

> **[Julia: Fast as Fortran, Beautiful as Python](https://fortran-lang.discourse.group/t/julia-fast-as-fortran-beautiful-as-python/1405)**
>
> Here is an article and the associated Hacker News discussion where they compare Fortran and Julia and concluded that Fortran was slower: Julia: Faster than Fortran, cleaner than Numpy | Hacker News Here is the Fortran benchmark: ...

And finally, the point is not “Julia is always faster than everyone in any cases no matter what”, that’s just impossible. Also it doesn’t matter, hell, if python is just 10x slower in almost all cases, say, compare to today’s Julia. we won’t need millions of lines of code for Numpy Numba and numerous C/C++ code piles on top of each other and Julia may never be invented in the first place.

To this end, I don’t see how Nim, Go, Crystal, Rust are replacement: there’s not enough user (think grad students in science who never took formal training in CE) facing high level library and scripting ability.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [June 27, 2021, 2:10pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/6 "2021-06-27T14:10:26Z")

</div>

> [@development\_mentor](#):
>
> It is slower when calculating digits of pi, matrix multiplication(by some tests)

@jling has already linked the FASTQ parsing discussion, so all I’ll say here is that Julia is the _only_ language mentioned here which gets anywhere near to optimized native matmul performance on [CPU](https://github.com/JuliaLinearAlgebra/Octavian.jl) and [GPU](https://github.com/JuliaGPU/GemmKernels.jl). You might have microbenchmarks of naive implementations in Nim/Go/Crystal, but to my knowledge none of them have tried a realistic performance comparison.

But back to your original question: how does Julia stack up for “AI”? Well, it’s not even close. Ecosystem-wise, Julia wipes the floor with the other 3 languages for almost every subfield of “AI” you can think of. Frankly, Nim is the only one that has _any_ claim of being a decent language for ML, as the other 2 have a mostly non-existent ecosystem there. As a point of comparison, how many other languages (excluding Python and C++, of course) have pulled off something like [GitHub - jonathan-laurent/AlphaZero.jl: A generic, simple and fast implementation of Deepmind's AlphaZero algorithm.](https://github.com/jonathan-laurent/AlphaZero.jl)? I’m not even going to mention SciML because that would be like bringing out the steel chair when your opponent is already on the ground 😄

---

<div class="post-metadata">

**Author:** ![development\_mentor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/development_mentor/32/26533_2.png) [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Post date:** [June 27, 2021, 2:22pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/7 "2021-06-27T14:22:19Z")

</div>

Thank you all @jling, @ToucheSir, and @Tomas_Pevny for your help in considering me to use julia. I just have one last question - is Julia going to get even more optimized for AI and ML. Do you think that nim has a chance?

---

<div class="post-metadata">

**Author:** ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Post date:** [June 27, 2021, 2:24pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/8 "2021-06-27T14:24:49Z")

</div>

> [How does Julia compare with Nim, Go and Crystal for Artificial Intelligence?](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631)

IMHO:  
check and compare **the number of AI/ML/AD-related** :

- talks at the Julia/Nim/… Conferences.
  - 28th to 30th of July, 2021 [JuliaCon 2021 & JuMP-dev, Everywhere on Earth](https://juliacon.org/2021/)
    - [https://pretalx.com/juliacon2021/featured/](https://pretalx.com/juliacon2021/featured/)

- talks at Youtube
  - [https://www.youtube.com/channel/UC9IuUwwE2xdjQUT\_LMLONoA](https://www.youtube.com/channel/UC9IuUwwE2xdjQUT_LMLONoA)

- research papers
  - [Research](https://julialang.org/research/#publications)
  - [https://proceedings.juliacon.org/](https://proceedings.juliacon.org/)

- GSoC/JSoC Projects
  - [View all GSoC/JSoC Projects](https://julialang.org/jsoc/allprojects/)

- packages / number of contributors
  - [AI · Julia Packages](https://juliapackages.com/c/ai)

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [June 27, 2021, 2:31pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/9 "2021-06-27T14:31:22Z")

</div>

To your first question, absolutely. Julia ML is growing pretty rapidly, and I see no reason for that progress to stop any time soon. Many core compiler improvements have been driven by or directly affect ML libraries, so there’s a good feedback loop in place too.

To your second question, _any_ general-purpose language has a chance to be useful for ML. Theoretically, there should be no hard bounds on Nim’s performance (c.f. Elixir Nx, which is completely constrained by FFI and performance of libraries written in another langauge), but (much like you’d compare Python to Julia) Julia’s ML ecosystem currently has an order of magnitude more users, contributors and real-world deployments. I think this social aspect is often discounted in language comparisons, but it really is one of the most important factors in making a language viable for a particular application domain.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 27, 2021, 2:31pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/10 "2021-06-27T14:31:54Z")

</div>

> [@ImreSamu](#):
>
> talks at the Julia/Nim/… Conferences.

> **[NimConf 2021](https://conf.nim-lang.org/)**
>
> NimConf 2021 will take place on June 26th at 11am UTC. Streamed live and for free from YouTube.

NimConf was held yesterday. From the titles I could spot 0 talks about artificial intelligence, machine learning, or any other topic even loosely related to scientific computing in general.

---

<div class="post-metadata">

**Author:** ![development\_mentor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/development_mentor/32/26533_2.png) [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Post date:** [June 27, 2021, 4:18pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/11 "2021-06-27T16:18:49Z")

</div>

Okay, thanks you’re right. Julia is the right choice for scientific computing and everything with AI. Hope that will be its primary focus forever. I can’t see any other language having soo many AI / ML related packages and people focus on it. But really the last thing or two. Is TensorFlow.jl the same as the python version(does it have all the features). And how would you go about doing reinforcement learning in julia?  
Thanks in advance Julia community, especially you for answering my question.

---

<div class="post-metadata">

**Author:** ![Tomas\_Pevny](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomas_pevny/32/25466_2.png) [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Post date:** [June 27, 2021, 7:03pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/12 "2021-06-27T19:03:26Z")

</div>

I think that TensorFlow.jl is largely abandoned project, as most now use Flux or Knet. There is no reason why you cannot do RL with Flux and I guess some people do.

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [June 28, 2021, 5:55pm UTC](https://discourse.julialang.org/t/how-does-julia-compare-with-nim-go-and-crystal-for-artificial-intelligence/63631/13 "2021-06-28T17:55:38Z")

</div>

There’s [https://juliareinforcementlearning.org/](https://juliareinforcementlearning.org/)
