# Version 1.0 released of Nim Programming Language

**URL:** <https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099>\
**Category:** Offtopic\
**Created:** [September 24, 2019, 2:48am UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099 "2019-09-24T02:48:42Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![vitreo12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vitreo12/32/4028_2.png) [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Post date:** [September 25, 2019, 11:51am UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/21 "2019-09-25T11:51:46Z")

</div>

> [@mauro3](#):
>
> As discussed recently on Slack, Nim had multiple dispatch and ditched it before 1.0:

Julia and Nim user here. I just want to add that multipe dispatch in Nim was only ditched for methods, which are functions (or `proc`s, in Nim lingo) that belong to a specific object. Sort of class methods in C++.

While multiple dispatch is not Nim’s main feature, it is still possible to achieve some of its behaviour with plain `proc`s. Check these two simple examples:

> <https://github.com/vitreo12/NimExperiments/blob/master/GenericMultipleDispatch.nim>

> <https://github.com/vitreo12/NimExperiments/blob/master/MultipleDispatch.nim>

Moreover, by using the compile time `when` statement, it is quite possible to dispatch anything.

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [September 25, 2019, 12:09pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/22 "2019-09-25T12:09:30Z")

</div>

OK, well, in the context of scientific computing you sometimes even want such a distinction (cf. upper case letters for matrices and lower case for vectors/scalars).  
But as I said, it’s not a show-stopper in my opinion 😉

---

<div class="post-metadata">

**Author:** ![ninjaaron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ninjaaron/32/6392_2.png) [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Post date:** [September 25, 2019, 12:39pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/23 "2019-09-25T12:39:14Z")

</div>

> [@jling](#):
>
> I’ve never heard of case-insensitive modern language till today…

Not sure if you’d consider Object Pascal modern (of which Delphi is the most famous implementation, but most people today use Free Pascal/Lazarus), but the original Nim compiler was implemented in it and Nim borrows a lot of ideas from the language, including case insensitivity.

---

<div class="post-metadata">

**Author:** ![ninjaaron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ninjaaron/32/6392_2.png) [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Post date:** [September 25, 2019, 12:40pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/24 "2019-09-25T12:40:56Z")

</div>

> [@tamasgal](#):
>
> OK, well, in the context of scientific computing you sometimes even want such a distinction (cf. upper case letters for matrices and lower case for vectors/scalers).

😑

I wish scientists were more inclinded to use descriptive names.

---

<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:** [September 25, 2019, 12:49pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/25 "2019-09-25T12:49:00Z")

</div>

> [@ninjaaron](#):
>
> 😑
> 
> I wish scientists were more inclinded to use descriptive names.

But very often, there _is no description_ to make; `f` is short for “function”, `A` means “matrix”, `x` means “x component of a position” or “unknown value of whatever sort”. And they go into large mathematical expressions, with `sin`s and `sqrt`s and `^2`.

Making descriptive names often means “make expressions harder to read for no good reason.”

---

<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:** [September 25, 2019, 1:02pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/26 "2019-09-25T13:02:52Z")

</div>

> [@tamasgal](#):
>
> But as I said, it’s not a show-stopper in my opinion

I guess a lot of things that look weird to outsiders can feel natural to the users of a language, or at least not bothersome enough to make a breaking change. Personally I find Python-style indentation syntax equally alien. But if Nim users like it, them I am happy for them 😉

---

<div class="post-metadata">

**Author:** ![ninjaaron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ninjaaron/32/6392_2.png) [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Post date:** [September 25, 2019, 1:09pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/27 "2019-09-25T13:09:54Z")

</div>

That can certainly be the case for generic functions that don’t care about the contents of the collections they are working with, which might be appropriate if someone is designing their own collection type and implementing `broadcast`, `filter`, et al. The same would apply to generic algorithms.

Once the meaning of the elements in the collection is known, it’s time to start using names related to that meaning.

---

<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:** [September 25, 2019, 1:45pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/28 "2019-09-25T13:45:41Z")

</div>

Usually, I try to use descriptive names for things in the module scope, while I use non-descript mathematical abbreviations for local names inside functions.

This way I can easily tell if a name is local to the function or if it is from a module. Local names can be understood by viewing the code locally and seeing how it is defined… not much further description needed. Module scope names need more descriptive names because the code is in a different place.

Also, using shorter local variable names allows me to fit more code on the screen, seeing more at once.

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 1:47pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/29 "2019-09-25T13:47:18Z")

</div>

Valid concern, but this is not how it works: `N` is different than `n`, etc, the first letter doesnt count: the main usage is that

`a_b` == `aB` etc

and if you think about it … having `abC` be different var than `aBc` is a typo waiting to happen, so i think its ok

but still: `i` and `I` are different

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 1:49pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/30 "2019-09-25T13:49:28Z")

</div>

you can probably simulate multiple dispatch with a good macro, also the plan is to maybe keep a version of it, but not use it by default , as for most nim usecases simpler static dispatch is much faster

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 1:53pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/31 "2019-09-25T13:53:46Z")

</div>

this is _not_ true:

`x` is different than `X`

`x_y` is the same as `xY` etc, but the first letter matters

Otherwise you’re right that the lang is influenced by those, good lang history 🙂 other influences are probably python, oberon, lisp etc

---

<div class="post-metadata">

**Author:** ![Maurizio\_Tomasi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maurizio_tomasi/32/384_2.png) [@Maurizio\_Tomasi](https://discourse.julialang.org/u/Maurizio_Tomasi)\
**Post date:** [September 25, 2019, 2:16pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/32 "2019-09-25T14:16:34Z")

</div>

Yeah, my comment about the awesomeness of case-insensitivity was not clear. I have not programmed that much in Nim, but used Pascal a _awful_ lot: that was the time when this feature grew on me.

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 2:18pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/33 "2019-09-25T14:18:01Z")

</div>

yes, just correcting because it is an important difference: nim itself usually uses `x` for variables and `X` for type

pascal was huge in my country as well, i think some schools still might teach it!

---

<div class="post-metadata">

**Author:** ![ninjaaron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ninjaaron/32/6392_2.png) [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Post date:** [September 25, 2019, 2:33pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/34 "2019-09-25T14:33:00Z")

</div>

> [@chakravala](#):
>
> Local names can be understood by viewing the code locally and seeing how it is defined…

Eventually, yes. In my experience, descriptive names make a big difference in the amount of time it takes me to understand complex functions. Descriptive names are less important in short definitions.

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [September 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/35 "2019-09-25T15:52:23Z")

</div>

I love the irony of this thread 🙂

---

<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:** [September 25, 2019, 4:24pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/36 "2019-09-25T16:24:15Z")

</div>

What about leading and trailing underscore? And what about unicode?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 25, 2019, 4:37pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/37 "2019-09-25T16:37:57Z")

</div>

The algorithm is here  
[https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality](https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality)  
(also linked above)

---

<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:** [September 25, 2019, 5:04pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/38 "2019-09-25T17:04:27Z")

</div>

But apparently [`toLowerAscii`](https://nim-lang.org/docs/strutils.html#toLowerAscii,string) only works for `A-Z`, so it is unclear what happens if there is anything else in the string. An error?

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 6:06pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/39 "2019-09-25T18:06:32Z")

</div>

no leading and trailing underscores iirc: which i think is good. I guess your usecase is x` ?  
it seems unicode idents are fine, but i only tested with cyrilic

---

<div class="post-metadata">

**Author:** ![alehander42](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alehander42/32/10477_2.png) [@alehander42](https://discourse.julialang.org/u/alehander42)\
**Post date:** [September 25, 2019, 6:08pm UTC](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099/40 "2019-09-25T18:08:42Z")

</div>

otherwise the char is not converted, so `aЯ` remains != `aя`

[Previous page](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099.md?page=1)

[Next page](https://discourse.julialang.org/t/version-1-0-released-of-nim-programming-language/29099.md?page=3)
