15 ms·
Specification for the D Programming Language
- rsstack 7y ago(2001)?
- giancarlostoro 7y agoIf it's an article that hasn't been updated since 2001 sure. But this has been updated fairly recently, in this year.
- laurentlb 7y agoWhat are the biggest recent changes?
- WalterBright 7y agoPlenty of action going on: https://dlang.org/changelog/2.090.0.html https://dlang.org/changelog/2.090.0.html
- qznc 7y agoDIP1021 is one step toward a larger goal outlined in the blog post 'Ownership and Borrowing in D'. What are the next steps? https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1021.md https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1...
- WalterBright 7y agoA prototype for the O/B system: https://github.com/dlang/dmd/pull/10586 https://github.com/dlang/dmd/pull/10586
- giancarlostoro 7y agoThis is really fascinating, are there some benefits you foresee of this addition to D? I know the O/B system has been popularized by Rust, but have not really thought about it outside of Rust, is this an efforts towards -betterC or will it be used towards those efforts?
- WalterBright 7y agoAn O/B system is a way to: 1. eliminate double frees 2. eliminate use-after-free 3. eliminate memory leaks 4. using undefined pointers when using explicit memory management like malloc/free. Any D application, including DasBetterC, that uses explicit memory management can benefit from it.
- RcouF1uZ4gsC 7y agoThe big issue with D, in terms of no-overhead is that is has garbage collection by default, and if I understand correctly, the garbage collector is not as advanced as Java's or Go's. While you can use D without the garbage collector, you will lose access to a lot of the standard library, which limits the practicality of running without garbage collection.
- apta 7y ago> is not as advanced as Java's or Go's. golang's GC isn't advanced either.
- Thaxll 7y agoI'm not sure what qualified for an advanced GC but Go is the leading GC with Java and C# so ... https://blog.golang.org/ismmkeynote https://blog.golang.org/ismmkeynote
- The_rationalist 7y agoI don't know if it's a consequence of their GC, but go is significantly slower than Java or C#.
- Thaxll 7y agoYou're mistaken, Go is on part with both languages, usually faster.
- dralley 7y agoMy understanding is that it has lower latency but also lower throughput. Although most of the benchmarks I've seen are at lease 2 years old. It would be nice to see some updated benchmarks that also compare against the Shenandoah and ZGC garbage collectors for the JVM.
- 7y ago
- Google234 7y agoIt's cool to see D on hacker news but isn't more interesting content related to D that could have been linked instead? The table of contents to the spec is pretty bland.
- deleted 7y ago[deleted]
- ossworkerrights 7y agoD is by far my favourite niche language, due to its clean syntax and ease of use. I am surprised it’s not gaining traction.
- ncmncm 7y agoD is not different enough from C++. It's like C# to Java, which has traction only through relentless flogging by Microsoft. There's nobody to flog D.
- DrBazza 7y agoD today is C++2040.
- mlyle 7y agoNah, because C++40 will just accumulate more and more unpredictable cruft while D is clean.
- qznc 7y agoD is not clean. It already has some cruft. For example, there should be no "@safe" annotation but an "@unsafe" one. Unfortunately, D picked the wrong default back then. Ok, "in relation to C++" it is clean. :) Edit: There is a proposal to fix it: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1028.md https://github.com/dlang/DIPs/blob/master/DIPs/DIP1028.md
- teleforce 7y agoPardon the pun, but @safe is a safe choice. IMHO, for general language it is more productive by having low hanging fruits as the default. The popularity follows consumer->enterprise->military->aerospace, and safety gets more critical up the systems food chain. That's propably the main reason Ada is not a common or popular programming language since it is for higher end of the food chain.
- sam0x17 7y agoI wish I had known about D 10 years ago. It's everything I ever wanted out of an LLVM language, but I feel like it's dying and the package ecosystem is tiny, which is crazy with how old it is. What they need is some new web design and docs and exciting stuff to make it feel like a new language so people recognize how truly awesome it is :/
- vmchale 7y agoPlus affine types have gone mainstream. Good stuff, but I'd like memory safety!
- WalterBright 7y agoAn ownership/borrowing system memory safety is in the works for D. There's a prototype of it as a Pull Request: https://github.com/dlang/dmd/pull/10586 https://github.com/dlang/dmd/pull/10586
- sesuximo 7y agothat is really exciting!
- WalterBright 7y agoIndubitably!
- vmchale 7y agoThanks!
- theredbox 7y agoWhat is the type of apps that one should use D for ? I think this is one of the main issues with languages that did not gain traction and that is they are too generic and try to be too many things to too many people. If i exclude the financial backing i think languages that tried to tackle one specific thing did rather well. Rust came to be to address the issue with security and there is not really an alternative. Yes people use it for cli tools or backend services but that’s just because they are riding the hype train. The same with Go. On the other hand we have things like Dart which did not really try to solve an issue people felt they have. The same with Crystal. Nobody really needed faster Ruby that much and if they did they already needed a production ready solution which was just too hard to deliver. A language like Nim reminds me of D. Its author is also a brilliant Phd CS person but I feel like he does not really have a problem to solve. It’s all just an intellectual challenge. Companies like Status.im ( backer of Nim ) have a problem that they are trying to solve by using Nim. Making the right and the perfect solutions is hard but this evolutionary approach is really harming the expansion of the ecosystem. Nim has just too many features and too many approaches to memory management (recent gc:arc release). But it is all too half baked and does not support the features Nim advertises that it has. This is basically the same issue i have with D. I have no idea what I would use D for. And could i rely on D in the domain i pick it for ? Eg the same field where Go excels.
- deleted 7y ago[deleted]
- edflsafoiewq 7y agoDoes D have something like Rust's #[derive(Debug)] or #[derive(Hash)]?
- Neku42 7y agoStandard library doesn’t provide similar functionality but it’s trivial to implement a mixin template that would implement print or hash function for any type That being said standard formatting function can automatically print most types including user types. This eliminates necessity for automatic formatting implementation in majority of situations
- mhh__ 7y agoNot really required because serialization is trivial in D. D's compilation isn't "stateful" like that in the sense that (user-defined) attributes both cannot influence the thing they are attached to or do anything without being read by something else.
- lokar 7y agoThere's no weekend warriors on the D. You're either on it... or you haven't tried it.
- tastyminerals 7y agoI started reading about D couple of months ago after work. For me, it appeared to be easier than Scala for example which I use at work. Not only is it simpler, it is faster and I am not even talking about compile times. These features alone persuaded me to rewrite couple of Scala based data processing algorithms we use for our ML models to give it a try. What I really liked is that you don't have to know all about the language to write perfomant code. Still keep wondering how does it get constantly overlooked.
- Neku42 7y agoThis seems to be an increasingly growing niche where D is gaining popularity. I see more and more people turning to D where they would normally use python or R for adhoc data crunching
- bachmeier 7y agoIt doesn't even need to be an alternative to Python or R, since it's really easy to interoperate with both languages. This is in addition to tools like eBay's tsv-utils. http://code.dlang.org/packages/pyd http://code.dlang.org/packages/pyd https://embedr.netlify.com/ https://embedr.netlify.com/ http://code.dlang.org/packages/autowrap http://code.dlang.org/packages/autowrap https://github.com/eBay/tsv-utils https://github.com/eBay/tsv-utils
- mhh__ 7y agoI try to use D for that (difficult because the libraries are fairly low level, I would say sparse but calling into C and C++ is pretty trivial) because, for the same effort I put into bullying python to do what I want, I can write type safe (generic) code that is both actually readable and ready to be reused if needs be. And sometimes orders of magnitude faster. That and ranges (D/Andrei's preferred model for iteration) are excellent - in my view at least.
- z3c0 7y agoAs one of those people, I can say the reason is for the C-level processing power with the approachable syntactic sugar. Out of all the languages gaining popularity for their ability to run natively (Rust, Go, D, etc), I've felt that D is the most natural continuation of C/C++, at least syntactically. I haven't touched the language in about a year, but I'm personally rooting for it.
- joecool1029 7y agoMy only experience with D is getting the free onedrive client to run on linux[1]. What's more frustrating than the small ecosystem is the fact that the reference compiler, DMD, is limited to x86/x86_64 and you need a working D compiler to compile the primary alternative, LDC2 which can't bootstrap itself. In order to get something like that to compile for aarch64, you have to build a recent GCC with the very old dmd frontend enabled, and then you can compile LDC2. This all to use one app! [1] https://github.com/abraunegg/onedrive/ https://github.com/abraunegg/onedrive/
- ben-schaaf 7y agoWhy would you have to bootstrap the compiler to simply install an app?
- joecool1029 7y agoBecause nobody had a binary of the app for my architecture?
- svnpenn 7y agoHas anyone had luck building a D program with static cURL? The D distributions ive seen only supply a DLL, and I have messed with some compiler flags but it always wants to search for a DLL.
- ryuukk_ 7y agoD is nice, but again, its tooling is NON-EXISTANT where do you write your code? VIM? ok go fuck yourself
- crazypython 7y agoYou can help D's ecosystem by contributing a CTFE that frees memory as it executes, and by implementing struct postblits.
- mhh__ 7y ago> and by implementing struct postblits Eh?
- rambojazz 7y agoIs there a reason for posting this link? Like the specs has just been published or something? I wish people gave some context of why they post links without context and why I should be interested in the link.