Live data from Hacker News

OpenD, a D language fork that is open to your contributions

dpldocs.info

241–250 of 322 posts

Re: OpenD, a D language fork that is open to your contributions

#241

D is a real anomaly to me because it should have had the same trajectory as Rust, it vastly improved upon other systems languages at conception, the authors evangelized it, including at FAANG, and yet, Rust seems to have gained traction everywhere D failed to do so. Even in places where C++ has historically been shunned, Rust has some traction (Linux Kernel). I now believe that language adoption is just a product of…

I don't find it particularly surprising. D uses a garbage collector while C, C++ and Rust do not. D's GC can be disabled but that isn't that useful when most D code including the standard library until just a few years ago were not written with that in mind.

D is much more closely a competitor of C# than it is C++. D has a few nice features like advanced compile time programming but the actual nuts and bolts that Staff engineering management looks isn't really solid. D's GC is a design straight out of the 80's. Dmd has good compiler throughout but code quality isn't very good. Ldc is much better but compile times are much longer.

Adopting languages at FAANG beyond a single team just yolo deploying them to production requires integrating dozens of engineering systems for everything from post mortem debugging to live profiling to authentication systems. The cost to do this is in the order of tens of millions of dollars.

D just isn't suitable as a C or C++ replacement in the places that actually require it and the cost to enable it in large companies isn't worth it for the incremental improvement it does offer in some areas.

Re: OpenD, a D language fork that is open to your contributions

#242
post #77

Earlier quoted context omitted.

Rust is a frustrating language for me too. I never saw the need for it, really. I just stuck with the language constructs in C++ that makes it basically impossible for memory leaks/use after free/use outside of bounds to occur or if they do occur, explode loudly in debug environments. I haven't used new/delete in a personal project in like a decade; longer than Rust has been around. Now I'm working on a project where…

> I still don't need rust because I don't code like a crazy person. This is not a foolproof argument because safety problems can easily result from unforeseen interactions among parts of the code that all seem to be OK and not "crazy" locally. A significant benefit of something like the borrow checker is that it can suss out these problematic interactions in a comprehensive way, even at the cost of forbidding some co…

I'm new to Rust, but wouldn't it be possible for the "C++ boss" to start writing Rust code like below? Here I think we have a multi-threading race condition that can lead to a crash (?)

  use std::sync::Arc;
  use std::thread;
  use std::time::Duration;
  
  fn main() {
      let shared_data = Arc::new(42); // Create an Arc
      let weak_ref = Arc::downgrade(&shared_data); // Create a Weak reference
  
      let thread_handle = thread::spawn(move || {
          // Simulate some work
          println!("Thread Data: {}", shared_data);
          thread::sleep(Duration::from_millis(10));
          // The Arc is dropped at the end of this thread
      });
  
      // Give the other thread a little time to start up (this is part of the race condition)
      thread::sleep(Duration::from_millis(10));
  
      // Try to upgrade the Weak reference and unwrap directly in the print statement
      println!("Weak Data: {}", weak_ref.upgrade().unwrap());
  
      // Wait for the other thread to finish
      thread_handle.join().unwrap();
  }

Re: OpenD, a D language fork that is open to your contributions

#243
post #179
post #164

Earlier quoted context omitted.

I don't think Walter has ever intentionally talked down to anyone in my time, but his tone can be subtly belittling over some details. I don't think it's intentional but the argument always begins with explaining some detail as if you didn't know it existed even though you'd have to do be able to bring it up in the first place. This is not just me, I've had this discussion with a few people. One of a short list of co…

I haven't seen any of that tbh, I have seen a lot of disrespect come in direction of Walter and him responding in a gracious way actually. Criticism existence means it is allowed and thus is "open".

I would never fault Walters graciousness, rather that I and others just find it difficult to establish a common ground quite often. You can see this very clearly in the discussion of the SQL applications of the string interpolation proposals.

Re: OpenD, a D language fork that is open to your contributions

#244

Earlier quoted context omitted.

What kind of solution would you propose to folks like your boss? One positive aspect I see about "rewrite it in Rust" is that you can to some degree expect a random Rust project to not leak and crash and expose vulnerabilities quite as much as a random C++ project. It's silly, but "written in Rust" acts somewhat as a badge of safety and performance, whereas "written in Java" and "written in C++" each only carry one o…

> What kind of solution would you propose to folks like your boss? Rewrite it in C#. It’s safer than Rust, because VM. Both standard and third party libraries are often way better. With modern versions of the language, GC allocations are avoidable if that’s what needed for performance reasons. C interop is equally simple.

C# is not more safe than Rust is and falls to prevent null pointer exceptions and modified collection exceptions.

Re: OpenD, a D language fork that is open to your contributions

#245
post #242

Earlier quoted context omitted.

> I still don't need rust because I don't code like a crazy person. This is not a foolproof argument because safety problems can easily result from unforeseen interactions among parts of the code that all seem to be OK and not "crazy" locally. A significant benefit of something like the borrow checker is that it can suss out these problematic interactions in a comprehensive way, even at the cost of forbidding some co…

I'm new to Rust, but wouldn't it be possible for the "C++ boss" to start writing Rust code like below? Here I think we have a multi-threading race condition that can lead to a crash (?) use std::sync::Arc; use std::thread; use std::time::Duration; fn main() { let shared_data = Arc::new(42); // Create an Arc let weak_ref = Arc::downgrade(&shared_data); // Create a Weak reference let thread_handle = thread::spawn(move…

Sure, that does seem to be a race condition that can crash. I'm not sure how valuable this example is though, because it's not very intricate at all: a Weak reference can be invalidated (duh!)

The fix is trivial: just use an Arc instead of a Weak. In addition, `upgrade().unwrap()` should be a sizable red flag (like any unwrap, really) since fallibility is kind of the entire thing of Weak.

Re: OpenD, a D language fork that is open to your contributions

#246

I witnessed a similar case while touring D as an outsider. When Rust was new and the concept of lifetime was brought to the D community, it was deemed unnecessary by Walter. A few years later, he brought his own lifetime proposal that is sufficiently different to Rust's and thus even less verified compared to the previous suggestion from the community. Now that I lost my interest in D, I'm not sure of the maturity of…

I'm not too familiar with either Rust's or D's approach to lifetimes, but from some quick forum searching, it appears that adding Rust-like lifetimes to D would have required significant changes to the design of the language. Every potential feature has tradeoffs in terms of how it interacts with other language features, adds cognitive overhead, decreases compilation speed, complicates the design of the standard libr…

D's ownership/borrowing system does not require any language changes. It is opt-in at the function level to preserve compatibility with existing code. It does not break backward compatibility. It works as a prototype now, you can try it out.

It does decrease compilation speed, because O/B requires data flow analysis. However, this is speed slowdown only happens for the functions marked as being O/B functions.

Re: OpenD, a D language fork that is open to your contributions

#247

At least Walter, and presumably others in the D leadership, are active here. There's a good chance they will see your comments. This is just a reminder that they are human, too, they care a lot about D, and in my experience they are basically decent people who are trying their best.

While true, and I agree that everyone is human, Walter isn't the only one here who cares about D. If the project would thrive under different leadership then that's something that needs to be considered. I for one really hope for a D comeback, it's by far my favorite language. It's not an attack against Walter, or anyone else. Just people trying to save something that they love.

Re: OpenD, a D language fork that is open to your contributions

#248
post #73

Earlier quoted context omitted.

I think you're correct for D, but for Rust, we'll see. It's a very slow moving industry. I do C++ work all day (embedded) and while there's no current plans to move to Rust (which means it won't happen within the next 3-5 years), I could see it occurring someday. We're finally (usually) allowed to use C++17. I had to use C++03 at times circa 2019 - we're finally done with that. It's _really_ slow moving.

> I could see it occurring someday "Someday" is on the order of decades here. By that time Rust will be a hoary legacy language with a list of warts longer than an ISO standard.

Nonsense, WG21 is committed to ensuring C++ has more warts and sharp edges than any other language on the planet.

Re: OpenD, a D language fork that is open to your contributions

#249
post #186

Earlier quoted context omitted.

I wouldn't consider a C++ (or C) replacement PLₓ successful until the people working on big compiler toolchains—many of whom are committed alternative programming language advocates themselves (consider the origins of e.g. Swift and LLVM)—decide that, moving forward, those will be written in PLₓ rather than C++. (Note that the bar I'm establishing here is not merely to have a self-hosted compiler (see many toy compil…

While I do hope that future, it is an unreasonably high bar because the main value of LLVM is that you don't have to make everything again to make your own PL implementation. For the same reason contemporary web browsers are unlikely to be fully rewritten in any other language unless they get completely displaced by newer browsers. (At least LLVM has a better chance of being replaced...)

A corollary of this is that a language probably needs to be able to interop with C++ to have any chance of being able to replace C++, so that the LLVMs and web browsers of the world can migrate incrementally. GCC was able to migrate from C to C++ because of this, and a migration from C++ to some other PL would need to work similarly.

Re: OpenD, a D language fork that is open to your contributions

#250

D is a real anomaly to me because it should have had the same trajectory as Rust, it vastly improved upon other systems languages at conception, the authors evangelized it, including at FAANG, and yet, Rust seems to have gained traction everywhere D failed to do so. Even in places where C++ has historically been shunned, Rust has some traction (Linux Kernel). I now believe that language adoption is just a product of…

What year did you come to that conclusion?

D could have been something but most people avoided it because of the commercial nature, i.e. not being Free software.

Post reply on HN