CBOR?

2023-08-09 Thread elcritch
Nice! Looks like that one's still been in development which is great.

Template being called twice with Nim 2.0

2023-08-09 Thread ringabout
Thanks for your insights. I will fix it soon. You are so incredible!

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
@Zerbina I did as you suggested (move the... `move` inside the template). It appears to be working beautifully: Very nice one. Thanks again! ;-)

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
> Apart from working around the compiler bug, this also removes the need to use > move at pop callsites. That's _precisely_ what I was thinking about right now, after having isolated the issue that is. Thanks a lot for your input! Really appreciated! :)

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
So, basically the question can be simplified to this... How do I make this work? template pop*(): var Value = SP -= 1 Stack[SP] # some other template let x {.inject.} = move stack.pop() Run It currently produces: //let

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
Looking into the `move` implementation (and given that my `pop` is a _template_ ), I think the reason why this happens is quite obvious:

Template being called twice with Nim 2.0

2023-08-09 Thread Zerbina
You're running into a C code generator double-evaluation bug recently introduced for projects using `--gc:arc|orc|atomicArc`. I haven't inspected all callsites of the `pop` template, but assuming that the popped stack-entries always become re-usable, you can move the `move` call into the templa

CBOR?

2023-08-09 Thread nasl
My googleFu found:

CBOR?

2023-08-09 Thread jk49
I have been searching the same thing, and CDDL too. the best source i find is it has both CDDL parser, c code generator, and encoder/decoder in c. but the CDDL parser is written in python...

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
OK, we've made some progress... If I remove this `move` from here: Then the whole thing magically works. But then, I get a _copy_ (`eqcopy___`), instead of a _move_ (`eqwasMoved___`). Ideas?

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
Interesting idea. An example of a value passed as `spec` would be this: (the `args` value). Do you think there could be something wrong with that?

Template being called twice with Nim 2.0

2023-08-09 Thread PMunch
Have you double checked that the `spec: untyped` argument has the same AST as in pre-2.0? Just looking at the code I see that if it has two nodes it would run `pop` twice. So if some AST representation changed between 1.6.14 and 2.0.0 this could be the culprit (I've had similar issues before). I

Command line options

2023-08-09 Thread thindil
For that kind of checks, you will probably need another tool, like `nimalyzer`: Just "small" warning, it is in pre-alpha stage that's why I don't advertise it around. At least not too often. :)

Template being called twice with Nim 2.0

2023-08-09 Thread drkameleon
I've been having issues with compiling Arturo with the latest Nim version and finally I managed to at least spot one piece of code that behaves weirdly. The piece of code in question (along with different debugging `echo` statements) is this:

Some ideas about nimrtl

2023-08-09 Thread sls1005
I've recently found that it's possible to register a callback to a dynamically loaded library and invoke it. For example: # test0.nim # nim c --app:lib --noMain test0.nim var registered: proc(p: ptr int) {.nimcall.} proc registerFn(fn: proc(p: ptr int) {.nimcall.})

Command line options

2023-08-09 Thread grd
About (1). I am not talking about bugs. I am talking about readability.

Command line options

2023-08-09 Thread Araq
There are lots of options for (2) like `--styleCheck:usages --styleCheck:error` and none for (1). Note that the number of bugs these options have found in my experience is **0**.

Command line options

2023-08-09 Thread grd
Hi, is there a way to turn on checks about: 1. The optional braces. For instance `echo hello` vs `echo(hello)` 2. The case insensitive Thanks