April 22, 2015
On Tue, 2015-04-21 at 09:42 -0700, Parke via Digitalmars-d wrote:
> > 
[…]
> How should I modify the following script to encounter the problems of which you speak?
> 
> ----
> 
> unzip -q nim-0.10.2.zip

I think the issue here is that this is the "release" from a while back, whereas I am trying to build from master/HEAD of the Git repository. I hypothesize that the problem with building libzip occurred after 10.2.

> cd nim-0.10.2
> sh build.sh > /dev/null
> sh install.sh ../install_dir
> 
> cd ../install_dir
> echo 'echo "Hello, Nim world!"' > hello.nim
> nim/bin/nim c hello.nim
> echo
> ./hello
> 
> ----
> 
> When I run the script on my Ubuntu system, I get the following:
> 
> $ sh -x nim_test.sh
> + unzip -q nim-0.10.2.zip
> + cd nim-0.10.2
> + sh build.sh
> + sh install.sh ../install_dir
> Nim build detected
> copying files...
> installation successful
> + cd ../install_dir
> + echo echo "Hello, Nim world!"
> + nim/bin/nim c hello.nim
> config/nim.cfg(45, 2) Hint: added path: '/home/bake/.babel/pkgs/' [Path]
> config/nim.cfg(46, 2) Hint: added path: '/home/bake/.nimble/pkgs/' [Path]
> Hint: used config file
> '/usr/local/bake/tmp/install_dir/nim/config/nim.cfg' [Conf]
> Hint: system [Processing]
> Hint: hello [Processing]
> CC: hello
> CC: system
> [Linking]
> Hint: operation successful (8753 lines compiled; 1.230 sec total;
> 14.148MB) [SuccessX]
> + echo
> 
> + ./hello
> Hello, Nim world!
-- 
Russel.
=============================================================================
Dr Russel Winder     t:+44 20 7585 2200   voip:sip:
russel.winder@ekiga.net
41 Buckmaster Road   m:+44 7770 465 077   xmpp:russel@winder.org.uk
London SW11 1EN, UK  w: www.russel.org.uk skype:russel_winder


March 27, 2018
On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
> On Mon, Apr 13, 2015 at 10:28 AM, Timothee Cour <thelastmammoth@gmail.com> wrote:
>
>
> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.


I've created a git repo https://github.com/timotheecour/D_vs_nim/ with the goal: up to date and objective comparison of features between D and nim, and 1:1 map of features, tools, idioms and libraries to help D users learn nim and vice versa.
March 27, 2018
On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
> [snip]
>
> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.

In the comparison you made
https://github.com/timotheecour/D_vs_nim/
you say the CTFE engine for nim is a register VM. Stefan Koch's new CTFE is a bytecode interpreter. Is there an advantage of one over the other?
March 28, 2018
On 28/03/2018 1:02 AM, jmh530 wrote:
> On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
>> [snip]
>>
>> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.
> 
> In the comparison you made
> https://github.com/timotheecour/D_vs_nim/
> you say the CTFE engine for nim is a register VM. Stefan Koch's new CTFE is a bytecode interpreter. Is there an advantage of one over the other?
All application VM's use bytecode interpreters at some point in its layers.

Register versus stack VM's don't make too much of a difference.

newCTFE appears to be stack, just like .net CLR, JVM and Lua.
March 27, 2018
On Tuesday, 27 March 2018 at 01:19:44 UTC, timotheecour wrote:
> On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
>> On Mon, Apr 13, 2015 at 10:28 AM, Timothee Cour <thelastmammoth@gmail.com> wrote:
>>
>>
>> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.
>
>
> I've created a git repo https://github.com/timotheecour/D_vs_nim/ with the goal: up to date and objective comparison of features between D and nim, and 1:1 map of features, tools, idioms and libraries to help D users learn nim and vice versa.

How is RAII available in D? I did a quick search on this forum but didnt exactly find what I want

I found a comment for Walter (saying it was recently added https://forum.dlang.org/post/p1pa01$kc8$1@digitalmars.com)

What was the added feature that now enables RAII in D
March 27, 2018
that comment was regarding -betterC
RAII (with structs) has been available in D for a while, eg:

```d
struct A{
  ~this(){...}
}

void fun(){
  A a; // when a goes out of scope, will call dtor deterministically
}
```


On Tue, Mar 27, 2018 at 4:15 PM, Ali via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Tuesday, 27 March 2018 at 01:19:44 UTC, timotheecour wrote:
>>
>> On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
>>>
>>> On Mon, Apr 13, 2015 at 10:28 AM, Timothee Cour <thelastmammoth@gmail.com> wrote:
>>>
>>>
>>> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.
>>
>>
>>
>> I've created a git repo https://github.com/timotheecour/D_vs_nim/ with the goal: up to date and objective comparison of features between D and nim, and 1:1 map of features, tools, idioms and libraries to help D users learn nim and vice versa.
>
>
> How is RAII available in D? I did a quick search on this forum but didnt exactly find what I want
>
> I found a comment for Walter (saying it was recently added https://forum.dlang.org/post/p1pa01$kc8$1@digitalmars.com)
>
> What was the added feature that now enables RAII in D
March 28, 2018
On Tuesday, 27 March 2018 at 12:02:37 UTC, jmh530 wrote:
> On Wednesday, 22 April 2015 at 06:03:07 UTC, Timothee Cour wrote:
>> [snip]
>>
>> I would like to refocus this thread on feature set and how it compares to D, not on flame wars about brackets or language marketing issues.
>
> In the comparison you made
> https://github.com/timotheecour/D_vs_nim/
> you say the CTFE engine for nim is a register VM. Stefan Koch's new CTFE is a bytecode interpreter. Is there an advantage of one over the other?

newCTFE can have different backends, tough the current default is a register based vm with a limited number of regs (16384).

March 29, 2018
On Tuesday, 27 March 2018 at 23:23:10 UTC, Timothee Cour wrote:
> that comment was regarding -betterC
> RAII (with structs) has been available in D for a while, eg:
>
> ```d
> struct A{
>   ~this(){...}
> }
>
> void fun(){
>   A a; // when a goes out of scope, will call dtor deterministically
> }
> ```
>
>
> On Tue, Mar 27, 2018 at 4:15 PM, Ali via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>> On Tuesday, 27 March 2018 at 01:19:44 UTC, timotheecour wrote:
>>> [...]
>>
>>
>> How is RAII available in D? I did a quick search on this forum but didnt exactly find what I want
>>
>> I found a comment for Walter (saying it was recently added https://forum.dlang.org/post/p1pa01$kc8$1@digitalmars.com)
>>
>> What was the added feature that now enables RAII in D

This is deterministic destruction and not RAII. Resource is never *acquired* here. Lack of default constructors for struct in D makes it impossible to achieve the RAII as in C++.
March 29, 2018
On 28/03/18 02:23, Timothee Cour wrote:
> that comment was regarding -betterC
> RAII (with structs) has been available in D for a while, eg:
> 
> ```d
> struct A{
>    ~this(){...}
> }
> 
> void fun(){
>    A a; // when a goes out of scope, will call dtor deterministically
> }
> ```
> 

Not so long as destructors don't reliably run.

$ dmd --version
DMD64 D Compiler v2.079.0
Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved written by Walter Bright

$ cat test.d
import std.stdio;

struct A {
    int a;

    this(int a) {
        this.a = a;

        writefln("A(%s) constructed", a);
    }

    ~this() {
        writefln("A(%s) destructed", a);
    }
}

struct B {
    A a;

    this(int val) {
        a = A(val);
        throw new Exception("Constructor failed");
    }
}

void main() {
    try {
        auto a = A(1);
        auto b = B(2);
    } catch(Exception ex) {
        writefln("Caught: %s", ex.msg);
    }
}

$ rdmd test.d
A(1) constructed
A(2) constructed
A(1) destructed
Caught: Constructor failed

https://issues.dlang.org/show_bug.cgi?id=14246
March 29, 2018
On Thursday, 29 March 2018 at 09:45:04 UTC, Shachar Shemesh wrote:
>
> Not so long as destructors don't reliably run.
>
> $ rdmd test.d
> A(1) constructed
> A(2) constructed
> A(1) destructed
> Caught: Constructor failed
>
> https://issues.dlang.org/show_bug.cgi?id=14246

Good catch. This is a variant of bug reported 5 years ago. The funny part of this bug is that the fix was reverted ... because of excessive code breakage.

I like D pretty much and wish to use it in serious code, but I cannot tolerate such sort of things.