مباشر الخميس، 5 نوفمبر 2026
عاجل
محلياتخصم خاص لحاملي كارت المتابعة، مستشفى طوخ المركزي يعلن أسعار الولادة الطبيعية والقيصريصحة5 أخطاء تقع بها الأمهات لعلاج أعراض صحية تصيب أطفالهن في المنزلاقتصادأسعار النفط تواصل النزيف مع تراجع احتمالات التصعيد في الشرق الأوسطالعالملأول مرة منذ 150 عاما.. حدث قضائي يخص أحد أفراد العائلة المالكة في بريطانياالعالمانتصارات تاريخية للديمقراطيين.. النساء والأقليات يعززن حضورهن في قيادة الولايات المتحدةحوادثجرح بالرأس وسلاح أبيض.. التحقيق في مشاجرة دامية نشبت بين عاطلين بالقليوبيةرياضة محلية10 ملايين دولار تفصل إمام عاشور عن الرحيل.. أمير هشام يكشف موقف الأهليرياضة محليةتغيرات مفاجئة والبداية اليوم، درجات الحرارة على مدن ومحافظات مصرالعالموادي السيليكون يخسر رهان الـ600 مليون دولار في انتخابات الكونغرس الأميركيصحة10 ألعاب يحبها الأطفال المصابون بالتوحد.. ولماذا؟ رياضة محليةمنع ظهور مدرب منتخب مصر في وسائل الإعلامالشرق الأوسطالبرلمان التركي يقر أولى مواد مشروع قانون المصادقة على اتفاق “حلف مكة”حوادثانقلاب أتوبيس ركاب بوصلة الـ7 كيلو في سوهاج.. ونقل المصابين إلى المستشفى الجامعيالعالمروسيا تعلن استهداف منشآت طاقة ومراكز لوجستية أوكرانية وسفينة شحن في البحر الأسودالعالممسؤول أوكراني: إصابة 3 أشخاص نتيجة استهدافهم بطائرات روسية مسيرة بمدينة دنيبروعلوم وتكنولوجياعلماء روس يطورون ذكاء اصطناعيا للتنبؤ المبكر بالسرطانمحلياتالأوقاف تطلق لقاءً للأطفال عن مخاطر مشروبات الطاقة في 27 مسجدًا غدًا الجمعةحوادثالمشدد 6 سنوات وغرامة 100 ألف جنيه.. جنايات سوهاج تسدل الستار على قضية مخدراترياضة محليةالأهلي يرفض التعاقد مع إبراهيم سامي مدافع القناة لأسباب فنيةمحلياتالأرصاد تنصح المواطنين: تخلوا عن الملابس الصيفية تماماً بدءا من اليوممحلياتخصم خاص لحاملي كارت المتابعة، مستشفى طوخ المركزي يعلن أسعار الولادة الطبيعية والقيصريصحة5 أخطاء تقع بها الأمهات لعلاج أعراض صحية تصيب أطفالهن في المنزلاقتصادأسعار النفط تواصل النزيف مع تراجع احتمالات التصعيد في الشرق الأوسطالعالملأول مرة منذ 150 عاما.. حدث قضائي يخص أحد أفراد العائلة المالكة في بريطانياالعالمانتصارات تاريخية للديمقراطيين.. النساء والأقليات يعززن حضورهن في قيادة الولايات المتحدةحوادثجرح بالرأس وسلاح أبيض.. التحقيق في مشاجرة دامية نشبت بين عاطلين بالقليوبيةرياضة محلية10 ملايين دولار تفصل إمام عاشور عن الرحيل.. أمير هشام يكشف موقف الأهليرياضة محليةتغيرات مفاجئة والبداية اليوم، درجات الحرارة على مدن ومحافظات مصرالعالموادي السيليكون يخسر رهان الـ600 مليون دولار في انتخابات الكونغرس الأميركيصحة10 ألعاب يحبها الأطفال المصابون بالتوحد.. ولماذا؟ رياضة محليةمنع ظهور مدرب منتخب مصر في وسائل الإعلامالشرق الأوسطالبرلمان التركي يقر أولى مواد مشروع قانون المصادقة على اتفاق “حلف مكة”حوادثانقلاب أتوبيس ركاب بوصلة الـ7 كيلو في سوهاج.. ونقل المصابين إلى المستشفى الجامعيالعالمروسيا تعلن استهداف منشآت طاقة ومراكز لوجستية أوكرانية وسفينة شحن في البحر الأسودالعالممسؤول أوكراني: إصابة 3 أشخاص نتيجة استهدافهم بطائرات روسية مسيرة بمدينة دنيبروعلوم وتكنولوجياعلماء روس يطورون ذكاء اصطناعيا للتنبؤ المبكر بالسرطانمحلياتالأوقاف تطلق لقاءً للأطفال عن مخاطر مشروبات الطاقة في 27 مسجدًا غدًا الجمعةحوادثالمشدد 6 سنوات وغرامة 100 ألف جنيه.. جنايات سوهاج تسدل الستار على قضية مخدراترياضة محليةالأهلي يرفض التعاقد مع إبراهيم سامي مدافع القناة لأسباب فنيةمحلياتالأرصاد تنصح المواطنين: تخلوا عن الملابس الصيفية تماماً بدءا من اليوم
أسعار
دولار أمريكي54.77EGPيورو61.54EGPجنيه إسترليني73.78EGPريال سعودي14.61EGPدرهم إماراتي14.91EGPدينار كويتي176.59EGPدينار أردني77.25EGPريال قطري15.05EGPليرة تركية1.09EGPيوان صيني8.19EGPذهب 247,262.74EGP/جمذهب 216,354.90EGP/جمذهب 185,447.05EGP/جمفضة93.03EGP/جم
دولار أمريكي54.77EGPيورو61.54EGPجنيه إسترليني73.78EGPريال سعودي14.61EGPدرهم إماراتي14.91EGPدينار كويتي176.59EGPدينار أردني77.25EGPريال قطري15.05EGPليرة تركية1.09EGPيوان صيني8.19EGPذهب 247,262.74EGP/جمذهب 216,354.90EGP/جمذهب 185,447.05EGP/جمفضة93.03EGP/جم
خبر عاجل
اقرأ الخبر
devops

Microsoft wants safer C# without turning it into Rust

رجوع

.NET product manager Richard Lander has written a lengthy post describing how the team intends to improve the memory safety of C# by introducing a new model and redefining the existing unsafe keyword, making the language more like Rust, though without giving up automatic memory management. “We envision a future where C# is among a set of languages chosen and noted for the type- and memory-safety enforcement,” said Lander. Many C# developers never use unsafe, but it has been part of the language from its first release. “Writing unsafe code is like writing C code within a C# program,” said an early book called The C# Programming Language, written by its inventor Anders Hejlsberg and others. Examples of where unsafe code is necessary include interop with the underlying operating system, accessing memory-mapped devices, or implementing time-critical code. Unsafe code allows the use of pointer types, which are not tracked by the .NET garbage collector, and pointer operators. Other than that, the existing unsafe modifier has no effect on a type or member. This will change in C# 16, which is two versions in the future and will be released in late 2027, according to the usual annual .NET cycle, along with .NET 12, which will be a long-term support (LTS) release. Developers can also expect a preview in C# 15 and .NET 11. In the new model, marking a method as unsafe will “also mark it as requires-unsafe, meaning callers must be in an unsafe context and overrides cannot be unsafe if the base members is safe,” states the current language proposal. This means that the unsafe designation propagates to callers until it is suppressed by including an unsafe context within a method, but not marking the method as unsafe. Some have questioned why the team will rely on the absence of unsafe to suppress propagation, rather than using the safe modifier. “I’ve been advocating the design team for just this thing,” said Lander. It will no longer be possible to mark a type as unsafe; the unsafe scope moves down to individual methods, properties, and fields. Another change is that the use of pointer types and some pointer expressions will no longer be considered unsafe; it is only dereferencing a pointer and therefore accessing unmanaged memory that will require an unsafe context. The changes will be opt-in for C# 16, meaning that developers can continue with the C# 1.0 model, but the .NET runtime libraries will opt-in, said Lander. In addition, Microsoft is considering adding badges on packages in NuGet, the .NET package repository, to show whether they have opted in and to encourage adoption. A future version of C# may make the model opt out instead. “Our intention is to make the new C# safety model the new normal,” said Lander. The idea is not to make unsafe code less dangerous, but rather to make it more visible and easier to review. This extends to safety documentation, via a comment on an unsafe member that defines a contract for its use, which will be encouraged by static code analyzers. Developer reaction so far is largely positive. “I’m both a C# and Rust dev, and I really welcome it … I wouldn’t hate it if C# became closer to a managed Rust,” said one. One odd thing about this proposal is that C# developers working on business applications will not notice any change, as they never use unsafe code. Nevertheless, Lander stated that “this feature is among the highest-leverage changes that we can make” to improve confidence in C# code safety. ®

المصدر: The Register

0 مشاهدة

أضف تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *