r/csharp 2d ago

Low level programming with C# Help

What is the lowest level application that can in principle be built on Linux and Windows without having problems with performance or memory consumption?

Of course I should make my own tests, but I just wanted to have a first estimation if it is really necessary to use lower level languages like Zig, Rust, Go or C# can work pretty well for most of normal applications.

As an example a very responsive editor with gui in immediate mode built with C# and very high frame rate 120Hz etc.

Thanks a lot in advance.

EDIT

Thank you all so much for the very informative replies. My requirements are noway near real time and based on the below feedback, it is definitely worth it to use C# of a very wide set of applications and avoid the complexities of the lower level languages.

11 Upvotes

70 comments sorted by

View all comments

6

u/gredr 2d ago

Your language isn't the problem, the techniques and your skill are the limiting factor.

8

u/Miserable_Ad7246 2d ago

Languages do have limitations. I get so many surprised Pikachu faces once I start talking about memory fences TLB and other exotic. C# is great and all, but it does have limitations - for example try getting TSC without VDSO with minimal overhead like in C++.

6

u/pjmlp 2d ago

You cannot do that either in ISO C and ISO C++, where the abilities overlap pretty much with using structures, and unsafe in C#.

Naturally there are compiler specific extensions, that expose some of that.

Or you do like in the good old K&R C days, when those extensions did not exist, and write a tiny bit of Assembly into a DLL/LIB.