14 ms·
The D Programming Language
- sebmellen 3y agoDoes D have real adoption? Their success stories page lists a few bigger companies that use it for some smaller projects, but nothing about use in big production systems. Is anyone on HN primarily a DLang coder?
- yawaramin 3y agoAhrefs seems to be using it to some extent too: https://ahrefs.com/jobs/backend-engineer---sre https://ahrefs.com/jobs/backend-engineer---sre > Our backend is mostly implemented in OCaml with some D and C++.
- WalterBright 3y agoI am. Sometimes I write some test cases for D's builtin C compiler, but it's been all D for a while. The compiler itself used to be written in "C with Classes", but it's all D now. We have a wonderful conference every year in London. The last one was particularly nice - lots of people, everyone had a good time (especially myself).
- mlyle 3y agoIn fairness, you kinda don't count ;)
- WalterBright 3y agoCounting is for beginners. I'm into integrating.
- 082349872349872 3y agoA key to tackling big projects is deciding which potentially desirable features have, in fact, measure zero?
- mlyle 3y agoI would like to be. It's very nice and clean.
- FeepingCreature 3y agoI am. Funkwerk, where I work, uses near-exclusively D in the backend.
- Alifatisk 3y agoHow did the company end up exclusively use D un the backend?
- FeepingCreature 3y agoI wasn't here for it, but my understanding is that our previous boss really liked D. (Once you have an internal D ecosystem, you start selecting for D developers, who then prefer to keep using D, and so it persists.)
- Alifatisk 3y agoThat’s so interesting, I really believe D deserves more highlight because it’s so easily adopted and interops so well with C, yet it’s very high level enough to be scriptable.
- imrying 3y agoYes! I write D full time at my company/organisation Tagion.org.
- tastyminerals2 3y agoIt is or was used by some companies in Munich (funkwerk) and a few others. Companies like ebay and netflix have some projects in D. The users are mostly C++ veterans so the forums are full of experienced ppl who can help. I used it heavily in my work for local scripting tasks and even write a small GUI app for our API. Used it mainly instead of Python. It’s basically a safe C with a rich stdlib. There is almost zero syntax overhead and hence if you know C, you should be fluent with D in short time. It is a pragmatic language with some nice functional syntax sugar that makes Scala cry. But the language and the ecosystem struggles with the lack of ppl and overall direction. Contributors tend to complain about long times and endless PR discussions. Some D contribs moved eventually to Rust or Go, which is sad but here we are. I think D deserves more attention than it got and continues to get.
- Simon_ORourke 3y agoThe D language has almost become a German preserve, what with the only major adopters being from there. Deutsche Bahn are supposedly using it too for their platform signage.
- jeroenvlek 3y agoThat could also explain the abraunegg-onedrive (a brown egg in German) package for Arch Linux, which is the source of DLang deps on my system :D
- Lutger 3y agoNo doubt Sociomantic Labs, which was acquired in 2014, was a major driving force there. The company was very succesful and hired a lot of the best developers interested in D at that time.
- mhh__ 3y agoSymmetry Investments uses a lot of D (and pays for dconf), from London.
- p0nce 3y agoI write D fulltime for my small company, published a framework that 4 other small companies use (or have used). D is really nice for the small ISV, but is also prepared to handle massive codebases (deprecated, packages, gradual typechecks, clear deprecation policies).
- holub008 3y agoFrom a different direction, it was taught in one section of my university's data structures course. We were guinea pigs (https://forum.dlang.org/post/km96ho$2grm$1@digitalmars.com https://forum.dlang.org/post/km96ho$2grm$1@digitalmars.com), but I recall the experience being fun and students largely enjoying D. Transitioning to C++/Java in later coursework and professionally was a breeze.
- MikeShah 3y agoA few other folks (including myself) are or otherwise continue to teach D. https://youtu.be/V2YwTIIMEeU?si=To2DBlzz30XAUptN https://youtu.be/V2YwTIIMEeU?si=To2DBlzz30XAUptN https://dlang.org/blog/2022/02/19/how-i-taught-the-d-programming-language-at-a-russian-university/ https://dlang.org/blog/2022/02/19/how-i-taught-the-d-program...
- JonChesterfield 3y agoSymmetry is a serious trading firm that show up to DConf and similar. Some of their engineers are very enthusiastic about the language and a little bemused that so many people use C++ instead.
- Lutger 3y agoI remember that D was instrumental for building the core product of weka.io, a fast distributed filesystem. Not one of the tech giants, but not a small company either: https://www.weka.io/ https://www.weka.io/
- crabbone 3y agoI worked for a storage company whose product was written in D. They were later acquired by a larger international company, and I don't know what the fate of the original project was after the transition. In this world, D was, while not a common choice, also not an unexpected one. The most common language for these sorts of products is C... but it's not the kind of C you'd find in books about the language. It's C that's heavily modded to remove or replace a bunch of stuff. D just happened to align well with what people running the project would've done to C anyways. Also, in this context the existence of libraries doesn't matter, as almost everything is going to be written from scratch anyways. Nor does learning the language matter, since the internal infrastructure and learning how C was modified to fit the project goals would take the same time as learning another language. To be honest, I really liked to work in that environment. Not because of any of D's features. I just hate being in the constant fear that I will not be allowed to do something that makes perfect sense, and instead coerced into idiotic workarounds that pretend to solve the problem. Which is what happens when you are required to use third-party libraries and they absolutely don't anticipate your use-case. It's the place where I was closest to being proud of what I was doing. Unlike most day jobs I had, where I felt like I need some extra time in the shower just to not feel dirty by writing code I knew full well should've never been written.
- yawaramin 3y agoIs the D language tour down? The page is not loading for me: https://tour.dlang.org/ https://tour.dlang.org/
- FeepingCreature 3y agoYeah, seems down.
- Alifatisk 3y agoI am really curious to how much load the server have to handle in order to survive HNs hug of death
- FeepingCreature 3y agoI mean, that site is just down occasionally. A bunch of auxiliary infrastructure is hosted by volunteers that aren't necessarily available 24/7. It's an issue.
- Alifatisk 3y agoCan I contribute with hosting somehow?
- vindarel 3y agoFYI here are the instructions: https://github.com/dlang-tour/english https://github.com/dlang-tour/english (and forum: https://forum.dlang.org/post/hjvmxbocubjkojnyklxq@forum.dlang.org https://forum.dlang.org/post/hjvmxbocubjkojnyklxq@forum.dlan...)
- jug 3y agoVolunteers?? Why host it like that? :( For the traffic D gets these days, it seems like hosting ti as static content on Netlify or somewhere would be viable for a low cost.
- 3y ago
- lf-non 3y agoThe nim language appears to have better gc and metaprogramming support while also offering most of the other advantages that D touts. If someone more experienced in D could offer any insights around why someone should prefer D over nim for a new application outside low level applications where gc is absolutely undesirable, I'd really appreciate that. I am not an expert in either.
- WalterBright 3y agoYou can program in D without ever needing the GC.
- rice7th 3y agoSame in Nim IIRC Thats said, I am a huge fan of D and your work in general. Please keep creating awesome stuff!
- WalterBright 3y agoRoger wilco!
- brabel 3y agoI just went through the Nim website and didn't see anything about no GC - except literally turning it off which means it won't free anything, ever. See https://nim-lang.org/1.4.0/gc.html https://nim-lang.org/1.4.0/gc.html Do you have a page that shows otherwise??
- Tiberium 3y agoThat page is quite a bit outdated - Nim version 1.4.0 was released in October 2020. The newest Nim 2.0 release has the default GC set to ORC, which is ARC + a cycle collector, see https://nim-lang.org/docs/mm.html https://nim-lang.org/docs/mm.html. As for ARC/ORC specifically, you can read a small introduction in https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc..., but as a TLDR: ARC is something closer to RAII than a GC (destructors injected automatically at the end of scopes) with reference counting for reference types. You can switch between ARC/ORC when compiling, and destructors give a lot of control - https://nim-lang.org/docs/destructors.html https://nim-lang.org/docs/destructors.html.
- mfaathirarsa 3y agoAt first my university use python for the basic programming course but halfway we integrated to dlang and we were really confused on what dlang actually is. The lack of tutorial and coming from the python language is really a challenge to learn D. We haven't gotten any big projects mostly just solving stuff in codeabbey (mainly because it's one of the only website that support D but we are maybe moving into codeforces because they recently added dlang support), all in all i'm still really confused like there's nowhere i can go sometime to ask about this but i've been trying to get back at c and it definitely helps well wish me luck for my university course, i've been reading a lot of programming language before coming to college and i thought i had everything prepared but turns out life can really throw a curveball at you P.S if you have any guide on how i can approach this let me know :)
- foretop_yardarm 3y agoI used this website to learn D: http://ddili.org/ders/d.en/ http://ddili.org/ders/d.en/
- Alifatisk 3y agoBookmarked
- mfaathirarsa 3y agoYeah I've been using this too with Mike Shah videos
- sashageyo 3y ago[flagged]
- WalterBright 3y agoCome to the forums at https://forum.dlang.org/ https://forum.dlang.org/ and we can help!
- mfaathirarsa 3y agoWill do, I've never been on the forums before but I might start looking into it
- berkeleynerd 3y agoWhich IDE best supports D? I’m a fan of JetBrains products in general but would happily install something else for better ergonomics.
- tastyminerals2 3y agoVSCode with a code-d plugin.
- Alifatisk 3y agoI remember that extension eating 3 GB of ram on my macbook because I had format-on-save on.
- tastyminerals2 3y agoThis plugin has been worked on and the issue could have been fixed by now. I rarely used VSCode for D because the language doesn're really need an IDE support like Java or Scala. But I do agree that for beginners and IDE support is important. I use vim with DCD: https://github.com/dlang-community/DCD https://github.com/dlang-community/DCD
- Alifatisk 3y agoJust checked, the issue does not persist anymore.
- jussij 3y agoThere D wiki has this list: https://wiki.dlang.org/IDEs https://wiki.dlang.org/IDEs
- p0nce 3y agoVisualD if you're accustomed to Visual Studio classic it's pretty much the same.
- WhereIsTheTruth 3y agoD has a language server (LSP) you can use any IDE/editor that supports it - Sublime Text - vscode - vim/nvim - emacs etc.. https://github.com/Pure-D/serve-d/ https://github.com/Pure-D/serve-d/
- berkeleynerd 3y agoIs there an effort to provide formal verification features for a safe subset of the D language similar to ADA’s SPARK and related tooling?
- DoingIsLearning 3y agoThere is a D subset: https://dlang.org/articles/safed.html https://dlang.org/articles/safed.html But nothing like Ada SPARK provability stuff, I don't think.
- musha68k 3y agoIIRC Kenta Cho had quite a few of his games written in D. https://www.asahi-net.or.jp/~cs8k-cyu/ https://www.asahi-net.or.jp/~cs8k-cyu/
- ClimaxGravely 3y agoKenta cho is a absolute gem
- speeder 3y agoIt was because I played Torus Trooper and the source files came with the game, that I found out that D existed. Sadly never had the opportunity to try to use it.
- fithisux 3y agoI wish at some point universities replace C with D.
- Alifatisk 3y agoI’ll ask my professor if he would mind
- nairboon 3y agoThere have been a bunch of posts about teaching it, might be interesting: https://dlang.org/blog/2021/12/23/teaching-d-from-scratch-is-it-a-viable-first-language/ https://dlang.org/blog/2021/12/23/teaching-d-from-scratch-is... https://dlang.org/blog/2022/02/19/how-i-taught-the-d-programming-language-at-a-russian-university/ https://dlang.org/blog/2022/02/19/how-i-taught-the-d-program... https://dconf.org/2023/slides/shah_and_students.pdf https://dconf.org/2023/slides/shah_and_students.pdf
- earlygray 3y agoI looked into it a few years ago and used it for a couple of hobby projects. I really liked it but I was never going to be able to persuade my company to use it unless it became more popular. Rust is trying to solve the same problem of being both safe and as performant as C/C++. Although it came along later than D it seems to have been much more successful in gaining traction, most likely because it had the backing of Mozilla.
- qznc 3y agoD has a bigger scope than Rust. It is Rust‘s scope plus use cases where a garbage collector is appreciated and it provides more meta programming mechanisms. It might be the most comprehensive programming language ever.
- mratsim 3y agoWhat are the key metaprogramming features you miss when not using D? How do they compare to Nim's?
- chromatin 3y agoAlthough I haven't used Nim, something I miss while using rust is `static if`. You can sort of approximate / do a subset of this with #[cfg(xxx)] directives in Rust.
- cb321 3y agoFWIW, the Nim analogue of `static if` would be `when` statements. EDIT: or any of mratsim sibling's fine choices. Nim is Choice and has many uncommon compile-time powers.
- mratsim 3y ago`when myCondition():` instead of `if myCondition:` is done at compile-time. Alternatively you can use a `static:` code block to force compile time evaluation. Or tag a function {.compileTime.} or tag function inputs with `static` modifier. It is possible to create a compiler or an assembler running fully in Nim macros as well: - https://github.com/mratsim/constantine/blob/master/constantine/platforms/isa/macro_assembler_x86_intel.nim https://github.com/mratsim/constantine/blob/master/constanti... (all that file runs at compile-time) You can also implement Continuation-Passing-Style transformation at compile-time: - https://github.com/nim-works/cps https://github.com/nim-works/cps Or a neural network DSL or for a self-contained example, einsum: - https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/einsum.nim https://github.com/mratsim/Arraymancer/blob/master/src/array... It's worth noting that nim async/await transformation is fully implemented as a library in macros.
- fotad 3y agoD community spent most time argue something not important and miss 2 big opportunities. 1. Cloud - D is perfect for serverless if D improve its GC and standard library, language like go probably won't even exists in first place. 2. Mobile - in early day, mobile is slow and has low memory, If D has good tools and GUI framework, it will take off. Even today, it's difficult to crate app for mobile using D. LLVM probably the last straw that D out of favor, before LLVM, crate product ready language is difficult, now, everyone is creating their own language...
- pjmlp 3y agoA couple of remarks. For all the praise LLVM gets, already in the mid-70's compiler based frameworks were a thing, IBM PL.8 RISC project, and early 1980's Amsterdam Compiler Toolkit are two notable examples of similar stacks. Go would still exist, because Google would never picked D for their cloud projects, and its adoption grew from Go creators working at Google. See how sucessfull Oberon and Limbo projects from the same authors were, before their Google days. While C++, Java and .NET now have most of the features that D was known for when Andrei Alexandrescu published his Programming in D book, I still think the execution in D is better packaged, although yeah, wihtout the related ecosystem and IDE tooling, it is an hard sell. Maybe "slow and steady" still will surprise us, like it took Rails to make Ruby known outside Japan, or maybe it is too late no matter what. Future will tell.
- JonChesterfield 3y agoA compiler translates from language A to language B, hopefully improving it along the way. If you let A = B, you get the compiler pipeline model. It's popular because it's effective and obvious. LLVM has the core IR structure as an in memory structure and as a text format and as a binary format. The easy, lossless (modulo partial implementation of new features) conversion between the formats was a really big deal. I'd be interested to hear of prior art on it. In particular, it means developers can diff the IR between passes and generally apply textbased tooling to it during debugging, and you can do things like link time optimisation really easily by combining separate files then running them through the optimiser. LLVM is creaking a little under its age, and I don't think it's ideal that it's written in C++, but the flexible architecture is legitimately better than I've seen in other compilers. In particular, it has been a competitive edge over GCC.
- pjmlp 3y agoEven if D still hasn't achieved its full potential of wide adoption, it is great to see it going along, "keep it slow and steady".
- WalterBright 3y agoD users tend to be very loyal.
- N0xxi0us 3y agoI'm curious to know what people think of D versus Zig, two rather new languages that seem to have the same target audiences and purposes.
- xyproto 3y agoZig provides a smooth transition from C and has a built-in C compiler and also is excellent at cross compilation. D is much older and is more like a C++ alternative. Zig is more like a C alternative.
- WhereIsTheTruth 3y agoThis is what C++ should have been, C with modules and proper compile time type introspection, D is a great language, one thing I wish it had: native tuples and pattern matching, but I heard it's planned, so that's great
- poulpy123 3y agoAll these languages (D, nim, crystal and many others) look nice but unfortunately the lack of adoption means few ressources and a small community which in turns means lack of adoption in a vicious circle. I now think the most important skill a language creator can have is to be able to create hype (as long as the language itself is good enough of course).
- qwery 3y agoI've been interested in D since about 2010 and I'm pretty sure it's about ten years older than that. So if there's a vicious circle, I'm not sure what the effect of that is.
- FireInsight 3y agoUniversal Function Call Syntax, the syntax feature where you can call a function in a procedular language you can call function in a multitude of ways. For example (pseudocode): ``` func toUpperCase(s: string) <IMPLEMENTATION> a = "hello world" echo toUpperCase(a) # HELLO WORLD echo a.toUpperCase # HELLO WORLD echo toUpperCase a # HELLO WORLD echo a.toUpperCase # HELLO WORLD ``` With the dot syntax, the first argument is the one indicated by the dot, and the rest of the arguments are in the parentheses. In nim, you can leave out the parentheses too, which makes `echo` statements cleaner. It's a shame more mainstream languages don't have this feature.
- rjha 3y agoformatting the above function for better readability ``` func toUpperCase(s: string) <IMPLEMENTATION> a = "hello world" echo toUpperCase(a) # HELLO WORLD echo a.toUpperCase # HELLO WORLD echo toUpperCase a # HELLO WORLD echo a.toUpperCase # HELLO WORLD ```
- usrusr 3y agoWhy would you ever want the dotless version though, in cases where it's not terrible? (e.g when there are multiple arguments of equal importance and calls where the argument is appears more as an option for esoteric cases than the implementation's main subject) I really like the option to "semantically scope" a function to its main subject, like in kotlin extension methods. But I fail to see why I'd ever want to have both options. Is it just a compatibility thing, to be able to call code written for conventional languages? Or from developers who don't like that approach?
- RadixDLT 3y agoD needs to focus more on rebranding and reinforcing why it's deferent than the predecessor Instead of calling it D, they should use a word to invoke some emotion, rebranding to "Destiny" would be a good start
- sigilis 3y agoDevelopers probably don’t make choices based on the emotional valence of the name of a programming language. Although, perhaps my decision to learn C# was a reaction to my desire to no longer be myopic…
- kaoD 3y agoNot consciously, but there are many reasons why D as a name detracts from adoption. The most important is search-ability (e.g. compare results when searching "c# gc" and "d gc"), but there are also subconscious impressions that you get from a name, whether you realize or not. For example, having an indistinct name makes your language feel indistinct. I understand your C# comment was meant tongue-in-cheek but I think it shows how you're analyzing this rationally while marketing is dealing with irrational decisions that happen instantly at a subconscious and emotional level. Marketing is important.
- furyofantares 3y ago> e.g. compare results when searching "c# gc" and "d gc" D and Go share this problem, but they also share the solution. You wanna search for "dlang gc". C# was impossible to search for when it came out btw, and for a while after. That one was solved by search engines eventually rather than by the community.
- mhh__ 3y agoThe world is path dependant. You'd be surprised.
- Alifatisk 3y agoGuess how I found out about D lang? I was lookg through the history of C on Wikipedia, then I somehow stumbled upon a table with all programming languages in the wiki. Under the C language, I saw D lang. I first thought it was an old outdated language like B. But when I looked up D lang, I saw they had a website up and running, I visited it and got quite shocked, the website was modern and had an impressive description.
- nindalf 3y agoD is a niche language that didn't quite manage becoming mainstream. I came across an excellent article Why your F# evangelism isn't working (https://ericsink.com/entries/fsharp_chasm.html https://ericsink.com/entries/fsharp_chasm.html) that explains why this didn't happen for F#, but the insights generalise to other languages. Here's my summary: - Adoption of any technology is by a normal distribution. - The segments are early adopters, pragmatists, late adopters and laggards. - If you want a technology to become mainstream, you need to make the pragmatists adopt it. - This is rational behaviour and there's no use trying to convince the pragmatists otherwise. They will choose "predictably disappointing" over "excellent and unproven" every time. - Technology is merely a tool to them. They don't care if it's fun or not, as long as it gets the job done. - Mainstream success is impossible without getting the pragmatists on board. Until then you have a curiosity used only be early adopters. - How to cross the chasm? He recommends finding a pragmatist in pain and solving their problems. Gradually convert pragmatists one by one. I don't think D was ever able to articulate to the pragmatists why they should adopt D over C++ or other languages. Fixing a few warts with C++ wasn't enough. Meanwhile Rust managed to appeal to the pragmatists by saying "we know you use C and C++ because of the performance despite the issues with it. Why don't you try a language with the same performance, which also fixes some of the issues (buffer overflows above all) at compile time". Rust was far from perfect when it started seeing adoption by pragmatists, and it remains far from perfect today. But perfection isn't the goal, nor is a "fun" language for early adopters. What matters is solving a problem that pragmatists face and then convincing them to give you a shot. In practice this is a bar that is high enough that most languages never cross it.
- ksec 3y ago>Meanwhile Rust managed to appeal to the pragmatists I don't see that at all. I see it appeal to idealist. At the end of the day I think it is more of an economic model rather than that distribution problem. You need a company to be the language power house.
- tastyminerals2 3y agoor you could simply be supported by a billion revenue company that pays your bill if you code "their custom version of C". No need to do social analytics. D could totally be that language but it was never driven by big enough companies and had a specific early years history which obscured it pretty well from pragmatists crowd.
- RadixDLT 3y agoI would recommend creating learning courses on linkedin, udemy, etc.. that's where people go to learn new stuff, if you are not present on those planforms Might As Well be a Dead language
- hashmash 3y agoMy understanding is that garbage collection in D is performed by a "stop the world" non-generational collector. Although GC is optional in D, without a more competitive implementation, the safest thing is to never depend on it. What advantage does D then have over languages like Rust and Zig?
- keep_reading 3y agoC/C++ interop and easy static linking makes it super nice for writing small utilities IMO
- Alifatisk 3y agoAre there GC's that doesn't halt the execution actively in use?
- WalterBright 3y ago
- cryptos 3y agoThis is really enough to make it on the front-page of Hacker News? Posting a link to a programming language that is around for 16 years and not exactly an insider tip.
- Alifatisk 3y agoYeah, what made it blow up this time?
- amai 3y agoD is to C++ what Kotlin is to Java.
- WalterBright 3y agoOne of the finest overlooked features of D is the D community. It's composed of wicked smart people, nice & friendly and always willing to pitch in and help out. I must say I never expected that when I started out with D. Attending our annual D conference in London is one of my great pleasures - a solid week of interacting with my friends and colleagues from all over the world.
- unsungNovelty 3y agoFor any D Lang linux nerds out there looking for a D Lang challenge, Tilix terminal is looking for a maintainer - https://gnunn1.github.io/tilix-web/ https://gnunn1.github.io/tilix-web/. Looking for a new maintainer post - https://github.com/gnunn1/tilix/issues/1700 https://github.com/gnunn1/tilix/issues/1700 Tilix is a great terminal which somehow balances ease of use whilst catering to power users as well. IMO that is. Note: Not affliated to the project. Just love using Tilix.
- binary132 3y agoI would probably have gone all-in on D if Calypso hadn’t been apparently abandoned. Complete C++ interoperability is basically an unsolved and fairly important problem.