How to manually free/clear memory used by ref

2022-11-18 Thread ThomasTJdev
### Problem I'm using the superb [nimPDF](https://github.com/jangko/nimpdf) library for generating PDF-files in various shapes and forms, but for some of my very large files the memory usage is becoming a problem. I generate the PDF-files within a loop, so I can keep headings, preloaded images

Why I enjoy using the Nim programming language at Reddit.

2022-11-18 Thread jasonfi
OK that's more than most typical ORMs can handle and you'd likely need several tools. I can't say that I like YAML, but it seems like the best tool for the job since I want to abstract the information away from Nim to be more flexible. JSON is still an option, I didn't go with it because it does

Why I enjoy using the Nim programming language at Reddit.

2022-11-18 Thread pietroppeter
On the subject of yaml I like the not so well known approach taken by Python library strictyaml: Basically they remove a lot of yaml functionality (including type inference). What is left is a very simple format that I think is one of the best way to p

Small Nim js fib benchmark

2022-11-18 Thread hyl
In my unscientific comparison, I was comparing minified to minified and Nim still did well. I also like the Nim->JS output not being pre-minified, because it makes it easier to see what Nim is doing (some other compiles-to-JS languages don't output readable JS).

Why I enjoy using the Nim programming language at Reddit.

2022-11-18 Thread rodney
Hi Andre, thank you for the write up. Just as a personal anecdote since I was browsing the community discourse here: I saw your post on HN couple days ago, loved your enthusiasm and figured Nim sounds like fun. I've read the 'learn x in y where x is nim', did couple exercises in Nim on exercism

A cost model for Nim v2

2022-11-18 Thread Araq
> If you ignore all the syntactic differences and write perfect exception-safe > code vs perfect return-based code, the latter will be the same or faster. Not necessarily: "In summary, the exceptions approach was 7% smaller and 4% faster as a geomean across our key benchmarks, thanks to a few t

Install issue from choosenim [Windows]

2022-11-18 Thread matthesoundman
My fault. I had attempted install of `1.6.6` a while back and it was in my `PATH`. I resolved this. Sorry for spamming the forum.

Install issue from choosenim [Windows]

2022-11-18 Thread pp
Did you try to exit the shell and open another one? Environment variables could be old

Install issue from choosenim [Windows]

2022-11-18 Thread matthesoundman
Hello, I just tried to install `Nim` via `choosenim` on my `Windows` host. It seems that the version is not agreed upon by both `Nim` and `choosenim`. Am I interpreting this correctly? What am I missing? PS C:\> choosenim update stable Updating stable Info: Already

Small Nim js fib benchmark

2022-11-18 Thread geotre
Indeed, compiling the benchmark code with `nim js -d:release -d:danger` and then minifying with `esbuild --minify` produces this output: var framePtr=null,excHandler=0,lastJSError=null;Math.trunc||(Math.trunc=function(r){return r=+r,isFinite(r)?r-r%1||(r<0?-0:r===0?r:0):r});functio

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread tubbs
Jesus, cleaned away some old code I did not use (I thought) and now it works. Thank you for your help and sorry for not seeing this earlier.

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread sky_khan
Well, it may be out of memory error but there must be a logic error somewhere or your desktop must be a potato with 1-2GB ram max :) No way filling all memory with a few thousand objects / strings. Can you share your code ?

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread tubbs
No vps, its running on a normal desktop and to me there is nothing strange going on.

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread sky_khan
This shouldnt happen on a desktop machine. Is this thing running on a cheap VPS or something ? I guess you may add sleep(1) before entering each directory or something but its far from ideal. I have no other idea because I'm not experienced on hosting sites, sorry.

Nim 2: "Memory can be shared effectively between threads without copying in Nim version 2"

2022-11-18 Thread zevv
I am not familiar with the workings of orc, so this might be nonsense: is the problem that the the ref cell `rootIdx`'s are pointing to the wrong threads `roots`? Should I re-root all refs of my tree after moving them?

How to chain anonymous proc with UFCS?

2022-11-18 Thread sls1005
> one cannot chain a _with_ directly after another _with_ , or they'll get > _Error: redefinition of ':anonymous'_ @Araq Shall I open an issue for this?

Using templates with generic or untyped parameters

2022-11-18 Thread drkameleon
Very interesting as well! :)