digitalmars.D - Someone should tell him about D...
- twinbee (5/5) Jun 02 2022 Quote from Elon Musk on Twitter:
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (2/7) Jun 02 2022 Makes no sense. Clang is the same compiler for C and C++…
- Paulo Pinto (5/14) Jun 02 2022 Back in the early days of C vs C++ flamewars, there were these
- forkit (3/3) Jun 02 2022 On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:
- Araq (5/9) Jun 02 2022 Assembly instruction `mov rcx, [rax]`. Cost: 1 cycle. Or 500.
- max haughton (3/14) Jun 02 2022 Can even be zero on Zen3 with the stack to register file
- Guillaume Piolat (4/8) Jun 02 2022 Sometimes it feels like people with a conservative bias live in a
- monkyyy (4/6) Jun 02 2022 Sometimes it feels like people with a commie bias live in a world
- H. S. Teoh (5/12) Jun 02 2022 +1, LOL. :-D
- Timon Gehr (3/9) Jun 02 2022 Truth. In terms of actual CPU operations, it will compile to an
- IGotD- (5/10) Jun 02 2022 While I can understand the frustration of modern C++, the right
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (7/11) Jun 02 2022 Yeah, well, modern C++ doesn't add anything that affects
- H. S. Teoh (8/21) Jun 02 2022 C++? And string manipulation? In the same sentence??
- IGotD- (4/10) Jun 02 2022 I know it's a bit strange because C++ is actually much better
- monkyyy (4/7) Jun 03 2022 ?
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (7/9) Jun 03 2022 No, C++ is similar to C in performance, in theory C++ could do
- monkyyy (3/12) Jun 03 2022 I meant compile speeds, adopting every feature will make a slow
- Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= (5/7) Jun 03 2022 If you write you own libraries and break dependencies then you
- IGotD- (14/21) Jun 03 2022 When it comes to strings? Depends what you are doing and how you
- monkyyy (6/14) Jun 03 2022 no, c > c++ in general because the sanest way to use c++ is as c
- =?UTF-8?Q?Ali_=c3=87ehreli?= (8/11) Jun 03 2022 My short list to pick C++ and never touch C:
- Steven Schveighoffer (8/20) Jun 03 2022 D almost had 2 types for arrays, one that would allow resizing and
Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384
Jun 02 2022
On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384Makes no sense. Clang is the same compiler for C and C++…
Jun 02 2022
On Thursday, 2 June 2022 at 10:43:40 UTC, Ola Fosheim Grøstad wrote:On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Back in the early days of C vs C++ flamewars, there were these geek t-shirts, "my compiler compiles yours" from C folks. I guess we need an updated version of them.Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384Makes no sense. Clang is the same compiler for C and C++…
Jun 02 2022
On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Well, you know what they say: "The weakness of the C language comes from its strength"
Jun 02 2022
On Thursday, 2 June 2022 at 11:51:30 UTC, forkit wrote:On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Assembly instruction `mov rcx, [rax]`. Cost: 1 cycle. Or 500. It's not 1980 anymore, there is hardly a benefit in looking at the assembler, you need to measure things. Musk is surprisingly bad at working from "first principles" sometimes.Well, you know what they say: "The weakness of the C language comes from its strength"
Jun 02 2022
On Thursday, 2 June 2022 at 13:38:27 UTC, Araq wrote:On Thursday, 2 June 2022 at 11:51:30 UTC, forkit wrote:Can even be zero on Zen3 with the stack to register file optimization.On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Assembly instruction `mov rcx, [rax]`. Cost: 1 cycle. Or 500. It's not 1980 anymore, there is hardly a benefit in looking at the assembler, you need to measure things. Musk is surprisingly bad at working from "first principles" sometimes.Well, you know what they say: "The weakness of the C language comes from its strength"
Jun 02 2022
On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations."Sometimes it feels like people with a conservative bias live in a world where only "established" languages and brands exist. https://en.wikipedia.org/wiki/Scurvy#History
Jun 02 2022
On Thursday, 2 June 2022 at 14:24:00 UTC, Guillaume Piolat wrote:Sometimes it feels like people with a conservative bias live in a world where only "established" languages and brands exist.Sometimes it feels like people with a commie bias live in a world where all the established languages will be trivially replaced by the next thing they think up
Jun 02 2022
On Thu, Jun 02, 2022 at 04:45:04PM +0000, monkyyy via Digitalmars-d wrote:On Thursday, 2 June 2022 at 14:24:00 UTC, Guillaume Piolat wrote:+1, LOL. :-D T -- It won't be covered in the book. The source code has to be useful for something, after all. -- Larry WallSometimes it feels like people with a conservative bias live in a world where only "established" languages and brands exist.Sometimes it feels like people with a commie bias live in a world where all the established languages will be trivially replaced by the next thing they think up
Jun 02 2022
On 02.06.22 12:36, twinbee wrote:Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384Truth. In terms of actual CPU operations, it will compile to an arbitrary code execution exploit. The point about C++ is valid too.
Jun 02 2022
On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384While I can understand the frustration of modern C++, the right tool for the right job is more important. Try doing string manipulation with the C standard library, in that case I would pick C++ over C any day. C is not always simpler.
Jun 02 2022
On Thursday, 2 June 2022 at 17:00:35 UTC, IGotD- wrote:While I can understand the frustration of modern C++, the right tool for the right job is more important. Try doing string manipulation with the C standard library, in that case I would pick C++ over C any day. C is not always simpler.Yeah, well, modern C++ doesn't add anything that affects performance bottle necks in a negative way. Sounds like he has talked with someone that has started coding before they knew what the requirements should be. C++ does not support evolutionary development… you have to know what you are going to do before you start coding.
Jun 02 2022
On Thu, Jun 02, 2022 at 05:00:35PM +0000, IGotD- via Digitalmars-d wrote:On Thursday, 2 June 2022 at 10:36:24 UTC, twinbee wrote:C++? And string manipulation? In the same sentence?? You make me cringe. :-/ (Now, if it was *D* and string manipulation in the same sentence, it would be a different story. ;-)) T -- Computers aren't intelligent; they only think they are.Quote from Elon Musk on Twitter: "Side note: I hate the bloated mess that is modern C++, but love simple C, as you know what it will compile to in terms of actual CPU operations." Source: https://twitter.com/elonmusk/status/1532274289893904384While I can understand the frustration of modern C++, the right tool for the right job is more important. Try doing string manipulation with the C standard library, in that case I would pick C++ over C any day. C is not always simpler.
Jun 02 2022
On Thursday, 2 June 2022 at 17:26:43 UTC, H. S. Teoh wrote:C++? And string manipulation? In the same sentence?? You make me cringe. :-/ (Now, if it was *D* and string manipulation in the same sentence, it would be a different story. ;-)) TI know it's a bit strange because C++ is actually much better than C (not even mentioning the security hazards). That's why I like D because in this case it's much better than C++.
Jun 02 2022
On Thursday, 2 June 2022 at 17:42:42 UTC, IGotD- wrote:I know it's a bit strange because C++ is actually much better than C (not even mentioning the security hazards). That's why I like D because in this case it's much better than C++.? Isnt c++ extremely slow? Like c++ adopts every feature and like thats .... fine; but it can never be good
Jun 03 2022
On Friday, 3 June 2022 at 19:24:03 UTC, monkyyy wrote:Isnt c++ extremely slow? Like c++ adopts every feature and like thats .... fine; but it can never be goodNo, C++ is similar to C in performance, in theory C++ could do better than C because of stricter typing, but I don’t think compilers exploit that. It would break existing code... Most new C++ features are either syntax sugar or library additions, relatively few new features. Although stackless coroutines is a major recent one.
Jun 03 2022
On Friday, 3 June 2022 at 19:55:48 UTC, Ola Fosheim Grøstad wrote:On Friday, 3 June 2022 at 19:24:03 UTC, monkyyy wrote:I meant compile speeds, adopting every feature will make a slow compiler and I dont want to spend an hour waitingIsnt c++ extremely slow? Like c++ adopts every feature and like thats .... fine; but it can never be goodNo, C++ is similar to C in performance, in theory C++ could do better than C because of stricter typing, but I don’t think compilers exploit that. It would break existing code... Most new C++ features are either syntax sugar or library additions, relatively few new features. Although stackless coroutines is a major recent one.
Jun 03 2022
On Friday, 3 June 2022 at 20:04:37 UTC, monkyyy wrote:I meant compile speeds, adopting every feature will make a slow compiler and I dont want to spend an hour waitingIf you write you own libraries and break dependencies then you can get decent compilation speeds, but many existing code bases #include way too much leading to many pointless dependencies and slower builds.
Jun 03 2022
On Friday, 3 June 2022 at 19:24:03 UTC, monkyyy wrote:On Thursday, 2 June 2022 at 17:42:42 UTC, IGotD- wrote:When it comes to strings? Depends what you are doing and how you are doing it. C++ made a strange decision to include the null terminator at the end of the strings even if it isn't really necessary. The result is that you cannot slice strings and can lead to unnecessary deep copies. In order avoid this C++ invented string_view and associated literals. Now you suddenly have two types of strings and if you make an API you might have to support both string and string_view. This is one of the crazy things with "modern C++". Still it is more user friendly than the old C library strings which also are prone to buffer overflows. D in this case did the right choice not including the null terminator so that you can slice strings all you want and no extra string view.I know it's a bit strange because C++ is actually much better than C (not even mentioning the security hazards). That's why I like D because in this case it's much better than C++.? Isnt c++ extremely slow? Like c++ adopts every feature and like thats .... fine; but it can never be good
Jun 03 2022
On Friday, 3 June 2022 at 20:12:01 UTC, IGotD- wrote:On Friday, 3 June 2022 at 19:24:03 UTC, monkyyy wrote:no, c > c++ in general because the sanest way to use c++ is as c + one or two features and c++ will be extremely slow to compile and iterate on. C is an extremely high bar, c++ "spread itself to thin", "has to many cooks", "jack of all trades, master of none"On Thursday, 2 June 2022 at 17:42:42 UTC, IGotD- wrote:When it comes to strings?****I know it's a bit strange because C++ is actually much better than C****?
Jun 03 2022
On 6/3/22 13:24, monkyyy wrote:no, c > c++ in general because the sanest way to use c++ is as c + one or two featuresMy short list to pick C++ and never touch C: - Constructor, destructor, etc. - Templatesand c++ will be extremely slow to compile and iterate on.C++ compilation speed is one thing that shows me humans can adapt to any situation and can accept anything. An example: 64-way parallel compilation on 20+ cores and the project builds in 2 hours. :/ Ali
Jun 03 2022
On 6/3/22 4:12 PM, IGotD- wrote:When it comes to strings? Depends what you are doing and how you are doing it. C++ made a strange decision to include the null terminator at the end of the strings even if it isn't really necessary. The result is that you cannot slice strings and can lead to unnecessary deep copies. In order avoid this C++ invented string_view and associated literals. Now you suddenly have two types of strings and if you make an API you might have to support both string and string_view. This is one of the crazy things with "modern C++". Still it is more user friendly than the old C library strings which also are prone to buffer overflows. D in this case did the right choice not including the null terminator so that you can slice strings all you want and no extra string view.D almost had 2 types for arrays, one that would allow resizing and another that would just be a slice. The point was to solve the stomping problem. But we fixed it a different way. Feast your eyes! https://forum.dlang.org/post/h5nbj3$17is$1 digitalmars.com -Steve
Jun 03 2022