- 出版社: Manning Publications; Pap/Psc (2017年3月28日)
- 平装: 320页
- 语种： 英语
- ISBN: 1617293431
- 条形码: 9781617293436
- 商品尺寸: 19 x 1.9 x 24.1 cm
- 商品重量: 562 g
- ASIN: 1617293431
- 用户评分: 分享我的评价
Nim in Action (英语) 平装 – 2017年3月28日
AUTHOR BIO Dominik Picheta is one of the main developers of the Nim programming language, he is also the author of the Nimble package manager as well as many other Nim tools.
|5 星 (0%)|
|4 星 (0%)|
|3 星 (0%)|
|2 星 (0%)|
|1 星 (0%)|
Instead of solely relying on describing the language with small but sufficient examples which illustrate this or that feature author decided to add pretty heavy programs inside -- chat app (almost 50 pages) and twitter clone (40 pages). One could write entire book about those topics and here it only reduced the room for Nim itself. Besides it is hard to sift through such chapters just to find a comment about given feature in language.
The rest is about the language and environment (as it should be in my opinion) and what the author describes is put in clear way. The problem is what the author does not describe and there is quite a lot I would say -- since Nim sports value and reference types is there boxing? What about value slicing? How the closure is built (using variable capturing or passing)? What about type hierarchy? What concepts from OOP world are included? And so on and on (maybe I missed something during reading, but I rechecked the ebook with the same results).
To actually use any language and avoid nasty gotchas those are really needed. And since they are not mentioned in the book one can wonder if the language supports them, does not support, or essentially what is going on. Yes, yes, I know -- go to website... but you see, paying for book just to get big "go to website" sign is a bit expensive way of learning ("Nim in Action" is better than that).
I like the level set for the audience ("for developers comfortable with mainstream languages") and it would be great if the author could add some remarks (maybe in second edition) when some idea is borrowed from another language. It could speed up learning, if I am not mistaken mainly references to Python are made, and for example syntax for generic types reminds me of Scala.
So, to sum this up -- reference? Firm no. Guide? No, I don't think so. Rather introduction, an appetizer for a weekend. On one hand I am glad I bought this book, on other my hunger for knowledge is fulfilled only a bit -- too much interesting stuff left out.
In the two-chapter "Basics of Nim" portion, Nim is introduced as "a general-purpose programming language " that emphasizes efficiency and expressiveness without ignoring elegance. "Applications written in Nim are very fast; in many cases, just as fast as applications written in C, and more than thirteen times faster than applications written in Python," notes the author, Dominik Picheta. :Efficiency is the highest priority, and some features make optimizing code easy. This goes hand in hand with a soft real-time garbage collector, which allows you to specify the amount of time that should be spent collecting memory. This feature becomes important during game development, where an ordinary garbage collector may slow down the rendering of frames on the screen if it uses too much time collecting memory."
Nim is a compiled language that compiles Nim source code into C, and then feeds that source code into a C compiler. Picheta's initial chapters emphasize that Nim is "usable for just about any software project." But he also notes that Nim is still a "young and immature" programming language, and the "user base and community" is still very small and offers few jobs. Yet interest in, and acceptance of, Nim are growing. And, another positive note: the development of open-source Nim remains "exceptionally open" to newcomers who want to help out. (By the way, Nim is not a beginner's language. To learn from this book, development experience in at least one other programming language is needed. And you should have some SQL experience, as well.)
The opening part of the book also covers Nim syntax, procedures, for loops and "other basic aspects of the language." Numerous short code examples are provided as how-to illustrations.
In Part 2, "Nim in practice," the focus is on "writing some software." A simple, yet functional chat application is presented, Nim's standard library is examined, package management is explained, the process of parallelism is explored, and a Twitter clone is developed and deployed.
In Part 3, Nim's foreign function interface is described. It provides the ability "to use libraries written in other programming languages." This part of the book also digs into metaprogramming and "the three different metaprogramming constructs in Nim: generics, templates, and macros. And the process for creating a domain specific language for configuration parsing also is examined.
Appendix A deals with how to get help from the Nim community via IRC and Gitter, online forums, and more direct methods. Appendix B focuses on installing Nim, emphasizing that the latest procedures need to be obtained from the nim-lang.org website, where the Nim code also can be downloaded.
"Nim in Action" is an excellent guide for learning the new and versatile Nim programming language. It is well written and efficiently illustrated. And it keeps its code examples compact and to the point.
My thanks to Manning Books for provided an advance reading copy for review.
I didn't give 5 stars, mainly because the coverage is certainly not complete - there might have been several chapters more - and because the book will become partly obsolete soon due to the evolution of the language. Nevertheless, I strongly recommend it ... today!