TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Choosing Nim out of a crowded market for systems programming languages

272 pointsby generichumanover 2 years ago

30 comments

127over 2 years ago
I have done non-trivial things both in Rust and Nim. For big projects Rust seems a little more robust, but for medium and small projects Nim is an order of magnitude faster to develop for. There are still many rough edges, but it&#x27;s exactly the tradeoffs I would personally pick for my one person small business making tools for artists. So far I have been using Rust and it&#x27;s alright, but looking very much into Nim to see if I can replace Rust because of the high cognitive load to keep all of the Rust stuff in my head, as I don&#x27;t really need safety.<p>Shout out to <a href="https:&#x2F;&#x2F;github.com&#x2F;StefanSalewski&#x2F;gintro" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;StefanSalewski&#x2F;gintro</a> which was super simple to build a simple GUI tool. With Rust I have no idea what to use after trying 5 different libraries.<p>The downside of Nim seems to be highly unpredictable performance in my experience. With Rust it&#x27;s much easier to control. This might be a deal-breaker unless I can find some solution to it. Maybe it&#x27;s just using it more than two weeks and learning the ropes.
评论 #33749041 未加载
评论 #33749586 未加载
评论 #33748979 未加载
评论 #33750681 未加载
cdaringeover 2 years ago
&gt; I feel inferior for not being fluent in OCaml<p>I learned OCaml recently, on my own, for myself. It’s actually a pretty easily language to use and learn, but historically there weren’t EXCELLENT resources for learning it.<p>There are now excellent resources, predominantly: <a href="https:&#x2F;&#x2F;cs3110.github.io&#x2F;textbook&#x2F;cover.html" rel="nofollow">https:&#x2F;&#x2F;cs3110.github.io&#x2F;textbook&#x2F;cover.html</a><p>When OCaml 5 settles, its general applicability will be (imho) much larger.<p>Do I recommend it for everything? No. But you wont hit segfaults like you will in go, and you certainly wont wrastle the compiler like you will rust. Haskell and OCamls lack of fluent programming make them less easy to program in (read: slower iteration), if you get your design right, your final product is just a real treat :chefs_kiss:. Some newer fp langs do have fluent style syntaxes, which are<p>The ocaml debugging experience stinks, and the lack of builtin (de)serializers for custom&#x2F;composite types is very obnoxious, to put it kindly. Still, it’s not the obscure thing everyone loves to say about it. Really, its not.<p>These jokers in this thread “oh rust isnt hard! Ohhh they probably didnt try much.” Respectfully, get outta here. I love rust. Taken the doubly linked list tutorial? How about needed to use anything with Pin? Rust requires a huge surface area of foundational knowledge to be productive, full stop—the author is absolutely within his right to make this very fair claim about rust being onerous, relative to his candidate pool
评论 #33750021 未加载
评论 #33750335 未加载
ezquerraover 2 years ago
I recently started using nim for some little side projects and I am having so much fun. Somehow they’ve managed to combine the strengths of high level languages such as python with those of low level, systems languages like C with few (if any) of the drawbacks. It’s pretty amazing to be honest.<p>Programming in nim feels a lot like programming in a statically typed Python, except that you get small, fast, single file executables out of the box.<p>Compared to C++ you don’t need to worry about memory allocations too much except when you really want to, and when you do it is much simpler than in C or C++. It is also much easier to control mutability and the type system is much better. Also you can use most of the language at compile time in a much more elegant way than in modern C++.<p>Another surprising thing is that while the ecosystem is obviously much smaller than on more popular languages, the fact that it has a built-in package manager gives you access to it much more easily than in C++. There are a lot of high quality packages (such as datamancer, arraymancer and ggplotnim) which makes nim very productive in a lot of domains.<p>That’s not even including advanced things such as nim’s excellent macro system which I personally don’t use (but which enable some of the best nim libraries).<p>Oh, and I _love_ nim’s uniform function call syntax. Every other language should copy that feature.<p>I almost forgot to list the drawbacks. The main one of course is that it is not the most popular language (but the ecosystem is big enough that I didn’t find it is a big problem for my use case in practice). Other than that the editing and debugging experience could be improved. There is a decent VS Code plug-in (look for the one made by “saem”) but it is just OK, not great. There is some integration with gdb but it is a bit rough. I usually end up adding logs when I need to debug something.
whageover 2 years ago
The author seems to be very knowledgeable about the different aspects of programming. Whether you agree with his opinions or not, this article I think is a great starting point for learning about many interesting topics. Definitely bookmarked for later.
评论 #33747954 未加载
dataflowover 2 years ago
&gt; Zig is truly compatible with C and will compile C code directly, since its compiler is actually written in C++.<p>I assume this was intended to say something else?<p>&gt; Here&#x27;s the brutal truth: I can&#x27;t find anyone under the age of 41 in my field to say a single positive thing about D<p>IIRC the presence of the GC in D was (is?) its Achilles heel. Because the GC is infectious. As soon as your dependency needs it (and IIRC even parts of the standard library did&#x2F;do), it becomes painful if not impossible for you to avoid it. Had it not had this fatal flaw, D might&#x27;ve fared much better.
评论 #33748248 未加载
评论 #33747872 未加载
评论 #33749931 未加载
Cyph0nover 2 years ago
&gt; [..] I decided that I need a safe, fast, and statically typed language that can be compiled and targeted to both mobile and desktop environments, as well as being made available to scripting languages via FFI.<p>And you eliminated Rust because.. it’s too complicated? It meets these requirements to the letter! Since this is a greenfield effort, would it really be too expensive to invest some time to learn it?<p>Anyways, I wish OP the best with Nim. I’ve always found it to be an interesting language.
评论 #33748414 未加载
评论 #33748740 未加载
评论 #33750091 未加载
评论 #33774402 未加载
nu11ptrover 2 years ago
&gt; Rust: I&#x27;m not afraid to admit it - Rust is just too complicated for use as an aging and cranky solo developer.<p>...<p>&gt; As someone who actually hates to code for coding&#x27;s sake and wants to Get Sh!t Done, Rust is just antithetical to my relationship with computers. I don&#x27;t want to have to think about the language, and that&#x27;s all Rust wants you to think about.<p>My guess: the author hasn&#x27;t even tried it other than a cursory glance. I don&#x27;t feel at all the way the author does about Rust. I do somewhat about Haskell I admit, although I like it just fine, but Rust is very much a &quot;get it done&quot; language, not something for academics. The only exception to this is the borrow checker, which isn&#x27;t near the impediment most people think it is, but it does take a little practice. I learned it at 45 without issue, just a little bit of time. At this point, I code Rust as fast as any other language (probably faster when including debugging time - I almost never have to debug my Rust code).
评论 #33749818 未加载
评论 #33750346 未加载
评论 #33750055 未加载
评论 #33750048 未加载
评论 #33751141 未加载
greyboxover 2 years ago
Im currently writing a multiplayer game client (personal project) in nim +SDL2 which is comes with bindings for. Now and then I hit some obtuse compiler error messages, and the compilation times aren&#x27;t the best. But honestly I&#x27;m glad I chose it over c++, which has been my default choice in the past. I wanted to try something new and I&#x27;m glad I stumbled across it at the right time
npalliover 2 years ago
Would have liked to see an opinion on the large number of memory management techniques for Nim [1]. Seven types(!) ranging from GC&#x27;s to manual. Surely this makes reasoning of performance very hard. Where do you focus - your program or the memory management options. Perhaps in practice everyone has settled on one of them(?)<p>[1] <a href="https:&#x2F;&#x2F;nim-lang.org&#x2F;1.4.0&#x2F;gc.html" rel="nofollow">https:&#x2F;&#x2F;nim-lang.org&#x2F;1.4.0&#x2F;gc.html</a>
评论 #33748433 未加载
评论 #33750509 未加载
rich_sashaover 2 years ago
I&#x27;m choosing between learning Nim or Rust. Nim frankly looks like the nicer of the two, but also less marketable and with smaller community.<p>Suck to say but it&#x27;s true.
评论 #33751415 未加载
评论 #33747821 未加载
StillBoredover 2 years ago
I tend to be a C with objects (compiled with a C++ compiler) type of person because I think things like the base string, memory blob, etc types in C should have the ability to have bounds checking built in at compile time if the programmer chooses. Simply fixing the few things &quot;wrong&quot; with C I tend to think gets you 95% of the way to a heavier weight environment like java&#x2F;etc.<p>So, I can&#x27;t help but feel that all these languages are trying to solve that last couple percent, and paying a huge price in perf or programmer productivity to do it, at the cost of basically close to 0% bugs actually being reduced. Particularly when compared with C++ and Ada when used in a rigorous development environment.<p>Nim seems like the kind of thing (a veneer over C) I would want, along with an easy of interfacing to the rest of a C based project, but I always just tend to end up reaching for C with classes, when I need to get something done yesterday, and it needs to fit in a few K, or push the metal to the limit. Largely because I trust I won&#x27;t get myself in a corner with it.<p>(PS: I too tried rust and tossed it as not ready, and not really solving the right problem. I don&#x27;t tend to have memory concurrency bugs in either C or C++ because I don&#x27;t try to be clever, instead defaulting to simple ownership models wrapped in C++ classes, or fully containing locking&#x2F;etc in a single function that does all the work of both locking and unlocking the data structure in question and reading&#x2F;updating it through a single entry&#x2F;exit).
评论 #33751427 未加载
评论 #33753819 未加载
jstx1over 2 years ago
Importantly it&#x27;s a decision made as a solo developer at a tiny company. Otherwise it&#x27;s not like there are any Nim jobs out there, or any serious mindshare&#x2F;momentum, or significant investment from big companies.
lamontcgover 2 years ago
&gt; Rust: I&#x27;m not afraid to admit it - Rust is just too complicated for use as an aging and cranky solo developer.<p>I&#x27;m nearly 51 and currently learning Rust.<p>The first 10 hours of it were horribly slow, but it isn&#x27;t as steep of a learning curve as Optimal Control Theory.
评论 #33749829 未加载
评论 #33749610 未加载
jmartin2683over 2 years ago
I really can’t understand where this idea that rust is ‘hard’ comes from. Everything that it formalizes is something that you <i>should already be conscious of</i>. If not, well… you have a different, bigger problem.
评论 #33748324 未加载
评论 #33748266 未加载
评论 #33749200 未加载
评论 #33749642 未加载
评论 #33750404 未加载
bmachoover 2 years ago
&gt; Pony has probably the best type system in any language existing today, giving even Haskell a run for its money.<p>In what sense?
Escapadoover 2 years ago
What’s the LSP and linter&#x2F;formatter story these days? Last time I tried it the lsp was miles behind what I am used to from TypeScript land in vscode. I have gotten sooo used to all the auto completion, helpful error tooltips and auto imports and formatting on save that it felt tedious not to have that in a similar capacity. Maybe I was just doing things wrong and it’s been a while. In general I am super intrigued by nim coming from python originally. I wish I could use it professionally on a project just to spend more time with it
评论 #33748452 未加载
评论 #33751549 未加载
mlinksvaover 2 years ago
Aside, curious what this bit of the post refers to:<p>&gt; Pros for Swift are focus on secure programming outside of just obsessing over memory safety like Rust.<p>I&#x27;ve never used Swift at all but would enjoy learning what it brings to the &quot;secure programming&quot; table that I might be missing from the summary at <a href="https:&#x2F;&#x2F;www.swift.org&#x2F;about&#x2F;#safety" rel="nofollow">https:&#x2F;&#x2F;www.swift.org&#x2F;about&#x2F;#safety</a><p>Another aside, the author gets some points for looking at Pony.
评论 #33749016 未加载
seanwilsonover 2 years ago
&gt; OCaml, Haskell, F#, and other weirdos: I personally can&#x27;t do it. I tend to not like functional programming languages. I want to, but my brain lacks the plasticity to relearn everything.<p>Why would you find OCaml hard to learn if you know Nim? Isn&#x27;t Nim a functional programming language as well?<p>Also, how is Nim for writing real-time games that run via JavaScript where you want to avoid garbage collection pauses?
评论 #33749247 未加载
评论 #33751259 未加载
MrBuddyCasinoover 2 years ago
&gt; I think the D folks fell into the same trap as Rust in trying to support every esoteric programming fetish stemming from toy-project and side-hustle demands among People Who Code.<p>Chef‘s kiss.
svnpennover 2 years ago
My issue is that Nim has some awkward problems with static linking:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nim-lang&#x2F;Nim&#x2F;issues&#x2F;15220" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nim-lang&#x2F;Nim&#x2F;issues&#x2F;15220</a>
sergiotapiaover 2 years ago
Nim desperately needs a real web framework (batteries included) and a proper ORM and it will take off like wildfire. Python on steroids.
评论 #33749257 未加载
评论 #33751541 未加载
评论 #33747836 未加载
评论 #33748810 未加载
评论 #33747834 未加载
v3ss0nover 2 years ago
Nim still need a lot of time to mature, there are totally ridiculous decision of things that core things have done like style insensitivity and half a decade old serious bugs that Nim team ignore to fix cause Nim adoption to low. 5 years ago it was on rival to rust but now rust had sky rocketed and Nim community is having a lot of in fighting going.
ilovecachingover 2 years ago
The best language to learn and use right now for systems programming is C&#x2F;C++. It is by far the most marketable skill with 99.999999% of all low level systems written in C or C++. Large scale systems used by companies that pay top salaries for developers (Google&#x2F;Meta) are written in C++. There is more material out there for learning and mastering these languages than any other language save maybe Python or JavaScript.<p>If you are not an expert at C or C++ and being paid to learn Rust or Nim, you’re actively harming your career by not mastering the languages that people want today. If learning hot new fads brings you joy, then perhaps the intrinsic value outweighs the real world loss, but it’s the hard to swallow truth.
评论 #33748315 未加载
评论 #33749853 未加载
评论 #33747971 未加载
评论 #33751049 未加载
评论 #33748161 未加载
drewm1980over 2 years ago
&quot;I started out coding in the mid-90s and refocused my career on Bitcoin and crypto in 2016 after leaving a very large software company in Seattle.&quot;<p>You&#x27;re embarrassed to have worked at Microsoft but not on crypto pyramid schemes?
anta40over 2 years ago
Hmm.. wonder why Pascal isn&#x27;t on the list
评论 #33751222 未加载
评论 #33750306 未加载
ksecover 2 years ago
It will be interesting to look again once Nim reaches 2.0. And Crystal still requires lots of work on compiler and Windows Support. I just wish it had more resources. Along with Zig. All three of them need more time to mature.
jopythonover 2 years ago
Nim does not have a native ssl and regex lib in the standard library like golang or python. These libraries are taken for granted nowadays.
评论 #33749322 未加载
germandiagoover 2 years ago
This comparison looks more like a discourse than anything else IMHO.
newaccount2021over 2 years ago
biggest con of Nim - no one uses it, so you will probably hit a toolchain&#x2F;compiler error which will be very frustrating<p>too similar to Go to not go with the 100x community size Go brings with it
评论 #33747905 未加载
评论 #33750500 未加载
encryptluks2over 2 years ago
If I recall Nim doesn&#x27;t even allow tabs. Programming languages should not be overly opinionated in formatting, especially when it requires extra bytes to use spaces.
评论 #33748709 未加载
评论 #33748800 未加载
评论 #33748975 未加载
评论 #33748862 未加载
评论 #33748900 未加载