Our great sponsors
-
TinyGo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
zerosharp
Demo of the potential of C# for systems programming with the .NET native ahead-of-time compilation technology.
-
source-build
A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
-
zig
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
The C# compiler and parts of the supporting .NET runtime are written in C#, so yes there is a boot strapping issue. Other languages like Rust or even C compilers written in C have this problem.
For initial porting to a new system or processor architecture, the C++ part of CoreCLR (the main runtime for .NET) can be built with CMake and LLVM on the target system. The libraries can be cross-compiled on another system that already supports .NET and copied to the target system. Some Details are here:
https://github.com/dotnet/runtime/blob/main/docs/design/core...
For building from source to satisfy requirements Linux distributions, Microsoft has a system to build from source. My understanding from the last time I closely looked at it is some binary dependencies are de compiled to MSIL (the bytecode used by .NET). Since CoreCLR includes a MSIL assembler written in C++ (ilasm), it can bootstrap using these MSIL sources. But I have not looked at this project closely in a while and it evolved quite a lot while I was watching it. The system for the source build is here:
https://github.com/dotnet/source-build
The C# compiler and parts of the supporting .NET runtime are written in C#, so yes there is a boot strapping issue. Other languages like Rust or even C compilers written in C have this problem.
For initial porting to a new system or processor architecture, the C++ part of CoreCLR (the main runtime for .NET) can be built with CMake and LLVM on the target system. The libraries can be cross-compiled on another system that already supports .NET and copied to the target system. Some Details are here:
https://github.com/dotnet/runtime/blob/main/docs/design/core...
For building from source to satisfy requirements Linux distributions, Microsoft has a system to build from source. My understanding from the last time I closely looked at it is some binary dependencies are de compiled to MSIL (the bytecode used by .NET). Since CoreCLR includes a MSIL assembler written in C++ (ilasm), it can bootstrap using these MSIL sources. But I have not looked at this project closely in a while and it evolved quite a lot while I was watching it. The system for the source build is here:
https://github.com/dotnet/source-build
You don't need any of that to do system programming in C#. Startup time of JIT runtime is not too bad. Similarly, garbage collector is fine if you don't load it too much (neither allocations/second nor bytes/second).
Here's my almost decade-old open source code which works for hours allocating very little (the process gets killed by the OS if exceeds 11MB of RAM): https://github.com/Const-me/SkyFM
Here's somewhat similar modern code, also multimedia related: https://github.com/Const-me/Vrmac/tree/master/VrmacVideo
> The 4 languages I would consider for low-level code these days are, in order:
What about Zig? https://ziglang.org