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.

Pointer Free Programming and the Future of Nim

205 pointsby mindBover 7 years ago

10 comments

dom96over 7 years ago
Hello guys. I&#x27;m one of the core Nim developers, together with Araq (the creator of Nim) who should also be hanging around this thread. Feel free to ask us anything.<p>This submission is likely the result of the recent livestreams that myself and Araq have been making. You can check out my past livestreams[1] and Araq&#x27;s[2] at the links below. If you&#x27;re into watching us live the next time we create a livestream then follow d0m96 (<a href="https:&#x2F;&#x2F;go.twitch.tv&#x2F;d0m96" rel="nofollow">https:&#x2F;&#x2F;go.twitch.tv&#x2F;d0m96</a>) and araq4k (<a href="https:&#x2F;&#x2F;go.twitch.tv&#x2F;araq4k" rel="nofollow">https:&#x2F;&#x2F;go.twitch.tv&#x2F;araq4k</a>) on Twitch.<p>1 - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=UQ4RvUlXIDI&amp;index=3&amp;list=PLm-fq5xBdPkrMuVkPWuho7XzszB6kJ2My" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=UQ4RvUlXIDI&amp;index=3&amp;list=PLm...</a><p>2 - <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=E2qlDKm_WzE" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=E2qlDKm_WzE</a>, <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=UV38gQfcb9c" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=UV38gQfcb9c</a>
评论 #15519419 未加载
评论 #15515360 未加载
pavlovover 7 years ago
I’m not a huge fan of the modern C++ style that obsessively avoids null pointers and instead uses object references that are created in an invalid&#x2F;empty state. With a pointer there is a single way to represent “nothing”, regardless of what the object represents. With a reference I have to go read the API to understand the “nothingness” states.<p>Also, when you’re thinking in pointers, it’s easy to add levels of indirection with the same mental tools (pointers to pointers, etc.) Personally I find it’s easier to solve problems with a limited orthogonal toolset than a sprawling array of marginally differently balanced optimizations, which is what most of C++ has become.
评论 #15512773 未加载
评论 #15513066 未加载
评论 #15512991 未加载
评论 #15514211 未加载
评论 #15513426 未加载
评论 #15514384 未加载
评论 #15515902 未加载
评论 #15514278 未加载
评论 #15515116 未加载
评论 #15515276 未加载
评论 #15514150 未加载
tempodoxover 7 years ago
Completely off-topic, bit I feel compelled to mention this: The timestamping of this article is exemplary.<p>Even if it only showed a date, and no time, the time zone is relevant. The Internet is supposed to be for the whole world, not just one time zone.
audunwover 7 years ago
Does this mean that Nim 1.0 will be postponed even further?<p>That&#x27;s OK, it&#x27;s better to get it right, and it&#x27;s still useful for small projects in the meantime. But Nim seems like a language that is never truly finished.<p>I like this direction. I tried to avoid &quot;ref&quot; in my last Nim project, but it&#x27;s too hard to do that for every type the way the language is currently designed.
评论 #15514888 未加载
评论 #15514707 未加载
seertaakover 7 years ago
I&#x27;m a C++ dev and this sounds extremely interesting. I have nim a spin a year ago and really liked what I saw, but GC was a real issue because I&#x27;m doing audio development where you end up having to circumvent the GC anyway. I would love to allow my users to create MIDI plugins with nim and this is a key step towards that.
评论 #15514815 未加载
评论 #15514906 未加载
userbinatorover 7 years ago
The syntax and title reminds me of standard Pascal, which has very constrained pointers that, among other things, you can&#x27;t do arithmetic with --- eventually leading to code that basically reinvents memory itself by using a large array and lots of indexing operations.<p>(Look at Donald Knuth&#x27;s TeX for an example of this style.)
评论 #15515190 未加载
评论 #15514777 未加载
duneroadrunnerover 7 years ago
First let me say that I&#x27;m not familiar with Nim. But I understand that it compiles&#x2F;transpiles to C&#x2F;C++. And it sounds like they&#x27;re now trying to move away from dependency on the GC. In that case, might I suggest they consider switching the transpile target to SaferCPlusPlus[1]. It might make things easier as it already addresses the &quot;efficient memory-safety via scope lifetimes without a borrow-checker&quot; issue. And also the (data race) safe sharing of objects between threads. (Note that the documentation is currently rather out-of-date, and a major update is coming.)<p>[1] shameles plug: <a href="https:&#x2F;&#x2F;github.com&#x2F;duneroadrunner&#x2F;SaferCPlusPlus" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;duneroadrunner&#x2F;SaferCPlusPlus</a>
评论 #15514795 未加载
jamesuover 7 years ago
The other year I tried to implement a GC on top of an existing scripting language to handle circular dependency cases. A big problem however was the existing system for referencing objects wasn&#x27;t particularly well designed for this particular case (e.g. no roots, no thread safety), and I couldn&#x27;t come up with a solution I found satisfactory and fool-proof.<p>The fact the author had so many problems with GC bugs is somewhat reassuring. Would be interesting to see a GC-less Nim in a production use-case.
tomsmedingover 7 years ago
That sink concept sounds <i>really</i> cool. I would really want that semantic in my C and C++ code.
评论 #15515683 未加载
ndh2over 7 years ago
Suggestion: Add a date, the author, and possibly some version number that indicate what iteration of Nim this refers to.