4 ms·
C# has a compiler flag for checked arithmetic, i.e. overflow will throw an exception. You can't use c# for kernel development of course, but the idea has existe
by grnmamba 5y ago
C# has a compiler flag for checked arithmetic, i.e. overflow will throw an exception. You can't use c# for kernel development of course, but the idea has existed for decades (for much longer than c# existed).
That flag is not set by default in the new project templates for whatever reason. There's also an escape hatch, the unchecked keyword, for the rare cases where you need to overflow, e.g. when implementing hash tables.
- gpderetta 5y ago-fsanitize=signed-integer-overflow produces rather decent code with GCC.
- pjmlp 5y ago> You can't use c# for kernel development of course Midori team kind of disagreed with that, and most of System C# features keep landing on regular C# a bit per version, but I digress.
- viraptor 5y ago> Midori team kind of disagreed with that Also Singularity https://en.wikipedia.org/wiki/Singularity_(operating_system) https://en.wikipedia.org/wiki/Singularity_(operating_system) and a few random attempts like SharpOs https://sourceforge.net/projects/sharpos/ https://sourceforge.net/projects/sharpos/ and Cosmos.
- pjmlp 5y agoSingularity actually uses a micro-kernel in C++, with everything else in Sing#. An approach similar to what Meadows has taken with NuttX. I haven't mentioned, because I expected it as a possible reply that Singularity wasn't 100% pure Sing#.