My feelings on Python and Nim

2019-01-15 Thread liwt31
Just some personal feelings on what I'm actually doing when I'm working with Python and Nim: Python: Nim: Python is no doubt quick to write, but debugging is very painful even with various powerful testing and debugging tools. Nim requires me to think a lot about how to design my code,

Re: Python Modules & why Python is better

2019-01-15 Thread liwt31
Yeah, that's my point. Maybe the `nimrtl.dll` approach should be taken for these python packages? I think it will probably bring back [this issue](https://github.com/nim-lang/Nim/issues/8405).

Re: Python Modules & why Python is better

2019-01-14 Thread liwt31
Nice work, but I'm curious on what will happen if I import more than one of your packages in one python script. IIRC, I can't have multiple Nim GC instances in one process, otherwise the GC module will not behave properly and finally leads to crash.

Re: New "Learn Nim" page

2019-01-14 Thread liwt31
It's working now. A very inspiring tutorial. Many thanks to all authors.

Re: New "Learn Nim" page

2019-01-10 Thread liwt31
The macor tutorial link leads to 404...[https://nim-lang.org/docs/tut3.html](https://nim-lang.org/docs/tut3.html)

Re: When's GCunref() necessary

2019-01-02 Thread liwt31
Thanks. But I'm still under the impression that `d.s = "abc"` increases the ref count of `"abc"`. If I understand correctly `d.s = "abc"` will lead to the execution of the following function: proc unsureAsgnRef(dest: PPointer, src: pointer) {.compilerProc.} = #

When's GCunref() necessary

2019-01-01 Thread liwt31
I noticed the following example in the nim manual to demonstrate how to use an untraced object: type Data = tuple[x, y: int, s: string] # allocate memory for Data on the heap: var d = cast[ptr Data](alloc0(sizeof(Data))) # create a new string on the

Re: Happy New Year! Version 0.19.2 released!

2019-01-01 Thread liwt31
Happy new year and many thanks to the contributors!

Re: How to achieve "mechanical substitution" like C macro

2018-12-29 Thread liwt31
Exactly what I wanted. I've tried this before: template POP: int = result = stack[p] dec p Run and realized it won't work, then I went in the wrong direction (to put it in one line)... That solves my probem, many thanks to you all.

How to achieve "mechanical substitution" like C macro

2018-12-28 Thread liwt31
Hello everyone! I'm hand-writing a "stack" located in runtime function "stack" for some CPU-intensive task. What I wish to achieve is something like: proc main = # in my case no need for boundary check stack = array[10, int] p = -1 # define some operations

Re: Explaination on GC-safety warning of Nim compiler

2018-12-21 Thread liwt31
Yes, I think that's exactly what I wanted. Thank you!

Re: Explaination on GC-safety warning of Nim compiler

2018-12-21 Thread liwt31
Yes, I think that's exactly what I wanted. Thank you!

Explaination on GC-safety warning of Nim compiler

2018-12-03 Thread liwt31
Hello, I'm new to Nim and I'm learning it by making some little apps, reading _Nim in Action_ and so on. During my exploration I found that with higher verbosity level the compiler complains my code on GC-safety with a warning like `Warning: not GC-safe: 'foo()' [GcUnsafe]`. I've tried to look