Re: Why is my destructor not called?

2018-03-15 Thread lotzz
> I am on Windows 10, Nim Compiler Version 0.18.0 [Windows: i386], MinGW GCC. I don't know if that is just for windows 10, I am on ubuntu with 0.18.0 and I am getting the same thing though my code is a little different {.experimental.} type thing = object x:int

Re: Nim .18.0 whitespace issue

2018-03-15 Thread h42
Stass, the original program err messgae was "not all cases are covered" and pointed to the start of the case statement which included the expression and it was around 30 lines from the actual error. It was hard to find because it is legal syntax in c++, python etc. It is something that I will

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread miran
> scientists are also using Python and for any kind of data munching, a repl > and a data visualization package are non-negotiable. As a (wannabe) scientist, I can confirm. Jupyter Notebooks are the tool of trade and they are very very helpful when prototyping. I was pleasantly surprised when

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread miran
> Since vscode doesn't work on all platforms Wait, what? [https://code.visualstudio.com/Download](https://code.visualstudio.com/Download) \- you can have it on Windows, Linux, and Mac.

Re: Increasing Nim exposure

2018-03-15 Thread wavexx
And I would like to add that I would be fine if the mailing list address is added somewhere in the official nim site and/or to change it (for example to use a nim-lang.org subdomain). The GMane address is also public for anybody to use and thus can be listed publicly. As I stated, it's

Re: Increasing Nim exposure

2018-03-15 Thread wavexx
I'm already doing that. nim-general@thregr.org is live and working. The gmane nntp group I gave is also live and working for anybody interested.

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread mratsim
You can't reply to questions that people don't ask, to get more people asking, we need to attract them. Also you might not need a REPL but you cannot generalize your case with the need of the millions of Python developers in the world. Besides you have to look beyond devs, scientists are also

Re: nim/ui

2018-03-15 Thread mratsim
This is a setter proc: [https://nim-lang.org/docs/manual.html#procedures-properties](https://nim-lang.org/docs/manual.html#procedures-properties)

Re: Structural typing hack PoC

2018-03-15 Thread StasB
@andrea: Thanks! I'll check it out.

Re: Nim .18.0 whitespace issue

2018-03-15 Thread StasB
> My real problem was the bad error message pointing to the wrong statement. I'm not sure what you mean by "pointing to the wrong statement". They point to the line where the error occurs, and correctly tell you what the failure is. In the first case, the compiler tells you that the `for`

nim/ui

2018-03-15 Thread frogEye
Hi have been working with nim/ui for a month or so now. I can see a peice of code in which I dnt understand in the wrapper. proc `margined=`*(t: Tab; page: int; x: bool) = tabSetMargined(t.impl, page.cint, cint(x)) and how to use it. The signature resembles to operator

Re: Nim .18.0 whitespace issue

2018-03-15 Thread h42
Thanks for the explanation. I saw the release note about ..< but I didn't know about the ..number shortcut. I figured nim saw -1 in x -1 as a negative 1. My real problem was the bad error message pointing to the wrong statement.

Re: How to turn thread spawn call into an async call

2018-03-15 Thread adrianv
you can also busy poll the result of the spawned proc in an async proc like that: import os, asyncdispatch, threadpool proc doWork(): bool = # staff use sql echo "starting..." sleep(5000) # complete the future var echo "... ok"

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread mratsim
Didn't try it yet, but is that a REPL is 140 lines of code? [https://github.com/AndreiRegiani/INim](https://github.com/AndreiRegiani/INim)

Re: Increasing Nim exposure

2018-03-15 Thread federico3
wavexx: for some time the forum was able to mirror posts to dedicated mailing list. Unfortunately the SMTP integration has been shut down. There was also an attempt at receiving messages from the mlist using POP - see [https://github.com/nim-lang/nimforum](https://github.com/nim-lang/nimforum)

Re: Structural typing hack PoC

2018-03-15 Thread andrea
This is not my work, butif you are interested, I had already collected something by @Krux02 similar to your work and published as a nimble package, now improved by @RSDuck [https://github.com/andreaferretti/interfaced](https://github.com/andreaferretti/interfaced)

Compiling nim/ui in linux

2018-03-15 Thread frogEye
I have developed a Tool for managing my driver using nim/ui. There two options below which i used to compile my tool on linux. 1\. nim c --cc:gcc --threads:on driver.nim 2\. nim c --threads:on driver.nim option 2 works but option 1 doesnt compile the libui library. Its strange anyways gcc

Re: How to turn thread spawn call into an async call

2018-03-15 Thread slangmgh
@2vg asyncpg is good, thank you!

Re: Nim .18.0 whitespace issue

2018-03-15 Thread StasB
`..2` is a shortcut for `0..2`, so to the parser it looks like you have two expressions following the `in`, and it tells you there should be a colon after the first one. In your second example, `-10` is the literal for "minus ten", so again, you have two expressions after the `=`.

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread mashingan
IMO, what appeal most I think is OOP, although to be honest I think OOP is overrated. Crystal, which same as Ruby, seems emphasizing OOP.

Re: What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread StasB
To really appeal to Python programmers, Nim would have to support dynamic compilation and a REPL. The lack of it makes a much bigger difference to a programmer's workflow than superficial syntax changes, or even stricter typing rules.

Interface <> Implementation

2018-03-15 Thread adamlevine
Code: interface type TForm2 = class(TForm) procedure Shaders(var aShaderProgram: glUInt); ... implementation procedure TForm2.Shaders; How come it is possible that I can compile and run this?

Re: Structural typing hack PoC

2018-03-15 Thread StasB
@boia01: Oh, I wasn't trying to imply you're dissing it. Just wasn't sure what you meant, but now I'm also looking forward to the built-in solution, which is always preferable for this sort of thing. Nim is still the only language I know of that has all the elements needed to implement it on

What can we learn from the SO 2018 Dev Survey?

2018-03-15 Thread Libman
[https://insights.stackoverflow.com/survey/2018](https://insights.stackoverflow.com/survey/2018) ^ I'd like to propose this as a discussion topic. Some brief thoughts: * **Python 's popularity is growing** (and all other measures seem to confirm). * I still think it would benefit Nim to

Re: How to turn thread spawn call into an async call

2018-03-15 Thread slangmgh
Find a way to solve the problem. Here is the code: proc doWork(evt: AsyncEvent) {.gcsafe.} = sleep(3000) evt.trigger() echo "work over" proc waitEvent(ev: AsyncEvent): Future[void] = var fut = newFuture[void]("waitEvent") proc cb(fd:

Re: How to turn thread spawn call into an async call

2018-03-15 Thread 2vg
Have you tried this? [asyncpg](https://github.com/cheatfate/asyncpg) To wait for some result of Spawn's task, you can confirm by using isReady() function. For example, [ChatApp#L38](https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L38)

Re: Structural typing hack PoC

2018-03-15 Thread boia01
@StasB - Sorry didn't mean to diss your hack - it's very cool and very similar to the upcoming vtrefs. Concepts should support field access too. Being an OO junky, I'm just looking forward to this kind of stuff supported as a first-class feature in Nim.

Re: Nim .18.0 whitespace issue

2018-03-15 Thread twetzel59
I _think_ so. This may have changed recently (since 0.18.0). [Here is the changelog](https://nim-lang.org/blog/2018/03/01/version-0180-released.html). One of the breaking changes listed says that "The unary < is now deprecated, for .. < use ..< for other usages use the ` pred` proc". So, I am

Re: Nim .18.0 whitespace issue

2018-03-15 Thread twetzel59
BTW, I realize this isn't involving the `<`, but maybe it is the same parser change that made it no longer work.

Re: Lots of problems with package-level objects

2018-03-15 Thread aviator
@Araq I got the RTTI error when using "x of A" when A was a type that contained an unused field of a ref type of a forward declared type. That shouldn't affect RTTI, right? I'll try to replicate it with a small example. Anyways, I guess I'll just start filing bugs