does arc deep copy spawn parameters?

2023-06-12 Thread Araq
If you don't mind the dependency on nim devel just use Malebolgia. Works better than threadpool and has a better API too.

Is there any utility to output a graphical representation of a Nim Abstract Syntax Tree?

2023-06-12 Thread pietroppeter
another option would be to use [mermaid.js](https://mermaid.js.org/syntax/flowchart.html). here is an example of using mermaid.js with nimib: (this will be made some point available as a library) picking a simpler AST like the

Is there any utility to output a graphical representation of a Nim Abstract Syntax Tree?

2023-06-12 Thread dlesnoff
I think it would be crazy hard to do it in CLI but I am no expert and I would not mind if someone contradicts me :) Once the .tex is written, it is not hard to produce a SVG from it. I use ImageMagick's convert CLI to convert from pdf to jpg, but we can also convert from pdf to svg. I put this

Is there any utility to output a graphical representation of a Nim Abstract Syntax Tree?

2023-06-12 Thread juancarlospaco
I like it a lot, awesome work!, I wonder if its hard to do using `std/terminal` or SVG alternatively ? 🤔

Is there any utility to output a graphical representation of a Nim Abstract Syntax Tree?

2023-06-12 Thread dlesnoff
Hello, I have started a tutorial about metaprogramming and macro development a long time ago. To explain the changes in the abstract syntax tree of a Nim code by a macro written in Nim, I tried to output a graphical representation of a Nim's AST with TikZ which is the engine I am most familiar

does arc deep copy spawn parameters?

2023-06-12 Thread pixel
FWIW this code crashes about 50% of the time with nim v1.6 + arc std/threadpool type Ans = ref object x: float Tmp = ref object a,b,c,d,e,f,g,h,i,j,k : seq[float] proc calc( x:Tmp ): Ans = result = new(Ans) let n = 4

FMU library - fmi2FreeInstance

2023-06-12 Thread mantielero
Now the simulation runs fine, but it is not finishing nicely. In the C, there are many commands freeing the memory: void fmi2FreeInstance(fmi2Component c) { ModelInstance *comp = (ModelInstance *)c; if (!comp) return; if (invalidState(comp, "fmi2FreeInstance",

FMU library - seg fault

2023-06-12 Thread mantielero
Fixed. It looks like using `comp: var ModelInstance` while `ModelInstance` was a `ref object` was the reason why it wasn't working. Now facing a different problem. I will probably post it in a different thread.

debugEcho to stderr ? osproc.startProcess debugging...

2023-06-12 Thread IvanS
Thank you both. To make this complete: hasData only applies to stdout. So getting standard error needs to be with a try, peek might be possible, but a simple try works...

Atlas shrugged...

2023-06-12 Thread federico3
Nimble supports dedicated directories using the `NIMBLE_DIR` env variable or the `nimbledebs` directory:

Understanding `await sleepAsync`

2023-06-12 Thread Ivansete
Thanks for the detailed responses. Super enriching all of them :) !

debugEcho to stderr ? osproc.startProcess debugging...

2023-06-12 Thread brainproxy
Was about to post basically the same thing. One thing I'll note is that you can use `{.noSideEffect.}:` instead of `{. cast(noSideEffect) .}:`.

debugEcho to stderr ? osproc.startProcess debugging...

2023-06-12 Thread pietroppeter
you can create your own `debugEcho` that writes to `stderr` lying to the compiler and telling it has no side effects: proc debugEchoStderr*(x: varargs[string, `$`]) = {. cast(noSideEffect) .}: stderr.writeLine x func add(a, b: int): int = debugEchoSt

debugEcho to stderr ? osproc.startProcess debugging...

2023-06-12 Thread IvanS
I'm interfacing with a standalone executable, and all is well except that debugEcho is stdout, so if I want to get debug info from that program, it gets merged with process.readLine(). Is there a way to make debugEcho output to stderr, or do I have to create my own errorEcho to output to stderr

a question about the development and compatibility of Nim 2.0 and Nim 1.0

2023-06-12 Thread dlesnoff
To test the changes, you can compile your code with the latest devel version or the specific #version-2-0. It is the second release candidate of Nim 2.0. You can seamlessly change back to Nim 1.0 with Choosenim. The main breaking change for me is named versus pure enums.