I want to encourage on your journey with Nim. Nim can be a challenge especially 
if you are coming from a dynamic language like Python. Because Nim has a nice 
and reasonably friendly syntax for most cases. It is not a Python-like 
language. You can not approach Nim like Python. It is a system's level 
language. And as such it can offer you things Python can not. But it will also 
require from you things Python does not.

In my journey with Nim, I have approached it from a high level. I am still 
learning my rhythm for developing with Nim and my style. The challenging part 
for a person who is primarily coming from a higher level language is that Nim 
on the surface feels pretty high level. But then there are times when it pulls 
you down lower than you are accustomed to.

You may start with more naive approaches to problems, similar to how you might 
of in Python. It may work. It may be sub-optimal. But there are solutions. This 
forum is very helpful. People here will help direct you toward a more idiomatic 
Nim solution. Once again, it may require more from you than Python. But it will 
give more back.

Eventually you will become comfortable in Nim and these issues will become 
fewer and fewer.

Nim is far from slow. In my app I am parsing GBs of data. I started with a 
split-like solution. Moved to Nim's csv. Then I changed the format of my data 
to fixed width columns. Now I read in x number of bytes at a time and process. 
I can now process 2GB of data with over 77million rows of data in 24 seconds. 
That is if I compile with -d:release. If I do not then the data parsing is over 
3 minutes.

You will want to use debug mode while you are developing so that you have debug 
information when you encounter problems. But if you are ready to release or 
simply test performance. You will want to compile with -d:release. There are 
also time when you can pass C compiler flags into Nim via -passC: and possibly 
get even more amazing performance gains. It greatly depends on your app.

Be encouraged. Ask questions. When Nim pulls you under to a lower level than 
you understand. Ask. Get help. Keep going. It is worth it.

Reply via email to