Originally posted by pal666
View Post
Announcement
Collapse
No announcement yet.
Initial Patches Wire In C++20 Coroutines For The GCC Compiler
Collapse
X
-
-
Originally posted by cynical View Post
Fair point, but it really has come a long way. Using escape analysis to transform heap allocations into stack allocations is amazing. And it can do object allocation in less than 10 CPU instructions (deallocation is close to free), something that is not possible with C++ because it lacks a generational GC. I used to dislike Java, but it is truly impressive.
If you ever wondered why a Java app you havent used in a while will totally bog down when you open it up again: Thats the GC running over the whole process space.
- Likes 2
Comment
-
-
Originally posted by pal666 View Postwhat criticism?
language improves with every release
i have no idea what unnamed people complained about
it was never like that
world is running on c++. including rust compiler
rust isn't an alternative to c++, so it can't be better alternative. maybe rust is an alternative to java or c#
Linus Torvalds have his criticism on C++. RMS agrees that C++ sucks.
The Rust compiler is written in Rust, not C++.
Mozilla ported some of their C++ code to Rust, so for their use case it as an alternative to C++.
I get the impression that Rust is on a lower level than both Java and C#, hence more of an alternative to C and C++ than to Java and C#.
Comment
-
Originally posted by cynical View PostUsing escape analysis to transform heap allocations into stack allocations is amazing. And it can do object allocation in less than 10 CPU instructions (deallocation is close to free), something that is not possible with C++ because it lacks a generational GC. I used to dislike Java, but it is truly impressive.Last edited by pal666; 19 November 2019, 10:48 AM.
- Likes 2
Comment
-
Originally posted by uid313 View PostHere is a list of quotes about C++.
Linus Torvalds have his criticism on C++. RMS agrees that C++ sucks.
torvalds is happy c++ programmer for many years, stop quoting his old clueless self
Originally posted by uid313 View PostThe Rust compiler is written in Rust, not C++.
Originally posted by uid313 View PostMozilla ported some of their C++ code to Rust, so for their use case it as an alternative to C++.
Originally posted by uid313 View PostI get the impression that Rust is on a lower level than both Java and C#, hence more of an alternative to C and C++ than to Java and C#.Last edited by pal666; 19 November 2019, 10:49 AM.
- Likes 1
Comment
-
Originally posted by pal666 View Postonly frontend. rest is llvm which is written in c++. and somehow rust is not seen as alternative to c++ by rust's compiler authors
Originally posted by pal666 View Posti get the impression that rust is on a higher level than c++, hence more of an alternative to java and c#
Rust is closer to the metal, I think it compiles down to native code.
The abstractions in Rust are zero-cost. My understanding is that at least some of the abstractions in C++ are not. So I guess that would make Rust lower level than both Java and C#, and at least on the same level as C++ and arguably on a lower level than C++.
- Likes 1
Comment
-
Originally posted by uid313 View PostOf course, they just re-use LLVM instead of re-inventing that.
Originally posted by uid313 View PostIt is really smart of them to just write a front-end for LLVM and let LLVM do what it does best. That way they save a lot of time, effort, resources and don't redundantly duplicate what LLVM does so well. Then they benefit from all improvements to LLVM.
Originally posted by uid313 View PostBut both Java and C# runs upon virtual machines. Java runs on JVM and C# runs on the .NET CLR.
Originally posted by uid313 View PostRust is closer to the metal, I think it compiles down to native code.
Originally posted by uid313 View PostThe abstractions in Rust are zero-cost.
Originally posted by uid313 View PostMy understanding is that at least some of the abstractions in C++ are not.
Originally posted by uid313 View PostSo I guess that would make Rust lower level than both Java and C#, and at least on the same level as C++ and arguably on a lower level than C++.Last edited by pal666; 19 November 2019, 11:26 AM.
- Likes 1
Comment
-
Originally posted by pal666 View Postwhy they didn't reuse firefox istead of reinventing parts of it?
Originally posted by pal666 View Postlol, they could save a lot of time and effort by not wasting their time on rust at all
Rust is suited to parallelism and avoids data races.
Project Quantum is a major rewrite of Firefox’s internals to make Firefox fast. We’re swapping in parts from our experimental browser, Servo, and making massive improvements to other parts of ...
Rust also avoids whole types of bugs, and their style component was written in Rust from the start instead of C++ they would have 73.9% less security bugs. (source)
Originally posted by pal666 View Postthat's a lie.
Well they claim zero-cost abstractions in their documentation.
Comment
-
Originally posted by pal666 View Postwhy they didn't reuse firefox istead of reinventing parts of it?
lol, they could save a lot of time and effort by not wasting their time on rust at all
not really. gcj runs java without virtual machine and rust is built by llvm which is literally (low level) virtual machine
rust is higher from the metal than c++. and both java and c# compile to native code. ever heard about google switching all androids to art?
that's a lie.
your understanding is wrong
your guess is wrong. example of garbage in - garbage out
1. Firefox doesn't implement a generic library for transforming IR into different architectures. What does Firefox have to do with anything?
2. Subjective at best.
3. This is just plain ignorant. Java and C# are both built as a managed language and take advantage of the fact they're run in a VM. When you use things like gcj (which isn't even maintained anymore), you lose parts of the language since you can't do everything that Java does in a native environment. By this logic, C++ also doesn't need to target a bare-metal architecture, it can target whatever it wants. Rust is generally compiled into native object code which is then linked into an executable or static/shared library that's run using the native executable loader.
4/5. Rust abstractions are not guaranteed to be "zero-cost". Neither is C++. The standard for C++ generally doesn't dictate anything concerning overhead, only providing an interface that is potentially capable of less overhead. Implementations may certainly differ.
6. Rust code is generally run at the same level as C++, objectively. You can compile your own basic Rust application using rustc and see what it links against. You can debug and step through it with gdb to see what it does exactly. You can export functions in a library compiled completely using the Rust language and toolset and then have a C application link against that library at link time.
It's almost like you're *trying* to spread misinformation. Rust has issues but no good can come from just stating incorrect things.
Comment
Comment