27 মার্চ, 2025 থেকে, আমরা AOSP তৈরি করতে এবং অবদান রাখতে aosp-main
এর পরিবর্তে android-latest-release
ব্যবহার করার পরামর্শ দিচ্ছি। আরও তথ্যের জন্য, AOSP-তে পরিবর্তনগুলি দেখুন।
অ্যান্ড্রয়েড মরিচা ভূমিকা
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
অ্যান্ড্রয়েড প্ল্যাটফর্মটি মরিচা, একটি আধুনিক সিস্টেম-প্রোগ্রামিং ভাষা যা C/C++ এর সমতুল্য কর্মক্ষমতা সহ মেমরি নিরাপত্তা গ্যারান্টি প্রদান করে, এ নেটিভ OS উপাদানগুলি বিকাশের জন্য সহায়তা প্রদান করে। মরিচা কম্পাইল-টাইম চেকগুলির সংমিশ্রণ ব্যবহার করে যা অবজেক্টের জীবনকাল এবং মালিকানা প্রয়োগ করে এবং রানটাইম চেক যা বৈধ মেমরি অ্যাক্সেস নিশ্চিত করে, যার ফলে একটি আবর্জনা সংগ্রহকারীর প্রয়োজনীয়তা দূর হয়।
মরিচা আধুনিক ভাষার বৈশিষ্ট্যগুলির একটি পরিসর সরবরাহ করে যা বিকাশকারীদের তাদের কোডে আরও উত্পাদনশীল এবং আত্মবিশ্বাসী হতে দেয়:
- নিরাপদ সমসাময়িক প্রোগ্রামিং - যে সহজে এটি ব্যবহারকারীদের দক্ষ, থ্রেড-সেফ কোড লেখার অনুমতি দেয় তা রাস্টের ভয়হীন কনকারেন্সি স্লোগানের জন্ম দিয়েছে।
- এক্সপ্রেসিভ টাইপ সিস্টেম - মরিচা অত্যন্ত এক্সপ্রেসিভ ধরনের (যেমন নিউটাইপ র্যাপার এবং বিষয়বস্তু সহ enum ভেরিয়েন্ট) অনুমতি দিয়ে লজিক্যাল প্রোগ্রামিং বাগ প্রতিরোধ করতে সাহায্য করে।
- শক্তিশালী কম্পাইল-টাইম চেক - কম্পাইল-টাইমে ধরা পড়া আরও বাগ বিকাশকারীর আত্মবিশ্বাস বাড়ায় যে কোড সফলভাবে কম্পাইল হলে, এটি উদ্দেশ্য অনুযায়ী কাজ করে।
- বিল্ট-ইন টেস্টিং ফ্রেমওয়ার্ক - রাস্ট একটি বিল্ট-ইন টেস্টিং ফ্রেমওয়ার্ক প্রদান করে যেখানে ইউনিট টেস্টগুলি তাদের পরীক্ষা করা বাস্তবায়নের পাশাপাশি স্থাপন করা যেতে পারে, যা ইউনিট টেস্টিংকে অন্তর্ভুক্ত করা সহজ করে তোলে।
- ত্রুটি হ্যান্ডলিং এনফোর্সমেন্ট - পুনরুদ্ধারযোগ্য ব্যর্থতার সাথে ফাংশনগুলি একটি ফলাফলের ধরন ফিরিয়ে দিতে পারে, যা হয় একটি সফল বৈকল্পিক বা একটি ত্রুটির বৈকল্পিক হবে৷ কম্পাইলারের জন্য কলকারীদের একটি ফাংশন কল থেকে প্রত্যাবর্তিত
Result
enum এর ত্রুটির বৈকল্পিক পরীক্ষা এবং পরিচালনা করতে হবে। এটি পরিচালনা না করা ব্যর্থতার ফলে বাগগুলির সম্ভাবনা হ্রাস করে। - সূচনা - মরিচা ব্যবহার করার আগে প্রতিটি ভেরিয়েবলকে তার প্রকারের আইনী সদস্যের কাছে আরম্ভ করা প্রয়োজন, একটি অনিরাপদ মান থেকে অনিচ্ছাকৃত সূচনা প্রতিরোধ করে।
- নিরাপদ পূর্ণসংখ্যা পরিচালনা - সমস্ত পূর্ণসংখ্যা-টাইপ রূপান্তরগুলি স্পষ্ট কাস্ট। একটি ভেরিয়েবলকে বরাদ্দ করার সময় বা অন্য ধরনের সাথে পাটিগণিত করার চেষ্টা করার সময় বিকাশকারীরা দুর্ঘটনাক্রমে একটি ফাংশন কলের সময় কাস্ট করতে পারে না। মরিচা-এর জন্য অ্যান্ড্রয়েডে ডিফল্টরূপে ওভারফ্লো চেকিং চালু থাকে, যার জন্য ওভারফ্লো ক্রিয়াকলাপগুলি সুস্পষ্ট হতে হবে।
আরও তথ্যের জন্য, অ্যান্ড্রয়েড রাস্ট সমর্থনে ব্লগ পোস্টগুলির সিরিজ দেখুন:
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Android Rust introduction\n\nThe Android platform provides support for developing native OS components in Rust,\na modern systems-programming language that provides memory safety guarantees with\nperformance equivalent to C/C++. Rust uses a combination of compile-time checks\nthat enforce object lifetime and ownership, and runtime checks that ensure valid\nmemory accesses, thereby eliminating the need for a garbage collector.\n\nRust provides a range of modern language features which allow developers to be\nmore productive and confident in their code:\n\n- **Safe concurrent programming** - The ease with which this allows users to write efficient, thread-safe code has given rise to Rust's [Fearless Concurrency](https://doc.rust-lang.org/book/ch16-00-concurrency.html) slogan.\n- **Expressive type system** - Rust helps prevent logical programming bugs by allowing for highly expressive types (such as Newtype wrappers, and enum variants with contents).\n- **Stronger Compile-time Checks** - More bugs caught at compile-time increases developer confidence that when code compiles successfully, it works as intended.\n- **Built-in Testing Framework** - Rust provides a built-in testing framework where unit tests can be placed alongside the implementation they test, making unit testing easier to include.\n- **Error handling enforcement** - Functions with recoverable failures can return a [Result type](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html), which will be either a success variant or an error variant. The compiler requires callers to check for and handle the error variant of a `Result` enum returned from a function call. This reduces the potential for bugs resulting from unhandled failures.\n- **Initialization** - Rust requires every variable to be initialized to a legal member of its type before use, preventing an unintentional initialization to an unsafe value.\n- **Safer integer handling** - All integer-type conversions are explicit casts. Developers can't accidentally cast during a function call when assigning to a variable, or when attempting to do arithmetic with other types. Overflow checking is on by default in Android for Rust, which requires overflow operations to be explicit.\n\nFor more information, see the series of blog posts on Android Rust support:\n\n- [Rust in the Android Platform](https://security.googleblog.com/2021/04/rust-in-android-platform.html) \n Provides an overview on why the Android team introduced Rust as a new platform language.\n- [Integrating Rust into the Android Open Source Project](https://security.googleblog.com/2021/05/integrating-rust-into-android-open.html) \n Discusses how Rust support has been introduced to the build system, and why certain design decisions were made.\n- [Rust/C++ interop in the Android Platform](https://security.googleblog.com/2021/06/rustc-interop-in-android-platform.html) \n Discusses the approach to Rust/C++ interoperability within Android."]]