Earlier quoted context omitted.
I’m not sure how people are supposed to do that in the browser. This feels like an excessively dismissive comment.
Have you not heard of WebAssembly?
Cooperative C++ Evolution – Toward a TypeScript for C++
201–209 of 209 posts
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#202Earlier quoted context omitted.
This is differently bad because it may mean tight loops are enormously slower under debug for no good reason, it's an adverse consequence of the C++ "wrong defaults" problem. Because they're defaults, we can't detect whether they're what was specifically needed or just nobody cared, so we guess nobody cared and act accordingly.
It isn't as if Rust is any different in this regard.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#203Earlier quoted context omitted.
> C++20 is remarkably safe and concise if you take full advantage of the type system. Against what sort of laughably low bar are you measuring to make C++ "remarkably" safe ? This is a language which delights in deliberately adding more footguns, on the rationale that well, it's less safe so surely it'll be faster right? No need to measure, no need to investigate what actual performance optimisations might somehow be…
You can replace almost everything in C++ with stricter implementations of your own design if you don't like the behaviors or guarantees of the standard/default implementation. Many people do because the language is very amenable to it and the codegen is usually optimal. Living entirely within the standard library and the constraints it imposes to support backward compatibility is a choice, not a requirement. The stan…
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#204Earlier quoted context omitted.
Sure, there might be other interop stories that are a better fit, and Dart is a pretty unflattering comparison (perhaps chosen intentionally). But within Herb's dichotomy, I think Carbon falls into the "Dart" category, since the "Typescript" category is rather narrow.
If you're going to create a dichotomy between two languages, I think we're dramatically closer to TypeScript. The whole point of Carbon is to integrate into and re-use an existing ecosystem of software written in C++. It's as far from the Dart approach as it can get without literally being a TypeScript style approach. Ultimately, this dichotomy doesn't help discuss Carbon. I think it is useful for looking at Rust (un…
The construct can be useful without being the end-all answer to what should be done and I would definitely advice you to watch the full talk if you haven't yet. And the consider how each point may apply or not apply to Carbon. Don't just dismiss it on the notion that Carbon is different from Dart.
Actually, I'd encourage you to reach out to Herb Sutter and ideally meet up in person to discuss the matter. Your goals are aligned in many ways and while you have different approaches a lot of good can come out of sharing ideas.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#205Earlier quoted context omitted.
Have you not heard of WebAssembly?
WebAssembly is not without tradeoffs either. I'm not an expert, but it's often heavier due to bundling the native language's stdlib; it's annoying to interop with the browser environment because that's still JavaScript-tailored; it's also just hard to write code that can be compiled into WASM (e.g. in Rust, it needs to be `#[no_std]`)
If you're just glueing things together between APIs, then JavaScript is fine, and static typing would just get in the way.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#206Earlier quoted context omitted.
Typescript has a lot of momentum on all fronts and is almost certainly the future of Javascript. The big problem is that it still requires transpilation, which can set up all sorts of shitty traps. Not to mention that the Javascript ecosystem in general is a horrendous mess, which Typescript on its own can’t fix.
The future of JavaScript is in the past. Get rid of all the stupid transpilers and frameworks and just use plain JavaScript in the browser.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#207Herb is infinitely more qualified to speak on the matter than I am, but I don't think I understand the point. We've had multiple decades to bring C++ under control for safe general purpose usage and it's still very loosey-goosey, to the point where people are rightly afraid to start work in it not because it's a bad or deficient language, but because keeping codebases sane is challenging and requires a lot of discipl…
I don't think it's really any more difficult to build sane C++ codebases than any other language. The issue is not sanity; it's safety. It's extraordinarily difficult to build a significant C++ codebase without segfaults and UB. You end up wasting a huge amount of time debugging that stuff. Any time I've lost fighting Rust's borrow checker has easily been paid off by not having to debug segfaults.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#208Earlier quoted context omitted.
I don't think it's really any more difficult to build sane C++ codebases than any other language. The issue is not sanity; it's safety. It's extraordinarily difficult to build a significant C++ codebase without segfaults and UB. You end up wasting a huge amount of time debugging that stuff. Any time I've lost fighting Rust's borrow checker has easily been paid off by not having to debug segfaults.
Not my experience at all. I work on very large C++ code bases and haven’t had a bug in production for more than 5 years. The trick is solid tests and using tools like Valgrind/Helgrind to remove all memory issues.
Re: Cooperative C++ Evolution – Toward a TypeScript for C++
#209Earlier quoted context omitted.
Not my experience at all. I work on very large C++ code bases and haven’t had a bug in production for more than 5 years. The trick is solid tests and using tools like Valgrind/Helgrind to remove all memory issues.
It also depends on what kind of application you're developing and the resource usage patterns.