October 21, 2022

On Friday, 21 October 2022 at 12:41:07 UTC, Paulo Pinto wrote:

>

None of them have the industry backing at the same scale.

There are two key use situations that Carbon is meant to address, according to the authors:

  1. C++ interop
  2. when Rust doesn't perform as well as you like

I don't think Rust will take over low level programming. Rust is more of a high level language with some lower level capabilities. That is sufficient for many applications, of course, but it does not have the key characteristics that allows you to maximize the utilization of hardware.

October 21, 2022

On Friday, 21 October 2022 at 12:50:27 UTC, Ola Fosheim Grøstad wrote:

>

On Friday, 21 October 2022 at 12:41:07 UTC, Paulo Pinto wrote:

>

None of them have the industry backing at the same scale.

There are two key use situations that Carbon is meant to address, according to the authors:

  1. C++ interop
  2. when Rust doesn't perform as well as you like

I don't think Rust will take over low level programming. Rust is more of a high level language with some lower level capabilities. That is sufficient for many applications, of course, but it does not have the key characteristics that allows you to maximize the utilization of hardware.

If you bothered to follow the links I posted above, you will see how the likes of ARM,Google Expressif, and Microsoft are of a different opinion, even though they seat at ISO C++.

And the car industry standard for high integrity systems is now certifying Rust for the same purpose alongside C++17.

But what do they know.

October 21, 2022

On Friday, 21 October 2022 at 13:06:13 UTC, Paulo Pinto wrote:

>

And the car industry standard for high integrity systems is now certifying Rust for the same purpose alongside C++17.

But what do they know.

Certification for embedded is not about maximizing the utilization of hardware.

You can do embedded programming in Java too.

October 21, 2022

On Friday, 21 October 2022 at 11:51:46 UTC, Ola Fosheim Grøstad wrote:

>

The main issue for D is a lack of strategy that involves architecting a modern D compiler, that people want to work on, and an objective strategy for selecting design issues that needs to be addressed.

Without a solid strategy you can neither get rid of design issues or grow in a predictable manner. For an outsider D as a project looks more like a one-man-person-with-entourage than a cooperative effort. This does not grow confidence in the project.

Yes, that's my take on it too. The only way out of this is that D is forked. Problem with this is that language designers and people with good understanding in compiler technology are not the average programmer and are rare. If you are one of those and want to continue evolving D, then fork it rather than trying to fight this project.

October 21, 2022

On Friday, 21 October 2022 at 13:14:41 UTC, IGotD- wrote:

>

The only way out of this is that D is forked.

I don't think forking D is a going to work. I think the future of D depends on how the foundation is structured and how it operates. D needs a strong and inclusive organizer/leader to head the foundation. Without such a person it will be difficult to switch to a new gear. Finding such a leader would probably be the single-most important thing that could happen.

(Right now I have some hope for Carbon as a C++ alternative, but it is impossible to tell what Carbon will look like at this point. Not even when it comes to basic things like integer math. Carbon might be great, or it might not be great, or it might not happen at all. We'll see in 5-10 years…)

October 21, 2022

On Friday, 21 October 2022 at 07:37:41 UTC, Stefan Hertenberger wrote:

>

On Thursday, 20 October 2022 at 22:41:34 UTC, rassoc wrote:

>

On 20/10/2022 15:37, Don Allen via Digitalmars-d wrote:

>

[...]

To be honest, these kind of access patterns are smelly and there almost always exists a more elegant alternative.

Regarding that example code above, the burrow checker will be happy if you reorder it slightly:

fn main() {
    let mut foo = 5;
    let mut bar = || {
        foo = 17;
    };
    bar();
    println!("{}", &mut foo);
        // just moved this down here
    let mut baz = || {
        foo = 42;
    };
    baz();
    println!("{}", &mut foo);
}

You don't need to reorder, just use references

fn main() {
    let mut foo = 5;
    let bar = |val: &mut i32| {
        *val = 17;
    };
    let baz = |val: &mut i32| {
        *val = 42;
    };
    bar(&mut foo);
    println!("{}", &mut foo);
    baz(&mut foo);
    println!("{}", &mut foo);

}

Which is contrary to the purpose of using closures -- to capture free variables in the lexical environment, rather than having to pass them as arguments. What you have done above could (and should) be re-written with ordinary functions.

October 21, 2022

On Friday, 21 October 2022 at 12:11:13 UTC, Ola Fosheim Grøstad wrote:

>

It is also not true. C/C++ are still completely dominating. Reactive systems are also done using special tools (functional style). Low level programming is not some narrow field that can be shoehorned into any singular dev environment.

Of course. In the small field of audio, I still haven't seen a single competitive Rust product, despite a lot more ecosystem work from people. And D is super niche there, it's all C++ except formerly FLStudio and Bitwig maybe (the two best DAWs were NOT made with C++).

Ironically, Rust not having a lot of support for classical inheritance means people have been building libraries and framework that lacks that essential implementation-hiding subtyping, meaning a creep up of complexity from their subtypes. But building and agreeing on abstractions is what define the ecosystem.

October 21, 2022
On Friday, 21 October 2022 at 07:02:01 UTC, rassoc wrote:
> On 21/10/2022 05:36, Don Allen via Digitalmars-d wrote:
>> As I said in my original post, this kind of code is very common in Scheme.
>>
>
> Right, I walked that path before, even shiny R7RS, and I'm glad I went to speech therapy for my lisp.
>
>> where multiple closures refer to several of them and the closures are called in multiple places
>>
>
> National Spaghetti Day is coming up on January 4th. ;)

You should have gone to another therapist to correct your tendency to offer opinions about code you haven't seen.

>
> In all seriousness, though, I'm not here to invalidate your experiences with Rust. While I've been using D for quite a bit now, I get to experience some pretty uncomfortable cognitive dissonance doing so. I still love it, but D often times offers a slightly less performant and reliable way to tackle a certain set of hard problems. Even if I never get to experience Rust professionally, I'm still quite happy that it set a new baseline for safe languages to come and evolve to.

Since you've said something substantive, I'll comment. I actually agree with you that Rust has shown the world that inherently memory- and thread-safe languages are possible. Haskell did some of that before Rust did, but they didn't quite finish the job.

But I think there is an opportunity to create a memory-safe language with a GC that avoids many of the difficulties of Rust. And I think thread-safety should be an option, not a requirement, because there are applications that are inherently single-threaded. Those applications should not have to adhere to the rules that keep multi-threaded applications safe, as is the case in Rust, the only alternative being to sprinkle your code with "unsafe" blocks, or use thread_local!, which works, but makes the code similarly messy.
October 21, 2022

On Friday, 21 October 2022 at 13:44:56 UTC, Don Allen wrote:

>

Which is contrary to the purpose of using closures -- to capture free variables in the lexical environment, rather than having to pass them as arguments. What you have done above could (and should) be re-written with ordinary functions.

You are right, not sure what i had in mind while writing this :(

October 21, 2022
On Friday, 21 October 2022 at 14:04:25 UTC, Don Allen wrote:
>
> But I think there is an opportunity to create a memory-safe language with a GC that avoids many of the difficulties of Rust. And I think thread-safety should be an option, not a requirement, because there are applications that are inherently single-threaded. Those applications should not have to adhere to the rules that keep multi-threaded applications safe, as is the case in Rust, the only alternative being to sprinkle your code with "unsafe" blocks, or use thread_local!, which works, but makes the code similarly messy.

It already exists and it is called Swift. A few engineers from the Rust team helped engineer Swift. The syntax similarities between Swift and Rust are obvious. In Swift they added a lot of lowering in order to hide the more explicit Rust syntax. If you see the results after the lowering then the Rust syntax shines through even more.

Swift added reference counting as GC (much because of objective-C) and the result is that the language is quite usable, much more easy to use than Rust. You will not end up with senseless life time compiler error as in Rust.

Swift isn't safe as "nothing can go wrong" but safe enough for me. For embedded systems, Swift isn't an ideal candidate as it relies on its own foundation library, objective-C runtime and C++ standard library. Though there has been people who has successfully ported Swift to OS-less systems.