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.

Nim Programming Language 0.11.0 released

162 pointsby def-about 10 years ago

13 comments

wiremineabout 10 years ago
It&#x27;s a little thing, and not uncontroversial, but I&#x27;m excited to see another language besides Python adopt whitespace. In general I wish more languages provided a way to enforce code layout.<p>After using Python professional (and managing a team of developers) for a few years, whitespace is a great way to keep things readable as more people touch code.<p>Whitespace isn&#x27;t the only way to do it, of course. Go&#x27;s &quot;gofmt&quot; is a good example of a different way to enforce code layout. [1]<p>[1] <a href="https:&#x2F;&#x2F;blog.golang.org&#x2F;go-fmt-your-code" rel="nofollow">https:&#x2F;&#x2F;blog.golang.org&#x2F;go-fmt-your-code</a>
评论 #9466138 未加载
评论 #9466142 未加载
评论 #9466410 未加载
评论 #9467880 未加载
keypusherabout 10 years ago
I notice they have now included the Aporia IDE and Nimble package manager in the Windows installer. This seems like a good step toward getting newcomers up and running quickly, and getting more feedback from the community about the core tools. It seems like many new languages are going with this route of tools supported by core-dev, such as package management. For instance Go ships its code formatting tool, which seems like a good idea. Supporting an IDE seems more questionable, for instance Python never seemed to have much success with IDLE, and IDE preference is very personal. Anyway, as someone who primarily writes Python at work I find Nim to be very usable because the syntax and style is so familiar, and I really like most of the decisions they have made. I prefer Nim&#x27;s static typing and compiled executables for redistribution, and they have introduced nice new concepts around concurrency and more advanced language features. Definitely looking forward to using this language more and more as it moves toward 1.0
bltabout 10 years ago
It&#x27;s very exciting that Nim has generator syntax in a compiled, statically typed language. To me, recursive generators with &quot;yield&quot; and &quot;yield from&quot; expressions are the most natural way to express iterative algorithms.<p>The Ranges proposal for C++17 is great for <i>consuming</i> generic algorithms, but it&#x27;s far behind generators for <i>creating</i> generic algorithms. Simple example: try to write an iterator for a tree that doesn&#x27;t have parent pointers. With ranges or iterators, you must maintain a stack as a data member. With recursive generators, the variables on the stack are captured implicitly in the language. I only know a little about compilers, but it seems like a compiler with syntax tree knowledge of the entire program should be able to optimize generators into machine code that&#x27;s just as good as iterators - i.e. not copying all the caller-save registers onto the stack every time a generator recurses.<p>I think generator syntax is truly a killer feature for any kind of serious algorithmic work. C++11 made it a lot easier to write and use generic algorithms, but writing iterators is still a big task that reluctant C++ programmers avoid. IMO, fear (and actual difficulty) of writing iterators is the main reason most people don&#x27;t enjoy C++. If C++ had shipped with generators from the beginning, I think the programming language landscape would be very different today.<p>Nim seems to have a small community and limited promotion, so I do not feel especially hopeful that it will compete with C++ at the same level as Rust. (I am not sure if Rust will upset C++ in any significant way either!) Perhaps a well curated set of Nim&#x2F;Rust&#x2F;C++ comparisons could convince the C++ standards committee or the Rust team to add generator syntax.
评论 #9468403 未加载
Cyph0nabout 10 years ago
Congratulations to the Nim team!<p>I did a quick comparison between the up and coming compiled languages (D, Rust, Nim, Go) and C++ a week or so back. My main aim was to assess the final statically linked binary size for a simple hello world program.<p>Here are the results on x64 Mint:<p>1. C++: 1.6 MB<p>2. Go: 1.9 MB<p>3. Rust: 550 KB with dependencies (I was not able to figure out how to pass a static option to rustc)<p>4. D: 710 KB, same as Rust<p>5. Nim: 970 KB, statically linked<p>Nim wins, by a large margin. I did not remove any of the runtime checks by the way. Removing them actually saves 100 KB+, depending on the program. Furthermore, the Nim program was actually a naive Fibonacci number calculator, not a simple hello world, meaning that Nim should have been at a disadvantage! Amazing stuff.
评论 #9466269 未加载
评论 #9467288 未加载
评论 #9465954 未加载
评论 #9467000 未加载
ziotom78about 10 years ago
Congratulations to the developers for the impressive list of improvements and fixes! Nim is becoming my first choice of programming language in a large number of situations.<p>I hope to see version 1.0 soon. Keep up the good work!
mwcampbellabout 10 years ago
Good to see the Nim project moving closer to a solid 1.0.<p>Now all we need is a cross-platform GUI library that uses native widgets on each platform, such as a set of bindings for wxWidgets or (better yet) a translation of SWT from Java to Nim, and we&#x27;d have an excellent foundation for self-contained, cross-platform desktop apps. Yes, I know desktop apps aren&#x27;t trendy (at least on platforms other than Mac), but they&#x27;re still important.
zimbatmabout 10 years ago
Does Nim still allow indifferent `fooBar()` and `foo_bar()` to access the same function call ? It makes grep-powered refactoring unnecessarily hard.
评论 #9465903 未加载
评论 #9465969 未加载
评论 #9466023 未加载
评论 #9467121 未加载
zyxleyabout 10 years ago
I hadn&#x27;t seen this language before, but it looks neat. Coming from a Ruby background, it&#x27;s very interesting to see Nim&#x27;s pragmas and templates, as they look rather like type-checked and compiled cousins of metaprogramming methods.
评论 #9466671 未加载
copxabout 10 years ago
&gt; starting with version 1.0, we will not be introducing any more breaking changes to Nim.<p>I wonder whether they will stay committed to that. Pretty much all developers of other &quot;living&quot; languages I know who do not have strong industry support and thus pressure not to break working code introduce breaking changes all the time e.g. see D.<p>Nim could distinguish itself from the crowd with such a commitment to stability. However I expect overwhelming pressure from the enthusiast crowd which currently utterly dominates among Nim users to introduce breaking changes even post-1.0. And with little pressure from the other direction..
评论 #9466212 未加载
bernardt32zabout 10 years ago
Maybe off-topic, but why exactly do we have hard and soft real-time? I think this is terrible, either you have deadlines or you don&#x27;t. E.g. in games which lag you are missing deadlines and the result is terrible.<p>Currently it seems that we distinguish between hard-real-time, soft-real-time and no-real-time, but probably we should just have hard realtime everywhere and if we do not care, we just give big numbers. I mean even if you are not hard realtime you&#x27;re are probably expecting results before the heat death of the universe, so maybe it would be a nice idea to NOT abstract time in programming languages but give the possibility to the programmer to annotate timing constraints in e.g. function&#x27;s definitions? E.g. such information could be crucial to the GC.<p>Maybe we could build such a mechanism into a fancy type theory?
评论 #9467925 未加载
评论 #9469155 未加载
phantom_oracleabout 10 years ago
I really wish I had a use-case for this powerful static language, but alas I am no ninja, guru, zen-master, sensei or rocket-scientist who is working on a problem that really needs this level of power&#x2F;performance.<p>Python will always be &quot;good enough&quot;.
评论 #9467046 未加载
评论 #9470912 未加载
jlebrechabout 10 years ago
I want to build something like meteor that leverages nim&#x27;s compile to JS and C.
stefantalpalaruabout 10 years ago
&gt; Negative indexing for slicing does not work anymore! Instead of a[0.. -1] you can use a[0.. ^1].<p>What&#x27;s the justification for this change?
评论 #9466874 未加载
评论 #9467416 未加载