Great to see Nim getting an official book, (Dominick is almost like a co-author of Nim at this point :-). My impression of Nim is that it is what Go should have been, if language developments of the past 40 years were taken into account, so if you like the simplicity of Go's syntax, but want modern features, seriously consider Nim. I personally couldn't get over the significant whitespace, (relying on invisible chara…
Show HN: “Nim in Action” is now available
11–20 of 139 posts
Re: Show HN: “Nim in Action” is now available
#12Great to see Nim getting an official book, (Dominick is almost like a co-author of Nim at this point :-). My impression of Nim is that it is what Go should have been, if language developments of the past 40 years were taken into account, so if you like the simplicity of Go's syntax, but want modern features, seriously consider Nim. I personally couldn't get over the significant whitespace, (relying on invisible chara…
You could write a little tool that transforms the syntax you prefer into Nim's syntax before compilation.
Re: Show HN: “Nim in Action” is now available
#13Great to see Nim getting an official book, (Dominick is almost like a co-author of Nim at this point :-). My impression of Nim is that it is what Go should have been, if language developments of the past 40 years were taken into account, so if you like the simplicity of Go's syntax, but want modern features, seriously consider Nim. I personally couldn't get over the significant whitespace, (relying on invisible chara…
You could write a little tool that transforms the syntax you prefer into Nim's syntax before compilation.
Re: Show HN: “Nim in Action” is now available
#14Based on my surface-level understanding of Nim, Go is much more comparable to Nim than it is Rust. I never understood the Rust-Go comparisons, since Rust is a serious systems programming language. I would never use Go or Nim to replace C or C++ usage as I would Rust, but I might use Nim in place of Go or Java. Does anyone with significant Nim experience care to lend some opinions? I don't want to start a flame war--I…
But... generally, I would say all these languages can replace each other (well, ok, perhaps not C) given the right circumstances. Nim has one nice thing going for it - and that is very good C/C++ integration. Rust has it's safety focus and novel memory model. Go has simplicity and tooling, and popularity. Java has enterprise-focus. All have good performance.
(Nothing against Nim, I haven't worked with it yet)
Re: Show HN: “Nim in Action” is now available
#15Great to see Nim getting an official book, (Dominick is almost like a co-author of Nim at this point :-). My impression of Nim is that it is what Go should have been, if language developments of the past 40 years were taken into account, so if you like the simplicity of Go's syntax, but want modern features, seriously consider Nim. I personally couldn't get over the significant whitespace, (relying on invisible chara…
Personally I love significant whitespace and have started using Nim because of this feature, basically back in the day I just wanted a Python alternative that was compiled. If you really dislike it that much, you may be able to convince Araq to bring back his old time idea of allowing different syntaxes in Nim. As for a gofmt tool: `nim pretty` exists but may need to mature a bit.
I believe that a focus on web development is good. One of the reasons why the book has such a strong focus on it is because I have spent most of my time implementing stuff which is necessary for web dev in Nim, and I want to show it off. The fact that I have a lot of experience with it helps too.
I would love to show off as many things as I can, and I might look into including some examples of SDL, SFML, and more as well as ways to utilise Nim's real-time GC for games. But I must be careful, the book is already becoming rather large :)
As for systems, there is a whole chapter dedicated to Direct Hardware Control in the book. But I will make a note of maybe including something for native desktop developers.
In terms of the GC, I don't have as much experience using Nim with no GC as I would like. So I can't really comment as to the current situation.
In terms of a comparison to D, I've already received feedback to add D to the language comparison table in Chapter 1. To compare these properly I will need to do some research first.
Nim is very close to 1.0 now. We are planning on looking at the standard library and ensuring that it is in tip top shape before 1.0 is finally released. There is also work currently happening to make asynchronous IO multithreaded.
Thanks for the feedback and hope this answers your questions!
Re: Show HN: “Nim in Action” is now available
#16Earlier quoted context omitted.
But... generally, I would say all these languages can replace each other (well, ok, perhaps not C) given the right circumstances. Nim has one nice thing going for it - and that is very good C/C++ integration. Rust has it's safety focus and novel memory model. Go has simplicity and tooling, and popularity. Java has enterprise-focus. All have good performance.
Rust has extremely good FFI to C as well, if you were using that as a differentiation. No memory layout issues, etc like Go's issues. (Nothing against Nim, I haven't worked with it yet)
Re: Show HN: “Nim in Action” is now available
#17Based on my surface-level understanding of Nim, Go is much more comparable to Nim than it is Rust. I never understood the Rust-Go comparisons, since Rust is a serious systems programming language. I would never use Go or Nim to replace C or C++ usage as I would Rust, but I might use Nim in place of Go or Java. Does anyone with significant Nim experience care to lend some opinions? I don't want to start a flame war--I…
Nim compiles to very efficient C or C++ (or js) and most benchmarks shows Nim programs performance being almost the exact same as C/C++ - and often better than Rust. So... why not using it to replace C and C++? Since I have worked with Nim (and I use it to implement my own language) I would say "hell yes"! It is such an immensely better language and it integrates perfectly with those eco systems. The GC is a good one…
> And before pcwalton drops in with his endless spamming
about Nim not being safe, Nim being undefined
Well, it is, isn't it? Is he wrong about Nim not being safe when not using Boehm GC? Does it not segfault when sending GC pointers between threads?He only jumps in, when someone claims Nim is safe or the sweet spot, or something equally wrong. Nim's pretty syntax comes with a price, just like Rust's safety comes with a different kind of price.
Re: Show HN: “Nim in Action” is now available
#18Great to see Nim getting an official book, (Dominick is almost like a co-author of Nim at this point :-). My impression of Nim is that it is what Go should have been, if language developments of the past 40 years were taken into account, so if you like the simplicity of Go's syntax, but want modern features, seriously consider Nim. I personally couldn't get over the significant whitespace, (relying on invisible chara…
C was my first language, so I had the "significant white space" prejudice. The first time I tried it, I was hooked - because I hate code improperly indented.
Yes, you can go the gofmt route in order to eliminate indentation wars, but I love languages where the syntax enforce it: it is a very pragmatic design (no need for explicit start/end of blocks, no ";" to mark the end of the statement).
Strange enough, Nim enforces indentation but is very liberal with case sensitivity. Go figure... :-)
Re: Show HN: “Nim in Action” is now available
#19Re: Show HN: “Nim in Action” is now available
#20Earlier quoted context omitted.
> Rust is a serious systems programming language I assume the distinction you are making about "serious" is around manual memory management and the GC? In which case, I think you are probably right in your bias. That said and while i have no experience with it, Nim claims to have a real-time GC mechanism builtin. That is they support a max pause time parameter. There have been other real-time GC systems out there bef…
I have the feeling, that "in the wild" most people replace JavaScript (Node.js), Python and Ruby with Go. Rust seems to be more of a C/C++ replacement.