7 ms·
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 hav
by AsyncAwait 11y ago
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 characters doesn't sit well with me) [1], but apart from that I like the language a lot!
@dom96 Do you think that the focus on web development is good to have? I realise that it is what a ton of people do these days, but since web developers already have so many technologies to pick from, perhaps selling the book as aimed more at system/game even native desktop developers could spring up more interest.
Also, how exactly is the garbage collector tied to the standard library and the language itself?
For example, if I opt out of the GC completely, would I end up in a situation similar to D, where I'm not using GC but everything around me still is, so I have to carefully program around it, or is it handled differently?
(And can you possibly compare Nim and D as the languages seem to be covering similar territory.)
Lastly, what major work still needs to be done before we see a 1.0 release and how best can we help Nim to move towards that goal right now?
Thanks, back to the book now...
1 - Maybe a gofmt style tool would help somewhat.
- sdegutis 11y agoYou could write a little tool that transforms the syntax you prefer into Nim's syntax before compilation.
- dom96 11y agoThank you for the kind words! I'm happy that you can see the positives in Nim even though you dislike one of its most prominent features. 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!
- pathsjs 11y agoWhat is `nim pretty`? I tried it, but it does not exist in current devel
- dom96 11y agoSorry, looks like it was moved to this tool: http://nim-lang.org/docs/nimfix.html http://nim-lang.org/docs/nimfix.html
- 15155 11y agoDoes nim have a cross-thread, single shared heap or thread-ownership-assignment of memory yet? I don't think it is possibly to cleanly implement a epoll/kqueue-backed multi-threaded (web)server/reactor without it.
- scardine 11y agoI guess you are not a great fan of Python. 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... :-)
- Symmetry 11y agoI'd be violently allergic to the case insensitivity in a dynamically typed language where you could declare a variable with something like "foo = 1" but I'm fine with it in Nim. EDIT: s/sensitivity/insensitivity/
- masklinn 11y ago> I'd be violently allergic to the case sensitivity in a dynamically typed language where you could declare a variable with something like "foo = 1" but I'm fine with it in Nim. Do you mean "case insensivity"? AFAIK dynamic languages where you can do that are very much case-sensitive, Python and Ruby certainly are.
- scardine 11y agoYou are technically correct - the best kind of correct. I agree, but my concern is not correctness, it is aesthetics. Why? Reading a computer program is often harder than writing it from scratch, so I like when languages enforce (or at least encourage) a name convention - just to keep it easier to read. Does Nim have something like PEP-8?
- dom96 11y ago> Does Nim have something like PEP-8? https://github.com/nim-lang/Nim/wiki/Style-Guide-for-Nim-Code https://github.com/nim-lang/Nim/wiki/Style-Guide-for-Nim-Cod...
- 11y ago
- mixmastamyk 11y ago> I personally couldn't get over the significant whitespace, (relying on invisible characters doesn't sit well with me) Most editors can be configured to show whitespace. Either in a low contrast color to avoid creating too much noise, or toggled in/out when needed.
- dom96 11y agoJust realised that I forgot to answer one of your questions. > how best can we help Nim to move towards that goal right now? There are many ways. One way of course is to use Nim, test it, give us feedback, write Nim libraries and tell other people about it. But the best way is to get directly involved in Nim's development on Github, help us fix bugs, discuss the future direction of the language and help us implement new features. Here is a list of "Easy" bugs to get you started: https://github.com/nim-lang/Nim/labels/Easy https://github.com/nim-lang/Nim/labels/Easy Another alternative is donations. Nim accepts donations through Bountysource[1], and Gratipay[2]. 1 - https://www.bountysource.com/teams/nim https://www.bountysource.com/teams/nim 2 - https://gratipay.com/nim/ https://gratipay.com/nim/
- giuliano108 11y ago> Lastly, what major work still needs to be done before we see a 1.0 release and how best can we help Nim to move towards that goal right now? Better standard library support for Go-style CSP. Given that CSP is one of Go's biggest selling points, it'd be great if people could easily translate concurrent Go programs to Nim and see the benefits. Right now the lack of a "select" statement makes that quite hard, especially for a beginner.