Comment by digdugdirk

2 months ago

Do you have any recommendations for well designed open source Nim projects for someone study to get a feel for the language?

Honestly hard to say. There are a number of styles of architecting Nim libraries and programs, and almost none match my own. My most particular criticism of the Nim ecosystem is the abuse of macros: There are a number of libraries implementing huge chunks of functionality behind macros such that code paths only appear at compile time and are not reflected in sources. Some libraries constrain macro use, but many are built entirely out of macros. I'd say to avoid looking to those examples.

  • I think it's safe to say that the proper way to go about using Nim is to use macros only as a last resort. They're powerful and awesome when necessary, but obfuscate the code a lot, and the LSP can't really follow them either. They also make the code feel "fragile" in my opinion. I find that I rarely need to go further than templates, personally.