Re: Buggy concepts

2019-01-30 Thread lqdev
I wasn't able to create a MCVE, that's why I didn't include it in the post.


Re: Buggy concepts

2019-01-30 Thread Araq
Anything reproducible available?


Re: Buggy concepts

2019-01-30 Thread andrea
The situation is not as dire as described, I use them quite extensively in 
[emmy](https://github.com/unicredit/emmy)

Still, I find some issues with them, they are not completely stable right now


Buggy concepts

2019-01-30 Thread lqdev
Hello,

I have been trying out Nim's concepts for the past few days, and I have to say: 
they're far from stable. In simple use cases they work, but when you add 
advanced OOP techniques into the mix, you get an amalgamate of compiler errors 
and meaningless exit codes.

So far, concepts are very unpredictable, take my current project as an example: 
[https://github.com/liquid600pgm/rod](https://github.com/liquid600pgm/rod)

I tried to create an interface for a proper `RodVM`, to avoid cyclic imports 
(and add some modularity). Unfortunately, it didn't work out, because for some 
reason, the compiler crashed with exit code 1 without any reason on 
compilation. I wasn't able to trace down where the issue is, so I went for a 
different model:

I decided to use a `RodBaseVM` class, which didn't help at all. I still needed 
concepts to define a meta-type, that would describe a type that implements the 
required methods of a VM, but failed miserably, with a cryptic compiler error:


Error: internal error: getTypeDescAux(tyProxy)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c 


Run

I get that concepts are still in development, but I expected that the compiler 
would at least give me some line numbers, but no. That never happened.

Overall, I think the overall idea behind concepts is brilliant: they're much 
more powerful and modular than interfaces, however, they still need a lot of 
work to be considered stable.

TL;DR: Don't use concepts. Not yet, at least.