Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Nim in Action

Rate this book
Nim is a new general-purpose programming language that offers support for systems programming, object oriented programming, procedural programming, functional programming, and more. Nim combines the speed of C with the expressiveness of Python and the flexibility of Lisp and it compiles to C as well as C++, Objective C, and even JavaScript. Nim's features make it perfect for developing anything from web applications to operating systems.

Nim in Action introduces the Nim programming language and teaches readers how to write native software applications and libraries, web applications, embedded device software, and programs that communicate over the internet. This book is full of hands-on examples that teach how to test, debug, document, and package Nim applications. It also reveals how to interface with foreign languages such as C and C++ and how to use metaprogramming features to write domain specific languages. This book demonstrates how to implement a fully-functioning chat server, a Twitter clone, and many other software projects. It provides readers with a solid knowledge of Nim and the ability to use it to write powerful, portable and efficient applications.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

320 pages, Paperback

Published August 24, 2017

16 people are currently reading
42 people want to read

About the author

Dominik Picheta

1Ìýbook4Ìýfollowers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
12 (31%)
4 stars
20 (52%)
3 stars
6 (15%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 6 of 6 reviews
Profile Image for David.
AuthorÌý1 book114 followers
November 21, 2017
I'm so glad the Nim language has this book. It's compact and gets to the point quickly. Take Chapter Two, for example: it's a feature whirlwind - perfect for getting your feet wet in a jiffy.

It's a shame that Nim doesn't have a definitive reference besides the API documentation on the website. But I'd rather have this book published now than a never-published reference that tried to keep up with this moving target of a language. Which reminds me, Picheta does a great job of pointing out where Nim is likely to change in the near future.

I was impressed at how well the book explained language feature as they naturally arose in example code. I particularly enjoyed learning about Nim's delightfully minimalist module system and the relationship between types and procedures. The example (4.14) showing how to define a hash procedure for a custom type - essentially extending the standard hashes module was so simple and straightforward...Nim is truly a hacker's language (in the classical, complimentary sense).

While I generally favor short examples over large ones in technical texts, Chapter 7 (Building a Twitter Clone) is a nice example of an application and the use of the web micro-framework Jester's domain-specific language (DSL) for URI/URL route matching and handling.

(As an aside, I simply couldn't bear to generate HTML on the server side, so I went quite far off the beaten path and turned it into an SPA using Mithril (a wonderful virtual DOM JavaScript framework) for the client and had the Nim backend responding to proper REST API requests with JSON. I also changed the DB schema to use integer IDs, etc. So I ended up learning quite a few additional things on my side trek. )

My only criticism of the book is the final section of the final chapter: metaprogramming with macros. The topic is dense and the example is large and meandering. You must follow along very, very carefully for about 12 pages. It's a challenging subject made more challenging with a large and verbose (albeit nifty) example. I would have enjoyed it much more if the example had been broken into several smaller examples.

(Adding to the difficulty of following along with the Macros section, I also ran into a compiler error in the createLoadProc() procedure: type mismatch: got (NimNode, proc (bl: typed, op: string): NimNode{.noSideEffect.}, void). Hint: I was able to get past it by setting the output of the quote do statements to temporary variables before adding them to the body statement list. A Google search did not turn up anyone else with this problem, however. Strange.)

Overall, this book was exactly what I needed to get up and going with Nim. My free time is a precious, precious thing and I really appreciate this kind of brevity. I shall be using Nim in the near future for some real projects.
Profile Image for Yuri Karabatov.
AuthorÌý1 book25 followers
March 12, 2020
Finally finished after a long break.

An easy read, everything comes gradually and covers a wide enough range of topics, all micro-projects relevant to what I want to do.
Profile Image for Arthur.
96 reviews5 followers
March 19, 2018
This book should get a second edition because Nim 0.18 shipped in Mar 2018. And version 1.0 is forthcoming.
All-in-all, this is a great get started book for a wonderful language that is made cleverly to take the programming into the right direction.
Profile Image for Kaushal Modi.
12 reviews
August 19, 2021
This book starts with a great introduction to a "diamond in roughs" language Nim (), and later develops into real-life code examples.

It gives an all-around introduction to the powers of this wonderful programming language. I would recommend this book to anyone with basic background in programming (by basic, I mean that they understand concepts like if/else conditions, loops, etc.).
Profile Image for Alvaro Tejada Galindo.
178 reviews5 followers
January 9, 2018
My first book on Nim...and what a book and what a language :) Nim in Action is AFAIK the only Nim book out there...but it's so good that it's enough :) Lot's of example...very good explanations...easy to follow and gives a very good grasp on the language...totally recommended...
Profile Image for Tadas Talaikis.
AuthorÌý7 books78 followers
May 10, 2017
Found it purely by accident when trying to deal with Golang crap. In one sentence: "Nim - A Programming Language That Combines Best Of Python, Go, And Rust".
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.