AST walking similar to python

2024-03-12 Thread riscv
Some nodes were missing, found everything: import macros proc parseCustomStmt(code: string): NimNode {.compileTime.} = let tree = parseStmt(code) return tree macro parseAndVisit(code: static[string]): void = let tree = parseCustomStmt(code)

AST walking similar to python

2024-03-12 Thread riscv
Something similar to this partly works: import macros proc parseCustomStmt(code: string): NimNode {.compileTime.} = let tree = parseStmt(code) tree macro parseAndVisit(code: static[string]): void = let tree = parseCustomStmt(code)

-d:thanks

2024-03-12 Thread walkr
It's highly productive to have a forum where we can discuss the language, ask questions, etc. But besides quenching our thirst for technical knowledge and skills, we can also use it to express appreciation, and recognize the hard work that goes behind the scenes. So I just want to say thank yo

AST walking similar to python

2024-03-12 Thread riscv
In Python, it is trivial to do this kind of AST walking for any valid python code that is provided as a string in a variable. import ast code_string = """ def foo(x, y): z = x + y return f(z, g(z)) """ module_node = ast.parse(code_string)

gc/malebolgia bug?

2024-03-12 Thread amadan
You can also use [cursor pragma](https://nim-lang.org/docs/destructors.html#the-cursor-pragma) inside the function so that it doesn't mess with the ref counts let svec {.cursor.} = svec[] Run

Nim#

2024-03-12 Thread icedquinn
At the time I asked I was working on a CLR runtime and looking at a project that used it heavily. I'm no longer associated with any of that. :woozy: It seems like whatever good the CLR could have been used for time is now better spent on the JVM or WASM.

gc/malebolgia bug?

2024-03-12 Thread pixel
Many thanks for explanation, and using atomicArc solves the problem. Somehow I never quite realised that Nim reference counting was playing a role here and would be affected by data races.

Include vs import when using generics

2024-03-12 Thread giaco
I've found another example of the same include vs import issue in my project could you please explain me the difference from include and import in this context? I'm still far from understanding this # malebolgia_generic_mod.nim #[ import std/[enumerate] import malebolgia

gc/malebolgia bug?

2024-03-12 Thread sls1005
When you create a variable of a `ref` type, the reference count should increased by one. However, other threads may try to do so at the same time, which is leads to undefined behavior. This multithreading-related problem is called a "data race." Hint: `--mm:atomicArc`

gc/malebolgia bug?

2024-03-12 Thread pixel
I was developing some code using Malebolgia and found an unexpected problem. This example code crashes crashes about 80% of the time when I run it: type Svec* = ref array[19,float] proc subfn( svec:Svec ) = discard 0 proc fn( svec:ptr Svec ) = let svec = svec[

BioLean Weight Loss Reviews (CAUTION) BioLean Weight Loss Weight Loss Fake or Legit! Where to Buy?

2024-03-12 Thread BaldwnBarbara
╰┈➤Official Website:- ╰┈➤ Official Pages:- ╰┈➤Facebook Pages:- ╰┈➤Facebook Pages: BioLean Weight Loss: Discover the advantages of vinegar made from apple cid

Is there a plan to make Nim a language for normal businesses?

2024-03-12 Thread kragil
OK, thank you. I wasn't aware of Nim Works and Nimskull. I still think the evolution I see in Bevy and other projects is much healthier and has a longer viability. Just look at rocket.rs, how much traction and mind share they lost, just because the lead developer dropped off the planet for year

Is there a plan to make Nim a language for normal businesses?

2024-03-12 Thread termer
Bevy is a focused project filling a specific need. Nim on the other hand very proudly doesn't target anything, so of course you're not going to see this without a niche or a roadmap. Like I said earlier, if you want a business lang filling a niche with a plan, look elsewhere. Regarding funding,

Cuticara Reviews (Updated 2024) Anti Fungal & Fungus Remover & Is It Safe?

2024-03-12 Thread cuticarabuy
Cuticara, a liquid tone is planned to fight parasitic infections and further foster nail prosperity. Cuticara is an area of strength for oils and minerals that offers a diverse response for skin and nail care. This phenomenal condition is expected to defend nail keratin and fight nail parasites.