Will C# Ever Become The Next C++? - /g/ (#105737876) [Archived: 645 hours ago]

Anonymous
6/29/2025, 12:21:45 AM No.105737876
novm
novm
md5: f184a5605cf09417684a819f2c008e95🔍
Programmatically speaking, what would it take for Microsoft to make C# compile like C++, without a vm all while maintaining their same stock .NET libraries? Microsoft always championed C# as a more modern version of C++ that fixes all of C++'s flaws, hence the # symbol, signifying ++ in C++. Will C# ever be able to compile into machine code without a VM the same way C++ can?
Replies: >>105737887 >>105737917 >>105738140 >>105738178 >>105738202 >>105738514 >>105738634 >>105739439 >>105740675 >>105740713
Anonymous
6/29/2025, 12:23:20 AM No.105737887
>>105737876 (OP)
stop trying to compare integers to pointers to integers moran
Anonymous
6/29/2025, 12:28:21 AM No.105737917
3123213213213123
3123213213213123
md5: 212f7d653a39778dfcc92a277d1ab0ea🔍
>>105737876 (OP)
>Will C# ever be able to compile into machine code without a VM the same way C++ can?

you can already do that but you have to give up reflection
Replies: >>105737927 >>105738077 >>105738672
Anonymous
6/29/2025, 12:30:33 AM No.105737927
>>105737917
>XML in 2025
This is why you boomers keep losing
Replies: >>105737944
Anonymous
6/29/2025, 12:32:55 AM No.105737944
>>105737927
better than cmake
Replies: >>105738019
Anonymous
6/29/2025, 12:42:17 AM No.105738019
>>105737944
Not a high bar to clear
Replies: >>105738348
Anonymous
6/29/2025, 12:50:50 AM No.105738077
>>105737917
What kind of things will we be missing out on? Just dependency injection for all that mvvm crap with xaml?
Replies: >>105738095
Anonymous
6/29/2025, 12:53:03 AM No.105738095
>>105738077
>What kind of things will we be missing out on?

nothing. source generators were created as a replacement for reflection in AoT scenarios and everyone are rewriting their libraries to use source generators
Anonymous
6/29/2025, 12:59:29 AM No.105738140
>>105737876 (OP)
No. Its microcuck and a lot of places will refuse to use anything by them, especially when C++ or Rust exists and isn't locked to microcuck.
Anonymous
6/29/2025, 1:03:13 AM No.105738178
>>105737876 (OP)
C++ alongside C power the world, good fucking luck with replacing these behemots with c hashtag
Replies: >>105738187 >>105738343
Anonymous
6/29/2025, 1:04:23 AM No.105738187
>>105738178
no one wants to write header files in 2025 thoughever
Replies: >>105738242
Anonymous
6/29/2025, 1:06:20 AM No.105738202
>>105737876 (OP)
It's better than C++ for almost anything with only few exceptions.
Anonymous
6/29/2025, 1:11:31 AM No.105738242
>>105738187
it does not matter what people want, i'm sure there are more lign of C and C++ than every other language combined so C++ is here to stay.
reminder that most of the code written in the wild isn't open source, just at my job (defense) we have over a billion line of C++ accross multiple projects with the oldest project being started in the 80s when the language wasn't even 10yo.

it does not matter how the foss world reacts, they could rewrite everything in C# the corpo world and especially industrial manufacturers won't as it would cost too much for 0 benefit.
Replies: >>105738292
Anonymous
6/29/2025, 1:18:28 AM No.105738292
132312312321
132312312321
md5: ebf31cbd05a554376991a3fb89cb2958🔍
>>105738242
the NSA already said they will mandate companies to come up with documents detailing how they are going to switch off from C/C++ next year
Replies: >>105738324 >>105740735
Anonymous
6/29/2025, 1:21:59 AM No.105738314
1577112463562
1577112463562
md5: ef768b1e80a2d8e1a3b56cf4c01c5a90🔍
there will be no use for C# once C++ 26 comes out with reflection support
Replies: >>105738345
Anonymous
6/29/2025, 1:22:59 AM No.105738324
>>105738292
not american, don't care
Anonymous
6/29/2025, 1:25:30 AM No.105738343
>>105738178
Are you the header schizo?
Replies: >>105738360
Anonymous
6/29/2025, 1:25:33 AM No.105738345
1729018290027778
1729018290027778
md5: 8ab1c2497454cd9334269a5c3902fa66🔍
>>105738314
C++ is the most painful language to work with. When i program i want to enjoy it. Writing C++ is like pulling teeth. The only one advantage C++ has over C# is performance but in every other regard C# demolishes C++
Replies: >>105738381
Anonymous
6/29/2025, 1:25:49 AM No.105738348
>>105738019
XML has static typing, schema validation, and a templating language that has existed for 30 years. No other popular data format (INI, JSON, TOML, YAML) gives you even one of these things out of the box.

Hating XML just means you take your opinions from e-celebs and NEETs.
Replies: >>105740086
Anonymous
6/29/2025, 1:27:10 AM No.105738360
>>105738343
I'm just a Chad++
Anonymous
6/29/2025, 1:29:01 AM No.105738381
>>105738345
>performance of "optimizing" compiler that introduces hundreds of "undefined behavior" that silently break your code
fixed. this is a double edged sword. i rather have safe, correct program than 10% performance
Replies: >>105738815
Anonymous
6/29/2025, 1:45:30 AM No.105738514
>>105737876 (OP)
i wish it wasn't so popular among pajeets
c# is very comfy
Anonymous
6/29/2025, 2:00:51 AM No.105738629
CPU have been optimizing for C/C++ memory model for the last 30 years.
It would be nice to have GC sitting directly in CPU, instead of virtual memory, for example.
Replies: >>105740106 >>105740387
Anonymous
6/29/2025, 2:02:39 AM No.105738634
>>105737876 (OP)
C# is practically dead.
Replies: >>105738647 >>105738648
Anonymous
6/29/2025, 2:05:13 AM No.105738647
>>105738634
it has like the 3rd most amount of jobs after typescript and java.
Anonymous
6/29/2025, 2:05:14 AM No.105738648
>>105738634
Despite all of Microsoft's efforts and recently aggressive marketing, the tendency will not be reversed.
Anonymous
6/29/2025, 2:07:33 AM No.105738672
>>105737917
>text nodes instead of attributes
truly the worst syntax
Anonymous
6/29/2025, 2:25:47 AM No.105738815
>>105738381
>C++
>safe and correct
Replies: >>105740472
Anonymous
6/29/2025, 3:50:00 AM No.105739439
>>105737876 (OP)
you are mistaken in thinking
1) there is a need for such a thing
2) C# would be a good language for the C++ domain
C# was designed from the ground up with a VM and garbage collection in mind. it is the wrong tool for the job (the things C++ can do that are difficult or impossible with C#)

it's OK to learn and use multiple languages anon
you don't need one language to rule them all (no matter what the rust trannies tell you)
Replies: >>105740024
Anonymous
6/29/2025, 5:11:47 AM No.105740024
>>105739439
there is no need for memory tinkering domain, especially on anything that isn't a 20 years old microcontroller for washing machine.

managed is the future
Anonymous
6/29/2025, 5:20:11 AM No.105740086
>>105738348
Aren't all of those supported with yaml
Anonymous
6/29/2025, 5:23:24 AM No.105740106
>>105738629
High level features like hardware garbage collection are omitted, not because of dedication to C/C++, rather because its really difficult to implement.

Also, had hardware GC actually been implemented, C compilers would absolutely get extensions to use such features.
Replies: >>105740241
Anonymous
6/29/2025, 5:46:12 AM No.105740241
>>105740106
it is difficult only because memory is treated as an unstructured byte array with pointers that could be stored anywhere
Anonymous
6/29/2025, 6:10:11 AM No.105740387
>>105738629
this is maybe the dumbest thing i have ever read. how is a cpu going to know when memory is no longer needed? this would require insane overhead. there is a reason this has never even been considered as a viable option, or the fact that no operating system can do this either. imagine reference counting every memory address with constant cache misses.
Replies: >>105740483
Anonymous
6/29/2025, 6:26:27 AM No.105740472
>>105738815
>reading comprehension
Anonymous
6/29/2025, 6:28:17 AM No.105740483
>>105740387
if you google "hardware garbage collector" there are various proposals. it's not impossible.
https://people.eecs.berkeley.edu/~krste/papers/GC-MicroTopPicks2019.pdf
https://archive.org/details/archive_IHGC/page/n7/mode/2up
Anonymous
6/29/2025, 6:43:10 AM No.105740544
1725342403186319
1725342403186319
md5: eee910e1fed7f2ca2a50c31579f9793d🔍
>want to do anything of value in c#
>have to drop down into unsafe mode and awkwardly interop with C/C++
Anonymous
6/29/2025, 7:12:59 AM No.105740675
>>105737876 (OP)
>if (ptr != (void *)integer)
I don't see the issue. You do need to pay attention to how many bits are in your pointer though, storing 64 bit pointers in 32 bit ints is not gonna work obviously. I have hard cast them to unsigned long longs before thougheverbeit.
Anonymous
6/29/2025, 7:19:25 AM No.105740713
>>105737876 (OP)
>dotnet publish -c Release -r linux-x64 -p:PublishAot=true
There you go.
Anonymous
6/29/2025, 7:23:51 AM No.105740735
>>105738292
Not that poster but I also work in the defense industry. I promise you absolutely nothing will get re-written in Rust unless we get paid to do it. And they aren't gonna pay for that lmao. At best whatever new product we come out with (doesn't happen very often) MIGHT be made in Rust. MIGHT. Still probably not, and it will almost certainly link a bunch of C/C++ libraries which means there was zero point in using Rust in the first place.
Anonymous
6/29/2025, 7:25:19 AM No.105740745
Why would you want to when the benefit is the safety and optimisation of code in a far superior way to unmanaged code?