Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread komerdoor
> Then when you are on the development branch of nim, error has a second > optional argument, that allows you to pass a NimNode, so that positional > information from that node gets printed on the cosole whe the error occurs. I am using that now. Tnx. Do you by the way know if Nim supports stat

Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread Krux02
> Nice to know this exists, but I want the switch / case / match to generate > different code depending on the node-kind that is being passed. Then when you are on the development branch of nim, `error` has a second optional argument, that allows you to pass a NimNode, so that positional inform

Re: Nim GC Performance

2016-12-04 Thread jlp765
For comparison purposes, @Araq's second solution gives me 25 Count 272,765 Min 1,271,322 Mean 7,401,332 Max 1,503,168 StdDev which over 25 tests is not much different to the first test.

Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread komerdoor
> Does your own answer mean you already answered the question yourself? Yes, the second post describes how I solved it. > instead of this ... you can do this: definition.expectKind(nnkProcDef) Nice to know this exists, but I want the switch / case / match to generate different code depending on

Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread Krux02
I would really like to answer your question with yes, but I do not entirely understand your question. Does your own answer mean you already answered the question yourself? Just one hint from me who already wrote a few more macros. instead of this: case definition.kind of nnkPr

Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread Arrrrrrrrr
I like your frog.

Re: InfluxDB-to-MySQL Protocol Converter

2016-12-04 Thread perturbation2
@pwernersbach - That's a really cool project, and I'm glad that you shared it! I love that you use the 'not nil' annotations for your argument types and type definitions, and I've enjoyed reading through it, even though I'm not currently using InfluxDB. I hope you don't mind a few questions, bu

Re: Code generation from AST with annotations in Nim like in C

2016-12-04 Thread komerdoor
I managed to create a macro that creates a wrapper for functions that have the "scriptExport" pragma. It was easier than I expected. import macros proc expandFormalParamsForCall(formalParamsNode: NimNode): seq[NimNode] {.compileTime.} = result = @[] for i in 1 .

Using nimscript as an embedded scripting language?

2016-12-04 Thread komerdoor
Is it possible to use Nimscript as an embedded scripting language instead of for example using Lua? And if possible, can I create bindings for my own functions and restrict which built-in functions can be called from the scripting language?