11 ms·
D is pretty exciting. Seems like a perfect choice for those of us looking for an alternative systems programming language and are not completely convinced we'll
by sgt 7y ago
D is pretty exciting. Seems like a perfect choice for those of us looking for an alternative systems programming language and are not completely convinced we'll be happy in Rust.
- rakoo 7y agoI'm not looking for an alternative to C but I used this quarantine to start nim, and it feels quite right until now
- dom96 7y agoNim actually happens to be a very good better C. The fact that it compiles to C is a key feature of that.
- pron 7y agoMine is Zig.
- dgellow 7y agoZig is still very experimental though, the language isn’t stable yet
- AnIdiotOnTheNet 7y agoDefinitely. However I will say that Zig does so many things right already that I struggle to code in more mature languages without thinking "I wish I was writing Zig right now" all the time.
- pron 7y agoTrue, but I'm not in a hurry. We've waited a long time for a C/C++ alternative, we can wait a bit more. Some find it in D, some find it in Rust, some (like me) are waiting for Zig, and some for something else.
- logicchains 7y agoAre you aware of anyone with large projects in Zig? I'm curious how fast it compiles, given in my view faster compilation is one of the biggest advantages of D over C++ and Rust, due to it having a lightweight compiler, DMD. Zig seems to still use LLVM, like Rust, which is relatively slow.
- drfuchs 7y agoIn his live-stream three days ago, Andrew Kelley showed the beginnings of Zig directly generating debug-mode executables, very quickly. And that’s before incremental compilation and linking. This guy is amazing. https://www.twitch.tv/videos/602715503 https://www.twitch.tv/videos/602715503 [edit: at 10:20]
- logicchains 7y agoAh, that's awesome! Really cool to see a new language taking compile-time so seriously.
- setpatchaddress 7y agoFast compile time isn't actually that hard for a C-like language. Good code optimization and fast compile time is hard.
- alexhutcheson 7y agoFast compile time on large projects is really hard for C and C-compatible languages due to the preprocessor and #include. Not an issue if you're comparing compilation for a single file, but it turns into a substantial fraction if your compile time when that file transitively #includes 10s or 100s of headers.
- smallstepforman 7y agoAndrew needs to radically change his stance on Tabs for the language to be taken seriously. White space must be ignored, and Andrew should overlook his personal bias and cater to the ‘preserve white space’ crowd. Because formatting and readability matter - a lot.
- schaefer 7y agoYou refer to "Andrew's stance on tabs" without being specific or providing a reference, so I wend digging for more details in the language FAQ. From the reference I found[1], Andrew's stance is: The current zig tooling forces spaces instead of tabs because the tooling for the language is not yet complete. The self hosted compiler (which the community will start using just as soon as it's ready) already does accept both tabs and spaces. So, I'm not able to understand your complaint at all. Perhaps you could you elaborate, provide a reference, or soften your stance? [1]: https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-me-to-use-spaces-instead-of-tabs https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-m...
- saagarjha 7y agoI am very curious why the stage1 compiler cannot just run zig fmt prior to parsing the code as a stopgap until the self-hosted compiler is complete…
- skohan 7y agoYeah I think "better C" is a space which has a really good reason to exist and I'm always interested to see new entrants. IMO describing Rust as a "C replacement" is slightly off the mark because Rust's value proposition is very different from C. Rust is about giving you the best possible performance in a safe-by-default language. C is about giving you maximal control over memory, with a very thin layer of abstraction over the hardware. C has traditionally been used in a lot of places where Rust's USPs add a lot of value -- for instance in kernel development -- simply because there wasn't a safe alternative. However I think there are other cases where the strengths of C still add value; for instance in game development you're largely trying to do high-throughput processing over large swaths of structured data, and Rust concepts which help safety like RAII just get in your way. Yes there are ways to get around this in Rust, but Rust is not really optimized for structured, manual memory management. As a result I think there is plenty of room for something like C which just has better ergonomics and some more modern features.
- WalterBright 7y agoD also now supports Ownership/Borrowing (experimental) on a per-function basis, meaning it can be added incrementally to an existing program.
- dgellow 7y agoFor reference, the blog article on borrowing/ownership from 2019: https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in...
- exiled13 7y agoD's borrow checker fails in comparison to Rust's. It serves very little purpose and provides almost no guarantees. These issues have been brought up multiple times but they are brushed aside with ignorant responses like "I've been told my entire career what I'm doing will fail but I continue to do it anyways".
- WalterBright 7y ago
- pjmlp 7y agoD is a much better option for those that believe that it isn't a crime to have a GC on a systems programming language. It basically follows on the school of thought at Xerox PARC, ETHZ, and Microsoft Research. Now what it lacks is more more manpower to improve its runtime capabilities and having a big name actually pushing it forward. However this doesn't need to be a zero sum game, any language that helps to fix C is welcomed to the party, including attempts like Checked C and Frama-C.
- schveiguy 7y agothe betterC form of D does not use the GC (and the compiler will let you know).
- pjmlp 7y agoI used to be a regular on D forums. :) Yes, betterC does not use the GC, but I was speaking about the whole language, and many anti-GC folks eventually discover that they can stick to regular D and still deliver what they were trying to do. You can imagine an OS written in D, where BetterC mode gets used in the layers that for whatever reason cannot afford a GC, while all the remaning layers can happily take advantage of it.
- schveiguy 7y agoAgreed. I've never felt the need to use betterC. The biggest use case I think is writing modules/libraries for other languages to use.