11 ms·
Mastering Nim – now available on Amazon
- cb321 4y agoFor HN folk, it may not be so obvious from the blog post, but the author of this book is the Nim originator/technical lead/primary author to this day { since before 2008 publicly and I believe 2005..2006 privately }.
- fprotthetarball 4y agoI am hoping for an eBook. I don't have a lot of space for books, but my computer or phone is always nearby.
- krasin 4y agoThere's a free ebook by a different author, Dr. Stefan Salewski, "Computer Programming with the Nim Programming Language": https://ssalewski.de/nimprogramming.html https://ssalewski.de/nimprogramming.html
- auggierose 4y agoAn e-book is going to heavily (and negatively) impact the sales figures for the print book. So I wouldn't hold out for that. Looking at the price of the book, he wants to make money from it, so no e-book is probably the right strategy.
- fprotthetarball 4y agoI have no problem paying the same price for an eBook as print. If there is some reason a physical product must be involved, bundle both. I'll keep the eBook and donate the physical book to a library.
- e12e 4y ago> An e-book is going to heavily (and negatively) impact the sales figures for the print book. Well, if the price is the same, that hardly matters? Or are you implying unpaid/illicit downloads will be worse with a legal digital version as opposed to an illicitly scanned copy? After buying an e-reader I can't defend buying print books from an environmental standpoint - it may be a sunk cost/resources fallacy - but with all the infrastructure for digital production, distribution and reading in place - print copies are a strict waste of resources.
- gunapologist99 4y agoYou can read a print book without wasting electricity every time you open it and the toxic materials used to produce a e-reader. Reading print is still a much more enjoyable experience (except in the tub -- a waterproof Kindle is still great and lightweight for that!), especially with the slow speed of e-ink screens. I can't defend ebooks compared to the reading, sharing, and the later selling at a used book store my cast-off print books. I've even gotten O'Reilly books from a decade ago at used book stores that are great to read and look great on my shelf, and I love finding some old novel by some forgotten author instead of whatever the latest Amazon bestseller is. And I don't have to worry about the Orwellian deletion of my books from my e-reader: https://www.nytimes.com/2009/07/18/technology/companies/18amazon.html https://www.nytimes.com/2009/07/18/technology/companies/18am...
- DennisP 4y agoNevertheless, many people like ebooks, for a variety of reasons. And I'll put the marginal environmental cost of another book on my reader, against the cost of producing and shipping a physical book, and then turning on a lamp to read it at night anyway.
- Volundr 4y agoI'm dubious the environmental difference is that much. 1 e-reader vs how many thousands of books? It's seems to me the e-reader is a one and done cost, but each book comes with it's own trees cut down for the paper, shipping, etc. As for the deletion I'm with you. That's why I always buy DRM free, or promptly crack anything I buy.
- pjmlp 4y agoThere is the mass murder question of trees for books that never get sold and are eventually thrown into a dump, alongside the chemicals used in the publishing process.
- konart 4y ago>You can read a print book without wasting electricity You don't 'waste' electricity, you waste your money. And in many places electricity is (much) cheaper than (good) paper. >toxic materials used to produce a e-reader. Surely you realise that different chemicals are used during paper production too? https://en.wikipedia.org/wiki/Sodium_sulfide https://en.wikipedia.org/wiki/Sodium_sulfide and https://en.wikipedia.org/wiki/Sodium_hydroxide https://en.wikipedia.org/wiki/Sodium_hydroxide for example. And this depends on paper type too. >Reading print is still a much more enjoyable experience And this is entirely subjective. >I can't defend ebooks compared to the reading, sharing, and the later selling While I 100% agree with selling option, sharing is at least as easy with epub. Unless we are talking about a book from Amazon or something. In most cases you can just send a file over your preferred messenger.
- cercatrova 4y ago> An e-book is going to heavily (and negatively) impact the sales figures for the print book What? Do you have a source on that claim? For me, I only get ebooks for programming books because I can have the IDE side by side with the PDF, no need to continuously look at the physical book and then back into my IDE, and I can copy paste code examples.
- jjtheblunt 4y agototally agree re user experience with ide...
- deltaonefour 4y ago
- cercatrova 4y agoYou have a few different issues with the assumptions in your comment. First, yes, one can ask for a source without a sincere request for it, known as sealioning. However, that was not what I was doing, because: > While statistical data is much better then common sense reasoning, it's still possible to make claim via deduction and even anecdotal evidence. Oftentimes, intuition is not correct. Think for example to the Monty Hall experiment where many people thought that the odds of two doors holding the winning prize, after a third door were opened, to be 1/2. However, on actual examination and statistical analysis, it is actually 2/3. Similarly, simply because you believe that ebook sales reduce print book sales intuitively does not mean that this be so. In fact, based on other studies, it seems that piracy actually increases sales [0]. > Anecdotally if I see a book I like, the first thing I do is google for that book with a ".epub" or ".pdf" extension so I can download it for free. I figure other do-gooders are going to pay for the book so I might as well freeload a free version. It's logically the most cost effective move. Second, just because you pirate does not mean everyone does. Ebook sales have overtaken print sales, showing that most consumers actually do not pirate. Those that do an action overestimate the percentage of others who also perform that same action, this is a known cognitive effect. All in all, you have no source except intuition that can be shown to be wrong. [0] https://www.cbc.ca/news/science/e-book-piracy-may-have-unexpected-benefits-for-publishers-1.1123710 https://www.cbc.ca/news/science/e-book-piracy-may-have-unexp...?
- dmitriid 4y ago> Looking at the price of the book, he wants to make money from it The price of a printed book includes: - the price of materials - the price of printing - the price of transportation - the price of storage - the margins and profits of all of the above - the margins and the profit of the store And then, and only then, the author making money, if any. How is e-book going to impact the author's profit, exactly?
- konkordat 4y agoManufacturing of a book is really cheap. It's just a little part of overall cost. Nowadays it may cost more becauase of higher prices of paper. Everything else is managed by amazon for their cut. Stop shilling. The author is just greedy.
- crispyalmond 4y agoI'd like this too, I'm not one to read a physical book, but I'm constantly reading on my phone & computer
- ternaryoperator 4y agoLooking at the excerpt on Amazon, the Acknowledgments part of the preface lists numerous people and concludes with: "This book would be as good as it is without your help." The author might want to fix that.
- deleted 4y ago[deleted]
- sbelskie 4y agoI like to think the author is thanking them for their efforts despite said efforts having produced nothing of value.
- LastMuel 4y agoThis appears to have been fixed in the Amazon page I just pulled up. If so, that was a quick edit.
- ternaryoperator 4y agoIt's still there, at least on Amazon.com. I haven't checked other Amazon sites.
- davidkunz 4y agoI absolutely hate Nim for spoiling pretty much all other programming languages for me. I wish it gained more traction. Congratulations on your book and keep up the great work, Araq. You did an outstanding job with Nim and I wish you all the best!
- danielvaughn 4y agoCare to give a brief overview of what you find appealing? I've never looked into the language before.
- davidkunz 4y agoOther comments already gave great examples but for me personally: - Concise syntax - Elegant language constructs (e.g. method call syntax) - Great macro system - You have control over what GC you use - Great performance - Everything is simple, it's easy to read other people's code
- frigid 4y agoI particularly like, from the syntax side: - Python-style syntax with significant indentation - Uniform Function Call Syntax: a.len() == a.len == len(a) - Fully unqualified imports by default: which might seem scary to Python programmers, but works great in practice because of static typing - All of the above makes code readable and succinct And from a language features side: - Compiles to C with all the architectural targets that come with it - Compilation to C also allows for easy C interop: wrap function signatures and types and you're done - This, in turn, means that Nim libraries can bootstrap off of the massive C ecosystem, while adding nicer APIs on top - Extremely performant GC by default: optional Rust-style annotations can further improve performance, and you can remove all overhead and manually manage memory with C-style pointers if you'd like - Useful compile-time templates and macros that can directly change the AST The community is also active and helpful on IRC/Matrix/Discord/Gitter (bridged together)
- frigid 4y agoOne really important thing I forgot to mention is how extendable Nim is - first class support for macros and AST manipulation is very powerful. This cuts back significantly on the amount of functionality that needs compiler magic. So you'll see alternative (or new) implementations of core language features like async, threading, DSLs, typeclasses, traits, etc available as external packages, with just about the same user experience as if they were built into the stdlib or compiler.
- jalino23 4y agofirst time I've heard of nim! anyone using nim in prod care to share their experience?
- remram 4y agoYes they do https://news.ycombinator.com/item?id=28916172 https://news.ycombinator.com/item?id=28916172 https://hn.algolia.com/?q=nim https://hn.algolia.com/?q=nim
- isofruit 4y agoDisclaimer: I have not written a single line of C/C++ in my life, nim was the first language that exposed me to lower level concepts essentially. I have a webpage-backend life in it, re-coded a very CRUD-heavy and medium-sized Django project in nim for funsies. You do notice that the ecosystem is not mature. You may have read another comment on here earlier that libs often are not fully featured or have clunky APIs. ORMs in particular are an area where you'll find a lot of teething issues. I found myself contributing to said libs in order to fix some of that, adding another lib to deal with connection pooling for me while I was at it. Overall though, the coding experience has been intensely enjoyable and fun for me, which is why I kept going. Pushing logic to compile time is trivial, you don't even really need the macro system to do that since there's a pragma for that, and voila, suddenly you are able to have compile-time evaluation on whether you're trying to query a Many-To-Many relationship in your database correctly, guaranteeing you that you won't face those issues ever at runtime. I love this. And all of this was without me having done any kind of deep dive into the macro system, I was mostly using generics, templates and compile-time-procedures (which are normal procedures, but annotated with the compile-time-pragma). And said macro-system from what I've seen opens up a whole new world of possibilities. Another fun tidbit is that python interop is effortless, in both ways, thanks to numpy. As in, it is effortless to use python libraries, as it is effortless to make python use a library written and compiled in nim. Edit: Deployment with docker needed some figuring out first, but wasn't hard by any means. Could use more documentation though, which I'll likely add.
- treeform 4y agoI use Nim in production, its great. Easy to write like Python, but super fast like C. Type system prevents typos. Has very advanced macros.
- alberth 4y agoTwo things: 1. Buying this book supporters the founder and lead developer of Nim. 2. Theres consideration for some major v2.0 changes. Have a look and chime in if you haven’t. https://forum.nim-lang.org/t/9132 https://forum.nim-lang.org/t/9132
- curioussavage 4y agoI've liked Nim for years. Just jumped back in to use with the Godot engine. I originally went with rust (not by choice but due to an important dependency), and switching to Nim made me so much more productive. In this case I don't think rust was really adding much safety since the engine owns all the game objects.
- nafizh 4y agoIf you want more adoption of the language, probably best to leave a copy on the website for free. I think I saw some statistics that it doesn’t really reduce sale of the hard copies that much.
- hsbauauvhabzb 4y agoCurious on this, would you happen to have a citation?
- deltaonefour 4y agoThere's 3 languages in the same class. Julia, Nim and Crystal. I'm specifically curious about Crystal vs. Nim. Benchmarks show that crystal is pretty much faster, but I'd also like to know the advantages of why someone would choose Nim over Crystal I'm looking for reasoning that is deeper then just superficial language syntax differences. Has anyone extensively used both? I would like an unbiased view from someone who has used both as opposed to someone who's only used one.
- eddyschai 4y agoWhat class of languages are those?
- deltaonefour 4y agoscript style languages specifically designed with modern concepts and to be highly performant. V8 is likely the fastest interpreter (javascript) for a script style language but these languages should be a step above and beyond v8 in terms of performance.
- michaelsbradley 4y agoNim is not a "script style language". By default it compiles to C, and the generated C sources are then compiled with gcc or clang, etc. As it says on nim-lang.org, "Nim is a statically typed compiled systems programming language".
- deltaonefour 4y agoI know. But the syntax is still script style. The syntax is more closer to Python then it is to C++.
- rishav_sharan 4y agoGonna copy paste an old comment of mine: ----- Syntax wise: Nim is to python what Crystal is to Ruby Capability wise: both are incredibly powerful general purpose languages. Crystal is fully OOP, while Nim has a more functional/procedural bent. Nim is better for DSLs and has a fascinating macro system. For system language use, Nim is a better choice as you can use it with its Arc GC or no GC at all. Perf wise, Crystal seems to be marginably faster in most benchmarks. Though at that level the difference isn't much. crossplat wise, Crystal has no "official" windows support (and you cannot do webdev on it) while Nim has. Ecosystem wide: Both are young languages and the ecosystems are tiny. Crystal has more and better options for webdev. Nim, IMO, is better for games, console apps etc. Tooling wise; crystal IDE tools are far behind that of Nim. But both are terrible when you consider any decent language out there. Ecosyt Personally I like Crystal a lot due to its type system and syntax but you can't go wrong with either language.
- knighthack 4y agoWhat GUI libraries does Nim support?