TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Programming in D: Tutorial and Reference

147 点作者 teleforce22 天前

14 条评论

usrbinenv22 天前
I constantly feel like inferior languages are picked up, while superior languages are discarded. It&#x27;s almost as if the universe had a law: &quot;inferior technology is always preferred no matter how hard you seethe&quot;.<p>Examples:<p><pre><code> * Python preferred over Ruby * TypeScript preferred over Dart or even JavaScript (which is fine and, as a bonus, doesn&#x27;t require compilation step like TS) * Go is preferred over Crystal and D. </code></pre> While Python, TypeScript and Go are quite alright, there is no doubt in my mind that their alternatives are absolutely superior as languages. Yes, in case of Dart, Crystal and D the ecosystem doesn&#x27;t have the abundance of well-tested libraries, but as languages they are simply better. The Go argument that it&#x27;s popular because it&#x27;s simpler is absurd in the sense that no one really forces you to write complex code and use classes or other advanced OOP features in D.
评论 #43802144 未加载
评论 #43800728 未加载
评论 #43802418 未加载
评论 #43810515 未加载
评论 #43801262 未加载
评论 #43810346 未加载
评论 #43804822 未加载
评论 #43800688 未加载
评论 #43802028 未加载
评论 #43801977 未加载
评论 #43800902 未加载
评论 #43810365 未加载
评论 #43808022 未加载
评论 #43804929 未加载
WalterBright22 天前
Currently I&#x27;m working on adding an AArch64 code generator to the venerable dmd D compiler. It&#x27;s fun as it&#x27;s completely differernt from the X86_64. In some ways very clever and in some ways completely wacky.
zascrash22 天前
D deserves more recognition. It&#x27;s a cool language under the radar for too long. I wish a major corporation backed it. I had a great time learning D. Also I admire Walter Bright If I could achieve even a fraction of his productivity, that would be awesome.
评论 #43800321 未加载
shoozza22 天前
Slightly off topic: Is D a good language for creating tiny windows or Linux executables? There is an upcoming game jam (4mb jam 2025) which gives extra points for game submissions &lt;= 8KB. With c you can fit a window with graphics update in an executable of less than 900 bytes[0]. Granted it&#x27;s using crinkler for linking which does some compression.<p>0: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;ske2004&#x2F;336d8cce8cd9db59d61ceb13c1ed500a" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;ske2004&#x2F;336d8cce8cd9db59d61ceb13c1ed...</a>
评论 #43800232 未加载
Daunk22 天前
I feel like D is such an underrated language.
评论 #43798840 未加载
评论 #43799905 未加载
kingbob00022 天前
Love D! I used it a bit in college when it was required for a programming language class. It&#x27;s hard to justify using it nowadays though.
评论 #43799117 未加载
croemer22 天前
Anything compiled with LDC2 &gt;=1.29 (3y old) will immediately crash&#x2F;segfault on macOS &gt;=15.4<p>A fix is on master&#x2F;beta but will still take some time to be released.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;dlang&#x2F;dmd&#x2F;issues&#x2F;21126">https:&#x2F;&#x2F;github.com&#x2F;dlang&#x2F;dmd&#x2F;issues&#x2F;21126</a>
评论 #43820844 未加载
acehreli22 天前
Author here... AMA.
评论 #43800632 未加载
评论 #43799082 未加载
bachmeier22 天前
Been a heavy user of the language since 2013. This book was very helpful at the time. I don&#x27;t think it was a book at that time, though, more a lengthy collection of notes as I recall.
评论 #43799222 未加载
pmags21 天前
It&#x27;s been about 10 years since I last dipped my toes in the D waters.<p>At the time (v 2.067) I stumbled across some surprisingly bad warts in the standard library that prevented me from using it for my intended purposes which writing software tools for bioinformatics.<p>As other posters have noted, language elegance is secondary to the ecosystem when you want to get things done.<p>For anyone who has been using D for an extended period, has the D ecosystem improved &#x2F; expanded considerably in the last 5-10 years?
评论 #43810886 未加载
nerdralph22 天前
I tried D several years ago, and liked the language. I didn&#x27;t stick with it because of the lack of libraries compared to perl, python, C++, etc.
jpecar22 天前
Is D runtime still crashing when host has more than 128 cpu cores? I learned this the hard way ...
评论 #43799436 未加载
评论 #43799070 未加载
bsdooby22 天前
One of the best language reference manuals out there...
评论 #43799075 未加载
Defletter22 天前
Really wanted to like Dlang but I just did not have a good time with it.<p>One of my projects has a really simple server written in nodejs that&#x27;s basically (in terms of complexity) just an auth&#x27;d chatroom, and I wanted to switch it from using raw tcp sockets to websockets. And since the server is so simple, why not refactor it to another language and see if there&#x27;s no some performance gains from that? I ended up doing something pretty similar to that &quot;Comparing 10 programming languages. I built the same app in all of them.&quot; video from Tom Delalande (<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=-MbTj8DGOP0" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=-MbTj8DGOP0</a>). I had several working versions of the server in:<p>- Bun, using Bun APIs (<a href="https:&#x2F;&#x2F;bun.sh&#x2F;docs&#x2F;api&#x2F;websockets" rel="nofollow">https:&#x2F;&#x2F;bun.sh&#x2F;docs&#x2F;api&#x2F;websockets</a>)<p>- Dart, using Dart APIs (<a href="https:&#x2F;&#x2F;api.dart.dev&#x2F;stable&#x2F;latest&#x2F;dart-io&#x2F;WebSocket-class.html" rel="nofollow">https:&#x2F;&#x2F;api.dart.dev&#x2F;stable&#x2F;latest&#x2F;dart-io&#x2F;WebSocket-class.h...</a>)<p>- Java, using Java-WebSocket (<a href="https:&#x2F;&#x2F;github.com&#x2F;TooTallNate&#x2F;Java-WebSocket">https:&#x2F;&#x2F;github.com&#x2F;TooTallNate&#x2F;Java-WebSocket</a>)<p>- Kotlin, using Ktor (<a href="https:&#x2F;&#x2F;start.ktor.io&#x2F;p&#x2F;ktor-websockets" rel="nofollow">https:&#x2F;&#x2F;start.ktor.io&#x2F;p&#x2F;ktor-websockets</a>)<p>- Rust, using tokio-tungstenite (<a href="https:&#x2F;&#x2F;docs.rs&#x2F;tokio-tungstenite&#x2F;latest&#x2F;tokio_tungstenite&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;docs.rs&#x2F;tokio-tungstenite&#x2F;latest&#x2F;tokio_tungstenite&#x2F;i...</a>)<p>- Zig, using websocket.zig (<a href="https:&#x2F;&#x2F;zigistry.dev&#x2F;packages&#x2F;karlseguin&#x2F;websocket.zig&#x2F;" rel="nofollow">https:&#x2F;&#x2F;zigistry.dev&#x2F;packages&#x2F;karlseguin&#x2F;websocket.zig&#x2F;</a>)<p>- D, using serverino (<a href="https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;serverino" rel="nofollow">https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;serverino</a>)<p>And Dlang was, by far, the worst experience out of the lot. Firstly is the lack of adequate, comprehensive, and centralised tooling. I almost gave up when dmd could not even compile a freshly init&#x27;d project. The impression I got is that you&#x27;re not really meant to use dmd directly, you&#x27;re meant to use dub, like how you compile Java projects with Maven&#x2F;Gradle, not javac. Except that there&#x27;s also apparently three competing compilers (<a href="https:&#x2F;&#x2F;wiki.dlang.org&#x2F;Compilers" rel="nofollow">https:&#x2F;&#x2F;wiki.dlang.org&#x2F;Compilers</a>)? And good luck remembering the names of the tooling because they&#x27;re all some random three-letter combination.<p>Serverino makes <i>heavy</i> use of mixins and attributes (think Java annotations), which is not ideal. But what really killed the deal was (despite using the recommended intellij plugin (<a href="https:&#x2F;&#x2F;wiki.dlang.org&#x2F;IDEs" rel="nofollow">https:&#x2F;&#x2F;wiki.dlang.org&#x2F;IDEs</a>) with the recommended tools installed and setup) not being able to inspect[1] serverino&#x27;s mixin or its attributes. So I look at serverino&#x27;s source code, except its source also has mixins... which I can&#x27;t inspect. I&#x27;m not going to use something when I cannot easily ascertain its control flow. And while, <i>yes</i>, I probably should have gone with vibe-d (<a href="https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;vibe-d%3Ahttp" rel="nofollow">https:&#x2F;&#x2F;code.dlang.org&#x2F;packages&#x2F;vibe-d%3Ahttp</a>) in the first place, mixins and attributes are nonetheless part of the language and the tooling should be able to tell me about them.<p>- [1] When I say &quot;inspect&quot; I mean requesting the IDE to show me the source&#x2F;definition so I can see what it is, what it does, and where it&#x27;s known to be used.
评论 #43801245 未加载
评论 #43805149 未加载
评论 #43807969 未加载
评论 #43801515 未加载
评论 #43805510 未加载