StefanSalewski / NimProgrammingBook

Computer Programming with the Nim Programming Language -- A gentle Introduction
262 stars 19 forks source link

Expand section on templates #4

Closed shayanhabibi closed 2 years ago

shayanhabibi commented 3 years ago

Should have some extra examples which more comprehensively present the intricacies and uses around templates in nim such as with untyped code blocks and the do notation.

I would be happy to help write a draft section around this, however I can only think of the importance/use of templates and untyped code blocks when it comes to things like clients and locks.

StefanSalewski commented 3 years ago

I know that the section about templates is very short in the book still. I have concentrated on the more basic stuff first, as the book is in first line a beginner book, so it is important that all the basics are explained well and detailed before continuing with more advanced stuff. Some people have asked for more examples and exercises for the basic stuff. I think in winter I would have to do a proofreading myself to see what is not explained well enough, and extend the library section. We have a lot of important library modules like regular expressions and PEGs, which can be hard for beginners. After that I can continue with templates, all the pragmas, maybe FFI. And finally threading, parallel processing, async and macros. For threading and async there may change a lot when we get full CPS support. And for async we have also the chronos module of the status people.

For your templates examples, maybe it is best when you write a blog post, as it is not really beginner stuff. The Nim homepage has a section for guest posts. But of course if do not want to do that, feel free to use the issue tracker of this book to post your template examples.

StefanSalewski commented 2 years ago

Done.