April 25, 2018
In case you guys like to take a quick look at new emerging,
but somewhat unknown systems programming languages:
* https://www.red-lang.org/ (own handwritten backend)
* https://crystal-lang.org/ (llvm-based backend)
* https://ziglang.org/ (llvm-based backend)
* http://nitlanguage.org/ (c-based backend?)
* https://www.xojo.com/ (llvm-based backend)


May 03, 2018
On Friday, 10 April 2015 at 21:26:35 UTC, bachmeier wrote:
> On Friday, 10 April 2015 at 18:52:24 UTC, weaselcat wrote:
>> The only things I've read about nim have been on the D forums - it seems the wikipedia article is even being considered for deletion due to not being noteworthy. So I think you might have trouble finding any comparisons.
>
> Read the comments sections on other languages on Reddit programming and you'll see their spam all over the place.
>
> I've never used Nim (and don't plan to because I've been turned off by their constant spamming of comment threads on Reddit) but the numerous comments I've seen repeatedly indicate that Nim is not yet ready for real use.

This is a fair set of critiques as far as the spamming goes.  The NIM project founder is sort of a one person show in development and promotion.  I wouldn't say it is not ready for real (commercial) use without being objective, as you have to really characterize what those requirements are.  If one considers commercial criteria to be something like: toolchain quality, IDE support, documentation, platform support, sustainable community, fair licensing terms, significant technical merits, actual adoption in the enterprise or research community, and commercial support available.  I'd agree that if your graded NIM across these criteria, it doesn't score high.  What impresses me about it are the technical merits, platform support, and its toolchain.

Disclosure, I did actually use NIM before posting.  I wrote a module called huenim which handles basic Philips HUE communication.  I found the experience to be a mixed bag.  I was impressed that the project lead of NIM was available to help me in my struggles around UPnP.  But there just is not enough great documentation with sample code, at the level I like when I am picking up a new language.  The syntax bothers me, but that's just my own issue with too many years of Java and C.  Another thing that really impressed me was how easy it was to bootstrap the language on an ARM device, particularly AARCH64.  The total runtime size is small as well.  Would I use it for my company?  Yes.  Is there risk in doing this?  Yes.  Hard to recruit NIM coders.  Hard to know what is the long term sustainability of the NIM community and project as a whole.

I still would say that on the ready for "real" commercial use, D would get a much higher grade on more categories.
May 03, 2018
On Wednesday, 25 April 2018 at 14:18:07 UTC, Rel wrote:
> In case you guys like to take a quick look at new emerging,
> but somewhat unknown systems programming languages:
> * https://www.red-lang.org/ (own handwritten backend)
> * https://crystal-lang.org/ (llvm-based backend)
> * https://ziglang.org/ (llvm-based backend)
> * http://nitlanguage.org/ (c-based backend?)
> * https://www.xojo.com/ (llvm-based backend)

Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
May 03, 2018
On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.

What qualifies under "static if"? Because Rust, Swift and Nim do have conditional compilation.
https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html (conditional compilation blocks)
https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
May 03, 2018
On Thursday, 3 May 2018 at 20:57:16 UTC, Dennis wrote:
> On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
>> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
>
> What qualifies under "static if"? Because Rust, Swift and Nim do have conditional compilation.
> https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
> https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html (conditional compilation blocks)
> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement

Fair enough. I should have written "static if + CTFE".
May 03, 2018
nim supports static if (`when`) + CTFE. A simple google search or searching
would've revealed that.

On Thu, May 3, 2018 at 3:20 PM Mark via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Thursday, 3 May 2018 at 20:57:16 UTC, Dennis wrote:
> > On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
> >> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
> >
> > What qualifies under "static if"? Because Rust, Swift and Nim do have conditional compilation.
> >
https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
> >
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html (conditional compilation blocks)
> >
https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement

> Fair enough. I should have written "static if + CTFE".
May 04, 2018
On Thursday, 3 May 2018 at 23:09:34 UTC, Timothee Cour wrote:
> nim supports static if (`when`) + CTFE. A simple google search or searching
> would've revealed that.
>
> On Thu, May 3, 2018 at 3:20 PM Mark via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
>
>> On Thursday, 3 May 2018 at 20:57:16 UTC, Dennis wrote:
>> > On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
>> >> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
>> >
>> > What qualifies under "static if"? Because Rust, Swift and Nim do have conditional compilation.
>> >
> https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
>> >
> https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html (conditional compilation blocks)
>> >
> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
>
>> Fair enough. I should have written "static if + CTFE".

The little information on the official site describes `when` more like #ifdef in C than an actual static if. I also went over a few dozens of modules in the standard library and the statement seems to be rarely used, and when it does it's usually in an #ifdef-ish context (like platform specific code).

Perhaps Nim's support for conditional compilation is as powerful as D's is, but you can see why my impression is currently to the contrary.
May 04, 2018
i think the explanation in
https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
is pretty clear. In any case you can see for yourself:
nim c -r main.nim
```nim
proc fun(a:int):auto=a*a
static: # makes sure block evaluated at CT
   when fun(1)==1: echo "ok1"
   when fun(2)==2: echo "ok2"
```
prints ok1


On Fri, May 4, 2018 at 9:40 AM Mark via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Thursday, 3 May 2018 at 23:09:34 UTC, Timothee Cour wrote:
> > nim supports static if (`when`) + CTFE. A simple google search
> > or searching
> > would've revealed that.
> >
> > On Thu, May 3, 2018 at 3:20 PM Mark via Digitalmars-d < digitalmars-d@puremagic.com> wrote:
> >
> >> On Thursday, 3 May 2018 at 20:57:16 UTC, Dennis wrote:
> >> > On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
> >> >> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
> >> >
> >> > What qualifies under "static if"? Because Rust, Swift and Nim do have conditional compilation.
> >> >
> >
https://doc.rust-lang.org/book/first-edition/conditional-compilation.html
> >> >
> >
https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html (conditional compilation blocks)
> >> >
> >
https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
> >
> >> Fair enough. I should have written "static if + CTFE".

> The little information on the official site describes `when` more like #ifdef in C than an actual static if. I also went over a few dozens of modules in the standard library and the statement seems to be rarely used, and when it does it's usually in an #ifdef-ish context (like platform specific code).

> Perhaps Nim's support for conditional compilation is as powerful as D's is, but you can see why my impression is currently to the contrary.
May 08, 2018
On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
> On Wednesday, 25 April 2018 at 14:18:07 UTC, Rel wrote:
>> In case you guys like to take a quick look at new emerging,
>> but somewhat unknown systems programming languages:
>> * https://www.red-lang.org/ (own handwritten backend)
>> * https://crystal-lang.org/ (llvm-based backend)
>> * https://ziglang.org/ (llvm-based backend)
>> * http://nitlanguage.org/ (c-based backend?)
>> * https://www.xojo.com/ (llvm-based backend)
>
> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.

Zig has implicit static if:

test "static if" {
    if (false) {
        @compileError("this is never analyzed");
    }
}

$ zig test test.zig
Test 1/1 static if...OK

test "static if" {
    if (true) {
        @compileError("this is analyzed");
    }
}

$ zig test test.zig
test.zig:3:9: error: this is analyzed
        @compileError("this is analyzed");
        ^

May 14, 2018
On Thursday, 3 May 2018 at 19:11:05 UTC, Mark wrote:
> Funnily, none of these languages have a "static if" construct, nor do Rust, Swift and Nim. Not one that I could find, anyway.
So what's a big deal in having 'static if' construct? Most of the
new programming languages that compiles to native code like Nim,
Crystal, Rust, Red and etc have good enough meta-programming
support anyways.