Questions about creating dll with Nim

2022-02-10 Thread Araq
All of your questions can be effectively answered with a simple "yes". You understand the situation quite well. My advice is to compile with `--gc:orc -d:useMalloc`, you don't need to worry about cycles and you don't need `nimrtl.dll`. Watch out though, it's often not clear which libc on Window

Questions about creating dll with Nim

2022-02-10 Thread rockcavera
I have a small package for creating dlls for use in mIRC - [mdlldk](https://github.com/rockcavera/nim-mdlldk). Faced with this situation, some questions arose about Nim and dlls, especially with regard to memory management. I'll explain first how the mIRC dlls work (or I believe they work with

best practice or guidelines on using log in a library?

2022-02-10 Thread federico3
Not having logging and application metrics is a frequent reason for large companies / FAANGs to fork or rewrite popular libraries, in my experience. Good metrics and logs are crucial in many environments. And application metrics are becoming more popular. Of course it's always up to the main mo

To insert a Nim variable into its PCRE regex

2022-02-10 Thread mardiyah
then so how to put character `{`

Nim 1.6.4 released

2022-02-10 Thread treeform
Thank you to everyone who contributed! Keep Nim awesome.

webscrape

2022-02-10 Thread Araq
I cannot imagine how that would work. But if you can imagine, give it a try. :-)

NImScript task and using a shebang line

2022-02-10 Thread SolitudeSF
nimcr defaults to -d:release

webscrape

2022-02-10 Thread planetis
So would it make sense for a certain convert to karax tool do the same with tokens? Lol I should be answering that question.

NImScript task and using a shebang line

2022-02-10 Thread hyl
Oh you are right @SolitudeSF! I did not know that. This works: #!/usr/bin/env nim r --hints:off --warnings:off echo CompileTime Run Something subtle I think I'm noticing is that running using nimcr is faster than `nim r` after compiling the time. Not sure why.

listFiles() at compile time?

2022-02-10 Thread artemklevtsov
`walkDir` in the static block: Error: cannot 'importc' variable at compile time; getcwd Run

To insert a Nim variable into its PCRE regex

2022-02-10 Thread PMunch
Since the `re` module and `re` procedure takes a raw string literal you can use `fmt` from `strformat` to do this: import re, strformat let num = r"\d*" wordNum = re(fmt"[a-z]\w*{num}") wordNum2 = re"[a-z]\w*\d*" echo find("hello123", wordNum)

To insert a Nim variable into its PCRE regex

2022-02-10 Thread Araq
Stop using regexes and use something like "strscans", pegs or a lexer generator:

webscrape

2022-02-10 Thread cblake
This [example iterator](https://github.com/c-blake/nimsearch/blob/main/xml.nim) with [this example usage](https://github.com/c-blake/nimsearch/blob/main/wikipa.nim) may also be of interest.

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-10 Thread planetis
One think that was not said though is, the owner was kind enough to add nim themselves at the benchmarks. Then it's up to contributors to submit faster solutions or even new benchmarks. Btw we switched to --cc:clang and --tlsEmulation:off which should yield faster performance.

To insert a Nim variable into its PCRE regex

2022-02-10 Thread mardiyah
How can we insert and interpolate a variable into the regex pattern in procedure re( ... ) just like Perl does with its $variable ?

How to find bottlenecks?

2022-02-10 Thread severak
it starts looking usable

Hacker News discussion abou the recently discussed Rust vs Nim performance comparison

2022-02-10 Thread mratsim
I don't know whether to laugh or cry ¯\\_(ツ)_/¯ Maybe I should write a "completely biaised benchmarks" repo given that on everything that interests me, my implementations in Nim are faster than Rust's: * Machine learning, scientific computing, multithreading: matrix multiplication, see my rev

Is it a good idea to downcast Hash

2022-02-10 Thread mratsim
In Ethereum "attack nets", there were vulnerabilities raised over the poor quality of Java hash functions as it only uses 32-bit and a poor hash function: *

NImScript task and using a shebang line

2022-02-10 Thread SolitudeSF
`nim r` doesnt recompile either.