🚀 Elevate Your Coding Game with Nim!
Mastering Nim is an all-encompassing guide designed for programmers eager to learn the Nim programming language. This book offers a structured approach to mastering Nim, complete with practical examples, real-world applications, and access to a supportive community, ensuring readers are well-equipped to tackle modern programming challenges.
J**E
Nim is easier to read than Python, as fast as C, and almost as flexible as Lisp!
Recently, a handful of new programming languages have arisen that are poised to potentially displace most high-performance programming currently done in C and C++. These include recent languages such as especially Rust, Zig, Jai, Odin, V, and Pony. There's also Julia, although that is more data science oriented and has some platform-independence problems.Anyway though, among these new languages there is also Nim (the subject of this book, written by the language's original creator). I encountered Nim once years ago but didn't pay much attention to it because (like many people) I did not truly understand what its awesome value proposition was and how fantastic of a language it is. I saw it had an (actually entirely optional) garbage collector and that the first book written for it spent a lot of time on web dev stuff, so I immediately dismissed its viability (very prematurely though, as it turns out).I've been interested in Rust for a few years now and tried it out a bunch, and have also briefly messed around with Zig. I've also explored using dozens of other languages over the years, some professionally for years and some only briefly to play with them, including examples such as: C, C++, C#, Java, Python, Lua, Lisp, Scheme, Racket, Factor, Prolog, and various others. I've also used some specialized languages like GLSL, HLSL, and Cg. I've worked professionally in the game industry too, both AAA and indie, so I understand why performance matters and some of the things to look for in evaluating it.However, once I started using Nim it has fast become my overall favorite new language and I am excited to do my next project using it! Nim easily seems like the best overall language of the recent generation of new languages, at least when you ignore Rust's ecosystem and community size. Nim is growing fast though, with nearly 2000 community packages already available despite only reaching version 1.0 in 2019! Rust in contrast reached version 1.0 in 2015 and so Nim is a much younger language.Nim is the most free of needless tedium and busywork of any of these languages and feels even easier to learn and to use than Python, and yet still has performance that is roughly on par with C or C++. It's optional garbage collector comes in several different variants and the system is designed with hard real-time requirements in mind. You can specify how much time it is allowed to run for example. Also, they've recently created two new garbage collection modes (ARC and ORC) which basically behave the same as C++ RAII does and thus makes the GC largely a non-issue.Plus, you can manage memory completely manually in Nim if you want to and its C interop is great. So, the GC "problem" that people assume coming from Rust mostly isn't even a practical problem in Nim. People are making assumptions about that based on their experiences with other languages that don't really apply to Nim (which seems to be the most common reason why people dismiss Nim: invalid assumptions based on subconscious experiences from working with other languages, i.e. basically language feature stereotyping).In reality, ignoring ecosystem/community size differences, Nim seems like it would usually be a better language to use than Rust for most programs. Nim's community and package collection nonetheless is still larger than most of the other competing next-gen languages (except for Rust mostly), so Nim actually seems to have a bright future!Nim even has a (currently experimental) borrow checker of its own that can be enabled with the {.experimental: "views".} pragma, and made more effective by also using the {.experimental: "strictFuncs".} pragma. Thus, Nim may one day have most of the borrow checking features of Rust too, as an optional rather than unavoidable (and often painful) feature.The lack of syntactic clutter and the ease of use and clarity of most of its design is honestly refreshing. One does not truly appreciate how much the syntactical noise gets in your way in other languages until you try something like Nim or Python. It makes all of your work both easier and more expressive, and yet Nim still runs about as fast as most C or C++ code, despite being easier than Python.Nim's metaprogramming is also similar to what's available in Lisp, Scheme, or Racket, except that it requires the resulting syntax to be Python-like, which is honestly a good thing when you consider how much harder to read the nested parentheses or DSL language mangling in Lisp family languages often are compared to Python-like languages.Nim is the closest to a "best of all worlds" programming language I've found yet!I recommend you try it!Don't let the lackluster (as of July 2022) book cover here fool you! Nim is a fantastic language! It is already usable for production for high performance game dev and for many other uses cases.I did find a handful of typos (~ 7 of them) though and also had a technical issue getting the first program examples (the pixel graphics ones) to run. Speaking of which...IMPORTANT: On Windows, if you get an error when trying to run the pixel drawing examples early in the book then you probably need to download SDL2.dll and SDL2_tff.dll and place them in the same directory as your Nim code. Otherwise, the code might not run. The package for the pixel drawing the author used doesn't seem to always get all the dependencies right. It probably has an error in its package specs somewhere (as of July 2022). The "drawText" command also doesn't respond to the x coordinate apparently.
E**T
Good book not for newbies to programming
Got this because I'm learning Nim after years of programming in other languages, C#, Python, Go, JavaScript and so on. I've not yet finished the book, but I'll detail what I've noticed thus far. The first few chapters are short and sweet. There is not a lot of hand holding, this book assumes you have some familiarity with programming languages, if you've never ran "npm install x" or "pip install x" or similar commands for installing packages in another language, you might want to do further research before approaching this book. If you're comfortable kind of just filling in the "gaps" then this book is perfectly fine and great.Also the book is physically small, it is not super long or wide, I would say it is similar in size to a 7" tablet or a Kindle device, but a little thicker than a Kindle or tablet, maybe an inch? It is under 300 pages of code and explanations. It might not be for everyone, but for my purpose of getting familiar with Nim even when I'm nowhere near a computer I find it pretty effective.This is the first edition of the book by the author so it has some rough edges, and I intend to note any typos or grammatical errors to share with the author, but I have not yet ran into anything insane that stops me from progressing. The Nim community also has a rich set of options for those seeking help, everything from a forum to a Discord server, where you can find the author if totally necessary and if no one else is able to help.If you're comfortable with all of the above, and you want to learn Nim. I couldn't recommend this book enough. Otherwise, I highly recommend you try the official documentation which is free.
M**L
The first programing book I've encountered which has a color theme
I stumbled upon Nim while I was looking for a statically compiled, easy to learn programming language which compiles to machine code. I think Nim is a nice language (similar to Python), which can be a useful addition to one's programming toolbox.I wish Nim could allow for the writing of better functional programming with proper constructs for pattern matching and variable binding, e.g. let [first | rest] = [1, 2, 3], and possibly a pipe operator a la Elixir or F#.Having said that, unlike most programming books I've encountered, this one uses a color theme which improves comprehension, and allows one to visually identify language concepts more easily. More programming books should follow this. In addition, the book is written by no other than the creator of the language himself, Andreas Rumpf.Thank you Andreas for giving us Nim.P.S. If you're on a M1/M2 Mac, you need to use brew to install sdl2 and sdl2_ttf to be able to successfully compile the examples, as the nimble pixels package depends on them.
J**A
Exemplary exposition of a very nice language
This book is concise, incredibly clear, the page layout is stunning in its beauty, and the content immediately useful. Wonderful job. (and i've been programming professionally since 1983 or so, started quite young, have used many languages including compiler internals....this book is just excellent)Edit days later : nim is compiling just fine on an M1 Mac and I've tested that, despite what another reviewer wrote and gave a 1 star review for, which is unrelated to the book, but to the reviewer's computer being misconfigured.
S**T
Code Not M1 / M2 compatible for MAC
I got this book and was excited to start to learn the Nim language only to find that the very first code example fails to compile and run on my laptop (an M1 MAC). I am disappointed because I started underlining in the book (before I realized it will not work on my laptop) and so cannot return it now.
J**N
Starts well
I was hoping to see numerous examples of idiomatic use of the language so that I might be able to master Nim. Instead after a decent introduction the book becomes dictionary like and as dry as a buried bone.
V**.
Highly recommended
The first chapter gives a very interesting introduction into Nim using relatable examples from graphical algorithms.The second chapter covers the language almost completely in the form of a specification with personal remarks. It is a bit dry but given the goals of this chapter this is perfectly understandable. The fourth chapter is a very handy cheat sheet covering the most important standard library modules.And the third chapter deserves special attention: It explains in detail how Nim's meta programming facilities work. Several famous macros from the standard library are reimplemented. The given programming tasks have suprisingly elegant and short solutions. It feels like math that has been discovered and not like everyday programming.Due to the "loosely coupling" of the different chapters the book manages to be useful to newcomers, to advanced users and to experts. Because of the third chapter I recommend this book even for programmers who don't intend to use Nim!
社**長
期待したほどではなく、高価である。
省略が多く、初心者向きではない。
TrustPilot
1天前
2 周前