Re: GC is not cleaning up sequence

2018-11-17 Thread konradmb
Thanks for suggestions and insightful explanation! I've tried `GC_fullcollect()`: main() var tmp = a a = tmp tmp = @[] GC_fullCollect() os.sleep(1) Run Memory usage comes down to 1,8 GiB. It's still high, but at least it looks like GC have

Re: TechEmpower Web Framework Benchmarks

2018-11-17 Thread moerm
Sorry to contradict you but a) the memory is the same for all, and b) lots of mem can only somewhat minimize java's disadvantage. Nim and other complied servers should still be noticeably faster. And there are other interpreted frameworks/servers too that are faster than Nim. To be frank,

Re: Need help with game framework

2018-11-17 Thread anoNIMous
Yeah, that's probably the best way. I was putting it off because it sounded complicated but I guess it's probably the best way. Thanks :)

Re: Need help with game framework

2018-11-17 Thread doofenstein
one way to accomplish this(which also simplifies a lot of your scaling code and is probably the "standard" way of doing it) is by rendering everything [to a texture](https://wiki.libsdl.org/SDL_SetRenderTarget?highlight=%28%5CbCategoryRender%5Cb%29%7C%28CategoryEnum%29%7C%28CategoryStruct%29)

Re: Need help with game framework

2018-11-17 Thread anoNIMous
I tried that, but I don't know how to scale the pixels, so they look out of place. Is there any way to change the pixel size of the draw functions so they aren't always one pixel?

Re: Need help with game framework

2018-11-17 Thread doofenstein
you can probably can replace all these bresenham line and circle functions, which set one pixel at a time, since SDL2 has a function for all these things. They're probably faster too. [https://wiki.libsdl.org/CategoryRender](https://wiki.libsdl.org/CategoryRender)

Re: Need help with game framework

2018-11-17 Thread anoNIMous
Fixed it, thanks! I changed it to allow for more flexibility when using a custom font. Now there is a string, "glyphs", which stores the chars in the font in order, and the function now checks it to return a number. Also, thanks for reminding me of ranges, I completely forgot about them

Re: GC is not cleaning up sequence

2018-11-17 Thread Stefan_Salewski
I don't know much about Nim's Garbage-Collector, but for me behaviour looks not surprising. First, it is generally recommended to put all the code inside of a proc, often called main(). That can improve performance, but I think that would make no difference for GC here. Second, calling pop()

Re: Need help with game framework

2018-11-17 Thread miran
> I am not experienced enough to see where I could make improvements. I've just skimmed through your repo and the first place where I would start with the improvements is that [loong case statement](https://github.com/NIMNIMNIMNIM/NIM16/blob/master/src/engine.nim#L121). You