Tại sao có một màn hình khi bạn có thể có năm? (tôi có ba...) Rust là vua ngày hôm nay - Và AI có thể giúp bạn học nó Rust được coi là vua của lập trình hệ thống hiện đại. Rust is acclaimed as the king of modern systems programming. It is not just challenging but also overpowering the long-standing dominance of C and C++. Nó đạt được điều này bằng cách cung cấp: The raw performance of C++ Guaranteeing comprehensive memory safety Providing compile-time concurrency safety Avoiding the majority of hackers’ loopholes, especially memory issues Providing the best package and configuration manager today in cargo . Hiệu suất thô của C++ Đảm bảo bảo mật bộ nhớ toàn diện Cung cấp bảo mật compile-time concurrency Tránh hầu hết các lỗ hổng của hacker, đặc biệt là các vấn đề về bộ nhớ Cung cấp quản lý gói và cấu hình tốt nhất hiện nay trong hàng hóa. Nghiên cứu của Stack Overflow đã vinh danh Rust là ngôn ngữ lập trình được yêu thích nhất trong 8 năm liên tiếp. Nghiên cứu của Stack Overflow đã vinh danh Rust là ngôn ngữ lập trình được yêu thích nhất trong 8 năm liên tiếp. Sự phổ biến chưa từng có này xuất phát từ thực tế là các nhà phát triển vượt qua đường cong học tập ban đầu của nó. Những người may mắn này thấy các tính năng và đảm bảo của Rust cả lợi thế và hiệu quả. Killer Features of Rust for Systems Programming Tính năng Killer của Rust for Systems Programming Rust đã chiếm toàn bộ ngành công nghiệp lập trình hệ thống. Đây là lý do. Memory Safety without a Garbage Collector: Bộ biên dịch của Rust đảm bảo an toàn bộ nhớ tĩnh This eliminates entire categories of common bugs like: null pointer dereferences buffer overflows dangling pointers. // This code, which would cause a dangling pointer in C++, won't even compile in Rust. fn get_dangling_reference() -> &String { let s = String::from("hello"); &s // Error: `s` does not live long enough } Zero-Cost Abstractions: Rust cho phép bạn viết mã cấp cao, biểu cảm bằng cách sử dụng: Abstractions like: Iterators Closures async/await map/reduce patterns first-class functions: Không bị trừng phạt hiệu suất runtime // This high-level iterator... let numbers = vec![1, 2, 3, 4, 5]; let sum_of_squares: i32 = numbers.iter().map(|&x| x * x).sum(); // ...compiles down to machine code as efficient as a manual C-style loop. Fearless Concurrency: The same ownership and type system that guarantees memory safety: Prevents data races at compile time! This makes it significantly easier and safer to write concurrent, multi-threaded programs. use std::thread; fn main() { let mut data = vec![1, 2, 3]; // This attempt to use the same mutable data from two threads is a compile-time error. // Rust forces you to use safe concurrency primitives like Arc and Mutex. // thread::spawn(|| { data.push(4); }); // Error: closure may outlive current function // thread::spawn(|| { data.push(5); }); // Error } Modern Tooling with Cargo: Cargo is Rust's integrated build system and package manager It is praised for its simplicity and power Cargo handles: project creation dependency management building testing And much more with simple commands. # Create a new project cargo new my_awesome_project # Add a dependency by adding one line to Cargo.toml # [dependencies] # serde = "1.0" # Build and run cargo run Ep Learning Đường cong Lời bài hát The Infamous Ste Lời bài hát The Infamous Ste Thì Các trở ngại chính cho người mới bắt đầu là trình biên dịch của Rust. The compiler is famously strict because: It must statically prove the correctness of your program's memory management It must prevent any errors in concurrency at compile time. It uses advanced algebraic structures to guarantee error-free concurrency. Bộ biên dịch nổi tiếng là nghiêm ngặt bởi vì: Nó phải chứng minh tĩnh tính chính xác của quản lý bộ nhớ của chương trình của bạn Nó phải ngăn chặn bất kỳ lỗi nào trong thời gian biên soạn. Nó sử dụng các cấu trúc algebraic tiên tiến để đảm bảo sự đồng bộ không có lỗi. Sự nghiêm ngặt này có nghĩa là mã có thể chạy (và sau đó va chạm) trong các ngôn ngữ khác thậm chí sẽ không biên dịch trong Rust cho đến khi nó đáp ứng các quy tắc bảo mật. The Borrow Checker and Ownership Rules Quản lý bộ nhớ của Rust được quản lý bởi một tập hợp các quy tắc mà trình biên dịch kiểm tra tại thời gian biên dịch. Hệ thống này được gọi là sở hữu. Rule 1: Each value in Rust has a single owner. Quy tắc 1: Mỗi giá trị trong Rust có một chủ sở hữu duy nhất. fn main() { // s is the owner of the String data "hello" allocated on the heap. let s = String::from("hello"); } Rule 2: There can only be one owner at a time. Quy tắc 2: Có thể chỉ có một chủ sở hữu tại một thời điểm. When a value is assigned to another variable, ownership is . moved fn main() { let s1 = String::from("hello"); let s2 = s1; // Ownership of the String data is moved from s1 to s2. // The line below will cause a compile-time error because s1 is no longer a valid owner. // println!("s1 is: {}", s1); // Error: value borrowed here after move } Rule 3: When the owner goes out of scope, the value is dropped. Quy tắc 3: Khi chủ sở hữu đi ra ngoài phạm vi, giá trị được giảm. Rust automatically calls a special drop function to free the memory. fn main() { { let s = String::from("I live only within these curly braces"); } // `s` goes out of scope here, and the memory is automatically freed. } Để truy cập dữ liệu mà không có quyền sở hữu, bạn có thể Nó . mượn Điều này được thực hiện bằng cách tạo một tham chiếu. Immutable Borrows: Các khoản vay bất động sản: Bạn có thể có nhiều tham chiếu không thay đổi (&T) cho một giá trị cùng một lúc. Đây là read-only access. fn main() { let s1 = String::from("hello"); let r1 = &s1; // Immutable borrow let r2 = &s1; // Another immutable borrow is fine println!("r1 = {}, r2 = {}", r1, r2); // This works perfectly. } Mutable Borrows: Bạn chỉ có thể có một tham chiếu biến (&mut T) cho một giá trị trong một phạm vi cụ thể. Điều này ngăn (Google để biết thêm) data races fn main() { let mut s1 = String::from("hello"); let r1 = &mut s1; // One mutable borrow // let r2 = &mut s1; // Error: cannot borrow `s1` as mutable more than once at a time r1.push_str(", world!"); println!("{}", r1); } You cannot have a mutable borrow while immutable borrows exist. fn main() { let mut s = String::from("hello"); let r1 = &s; // immutable borrow let r2 = &mut s; // Error: cannot borrow `s` as mutable because it is also borrowed as immutable // println!("{}, {}", r1, r2); } Các là phần của trình biên dịch Rust thực thi tất cả các quy tắc sở hữu và mượn này. borrow checker Các lập trình viên Rust mới bắt đầu thường dành một lượng thời gian đáng kể để "chiến đấu với người kiểm tra mượn". Beginner Rust programmers often spend a significant amount of time "fighting the borrow checker." Đó là bước nhảy vọt của mỗi học sinh. Nhưng với Gemini, lời giải thích có sẵn thông qua câu hỏi và câu trả lời tiếng Anh đơn giản. But with Gemini, explanations are available via simple English Q&A. Quá trình này liên quan đến việc học cách cấu trúc mã theo cách đáp ứng các đảm bảo an toàn của Rust. Cuộc đấu tranh ban đầu này, trong khi thất vọng, là những gì xây dựng sự hiểu biết cơ bản cần thiết để viết mã Rust an toàn và hiệu quả. Nó giống như có một người cố vấn nghiêm ngặt buộc bạn phải xây dựng thói quen tốt từ ngày đầu tiên. Other Arcane Rules That Make Rust Difficult Lifetimes: Đời sống : Lifetimes are the syntax Rust uses to tell the borrow checker how long references are valid. In many cases, the compiler can infer lifetimes, but sometimes, you must annotate them explicitly using an apostrophe syntax, like 'a. Lifetimes prevent dangling references, where a reference points to memory that has been deallocated. // We must explicitly tell the compiler that the returned reference (`&'a str`) // lives at least as long as the shortest-lived input reference (`'a`). fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { if x.len() > y.len() { x } else { y } } Traits: Tính cách : A trait tells the Rust compiler about functionality a type must provide. It's similar to an interface in languages like Java or C#. It enables incredibly powerful polymorphism capabilities. // Define a trait `Summary` pub trait Summary { fn summarize(&self) -> String; } // Implement the trait for the `Tweet` struct pub struct Tweet { pub username: String, pub content: String, } impl Summary for Tweet { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } } Generics: Các gen: Generics are abstract stand-ins for concrete types. They allow you to write flexible code that avoids duplication by operating on many different data types. // This function can take any type `T` that implements the `PartialOrd` and `Copy` traits. fn largest<T: PartialOrd + Copy>(list: &[T]) -> T { let mut largest = list[0]; for &item in list.iter() { if item > largest { largest = item; } } largest } Bây giờ, chúng ta có thể thấy AI đi vào hình ảnh như thế nào. Cần thiết lập bối cảnh trước! Now, we can see how AI comes into the picture. Needed to set the context first! Làm thế nào AI có thể hoạt động như một người hướng dẫn tự do rất đáng tin cậy Kỹ thuật nhanh tiên tiến ban đầu không cần thiết. However, mastering prompt engineering is vital in today’s world. Nhưng chúng tôi digress. Kỹ thuật nhanh tiên tiến ban đầu không cần thiết. Kỹ thuật nhanh tiên tiến ban đầu không cần thiết. However, mastering prompt engineering is vital in today’s world. But we digress. Để học Rust, bạn có thể nói bằng tiếng Anh tương tự với AI. For example: “Hãy dạy tôi những khái niệm cơ bản của Rust.” “Help me create a project in Rust.” “Help me install Rust in my Windows/Linux/Mac system.” “Write a program in Rust for …” “Please debug this Rust program (paste the program below).” le.” “Help me understand this <Rust concept> with an examp “Hãy giải thích khái niệm này với tôi như thể tôi đã mười tuổi.” “Explain the borrowing checker and ownership model to me as if I were a teenager.” “Explain this error message to me in simple terms and show me how to correct the code.“ “Hãy dạy tôi những khái niệm cơ bản của Rust.” “Help me create a project in Rust.” “Help me install Rust in my Windows/Linux/Mac system.” “Write a program in Rust for …” “Vui lòng gỡ lỗi chương trình Rust này (ghim chương trình bên dưới).” le.” “Help me understand this <Rust concept> with an examp “Hãy giải thích khái niệm này với tôi như thể tôi đã mười tuổi.” “Hãy giải thích cho tôi về người kiểm tra vay mượn và mô hình sở hữu như thể tôi là một thiếu niên.” “Hãy giải thích thông điệp lỗi này với tôi bằng các thuật ngữ đơn giản và chỉ cho tôi cách sửa mã.” It is so simple that children can do it and are doing it! Một trợ lý AI như Google Gemini trong Google AI Studio có thể hoạt động như: Thất bại Interactive Personalized điều chỉnh Custmizable mạnh mẽ dịu dàng bệnh nhân trẻ em Và một người hướng dẫn năng động vô hạn để học các khái niệm phức tạp của Rust. Thay vì chỉ đọc tài liệu: Bạn có thể có cuộc trò chuyện với AI. Bạn có thể yêu cầu nó giải thích lại hoặc cung cấp các ví dụ khác nhau. Cho đến khi một khái niệm click. Đây là một game-changer dành cho các nhà phát triển đã phải đi qua 900 trang sách giáo khoa. Một AI có thể lấy một lỗi biên dịch đáng sợ và dịch nó thành tiếng Anh đơn giản. Nó có thể giải thích lý do tại sao lỗi xảy ra và gợi ý nhiều cách để khắc phục nó. Đây là một siêu năng lực cho bất cứ ai học Rust trên nhiều cấp độ! Thay vì chỉ đọc tài liệu: Thay vì chỉ đọc tài liệu: You can have a conversation with the AI. Bạn có thể yêu cầu nó giải thích lại hoặc cung cấp các ví dụ khác nhau. Cho đến khi một khái niệm click. Bạn có thể có cuộc trò chuyện với AI. Bạn có thể yêu cầu nó giải thích lại hoặc cung cấp các ví dụ khác nhau. Cho đến khi một khái niệm click. This is a game-changer for developers who had to pore through 900-page textbooks. This is a game-changer for developers who had to pore through 900-page textbooks. An AI can take an intimidating compiler error and translate it into plain English. Một AI có thể lấy một lỗi biên dịch đáng sợ và dịch nó thành tiếng Anh đơn giản. It can explain why the error occurred and suggest multiple ways to fix it. Nó có thể giải thích lý do tại sao lỗi xảy ra và gợi ý nhiều cách để khắc phục nó. Đây là một siêu năng lực cho bất cứ ai học Rust trên nhiều cấp độ! Đây là một siêu năng lực cho bất cứ ai học Rust trên nhiều cấp độ! Bạn có thể sử dụng lộ trình sau để học Rust: https://roadmap.sh/rust?embedable=true Bạn có thể sử dụng AI (LLM) để hiểu mọi khái niệm mà bạn không hiểu. Mọi nghi ngờ, khái niệm và quá trình đầy thách thức đều có thể được giải thích với Google AI Studio. Thay đổi mô hình để tránh vượt quá giới hạn tỷ lệ (Gemini Flash hoặc Flash-Lite thay vì Gemini Pro). Bạn có thể sử dụng các mô hình LLM AI khác nếu bạn bỏ qua tất cả các giới hạn sử dụng miễn phí trong Google AI Studio: Một số trong những tốt nhất là: Claude: https://claude.ai/ ChatGPT : https://chatgpt.com/ Sự hoài nghi: https://www.perplexity.ai/ Tìm kiếm DeepSeek: https://chat.deepseek.com/ Grok: https://grok.com/ Mọi nghi ngờ, khái niệm và quá trình đầy thách thức đều có thể được giải thích với Google AI Studio. Mọi nghi ngờ, khái niệm và quá trình đầy thách thức có thể được giải thích bằng Google AI Studio. Google AI Studio. Thay đổi mô hình để tránh vượt quá giới hạn tỷ lệ (Gemini Flash hoặc Flash-Lite thay vì Gemini Pro). Switch models to avoid exceeding rate limits (Gemini Flash or Flash-Lite instead of Gemini Pro). You can use other AI LLM models if you run out of all free usage limits in Google AI Studio: Bạn có thể sử dụng các mô hình LLM AI khác nếu bạn bỏ qua tất cả các giới hạn sử dụng miễn phí trong Google AI Studio: Một số trong những tốt nhất là: Một số trong những tốt nhất là: bởi Claude: Claude: https://claude.ai/ https://claude.ai/ https://claude.ai/ ChatGPT : ChatGPT : https://chatgpt.com/ https://chatgpt.com/ https://chatgpt.com/ Sự hoài nghi: Perplexity: https://www.perplexity.ai/ https://www.perplexity.ai/ https://www.perplexity.ai/ Tìm kiếm DeepSeek: DeepSeek: https://chat.deepseek.com/ https://chat.deepseek.com/ https://chat.deepseek.com/ Gốc : Grok: https://grok.com/ https://grok.com/ https://grok.com/ I placed them in order of my use, and with so many other (Mistral, Qwen, Kimi) generative AI models available for free: Tôi đặt chúng theo thứ tự sử dụng của tôi, và với rất nhiều mô hình AI tạo ra khác (Mistral, Qwen, Kimi) có sẵn miễn phí: Bạn không cần phải trả tiền cho một đăng ký để học Rust với AI. Bạn không cần phải trả tiền cho một đăng ký để học Rust với AI. Thật là tuyệt vời. - Thật là tuyệt vời! How. Awesome. Is. That! Ví dụ // User pastes this code and the resulting error: fn main() { let mut v = vec![1, 2, 3]; let first = &v[0]; v.push(4); // Error: cannot borrow `v` as mutable... println!("The first element is: {}", first); } AI Explanation: Lỗi xảy ra bởi vì bạn có một tham chiếu không thay đổi 'đầu tiên' cho một yếu tố bên trong vector 'v'. Then, you try to call `v.push(4)`, which is a mutable operation. Việc đẩy một yếu tố có thể đòi hỏi vector phải phân bổ lại bộ nhớ của nó, điều này sẽ vô hiệu hóa tham chiếu "đầu tiên". Để khắc phục điều này, bạn nên đảm bảo tham chiếu không thay đổi 'đầu tiên' không còn được sử dụng trước khi bạn đột biến vector. Ví dụ, bạn có thể di chuyển `println!` trước khi `push`. Lỗi xảy ra bởi vì bạn có một tham chiếu không thay đổi 'đầu tiên' cho một yếu tố bên trong vector 'v'. Then, you try to call `v.push(4)`, which is a mutable operation. Việc đẩy một yếu tố có thể đòi hỏi vector phải phân bổ lại bộ nhớ của nó, điều này sẽ vô hiệu hóa tham chiếu "đầu tiên". Để khắc phục điều này, bạn nên đảm bảo tham chiếu không thay đổi 'đầu tiên' không còn được sử dụng trước khi bạn đột biến vector. Ví dụ, bạn có thể di chuyển `println!` trước khi `push`. Screen chia sẻ This is why I highlighted Google AI Studio over other tools. This is why I highlighted Google AI Studio over other tools. Hầu như không có công cụ AI nào khác mà tôi đã đề cập có tính năng này được phát triển tốt như Google Gemini vào thời điểm viết bài này. Gemini's potential screen-sharing capability could be a lifesaver for Rust debugging, especially in production. A learner could share their VS Code window: Highlight a block of code rejected by the borrow checker, And get a live, contextual explanation Along with refactoring suggestions A learner could share their VS Code window: Highlight a block of code rejected by the borrow checker, And get a live, contextual explanation Along with refactoring suggestions Nó có thể là cứu mạng của bạn trong các tình huống quan trọng, chẳng hạn như giải quyết sự cố máy chủ. Chia sẻ màn hình không phải là một tính năng trả tiền. Bạn có thể truy cập nó miễn phí với Google AI Studio. Có giới hạn mức giá cho phiên bản miễn phí, vì vậy hãy sử dụng với sự thận trọng. AI-Generated Code Và tất nhiên, một khi bạn tìm hiểu thêm về Rust, bạn có thể bắt đầu yêu cầu Gemini tạo mã cho bạn. Đảm bảo bạn hoàn toàn hiểu mã bạn tạo ra, đặc biệt là trong môi trường sản xuất. Ensure you thoroughly understand the code you generate, especially in production environments. Especially then! Ví dụ Người dùng nhanh: "Generate a basic web server in Rust using the Axum framework that responds with 'Hello, World!' at the root URL." use axum::{routing::get, Router}; use std::net::SocketAddr; async fn root() -> &'static str { "Hello, World!" } #[tokio::main] async fn main() { let app = Router::new().route("/", get(root)); let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); println!("listening on {}", addr); axum::Server::bind(&addr) .serve(app.into_make_service()) .await .unwrap(); } Lợi ích của Google Gemini AI như một giáo viên Experiences from other educational AI tools, like Khan Academy's tutor, show that AI can: Provide guided practice Answer silly repeated doubts Be tailored to your level Provide hints Be available at any time of the day Correct itself when fact-checked with the compiler. Add encouragement Provide multi-domain knowledge such as AWS, GCP, Azure, and others Screen sharing can anticipate the required correction Provide company-saving advice during site outages Applying this to Rust: An AI can create a personalized learning path. If you struggle with Lifetimes: It can generate a series of targeted exercises and code-reading challenges to strengthen that specific skill. Ditto for Ownership Rules And for Traits And for Third Party Libraries Documentation And any concept you do not understand Một AI xuất sắc trong việc giải thích mã phức tạp, thế giới thực mà sẽ là đe dọa cho những người Rustacean tham vọng. Ví dụ, bạn có thể xem xét lời giải thích dưới đây: An AI excels at explaining complex, real-world code that would be intimidating to aspiring Rustaceans. For example, you can examine the explanation below: Example: Foreign Function Interface (FFI) Giao diện chức năng nước ngoài (Foreign Function Interface - FFI) // Opaque C struct struct CComplexObject; // Functions imported from a C library extern "C" { fn c_complex_new() -> *mut CComplexObject; fn c_complex_process(obj: *mut CComplexObject, value: i32); fn c_complex_destroy(obj: *mut CComplexObject); } // Idiomatic and safe Rust wrapper struct SafeWrapper { obj: *mut CComplexObject, } impl SafeWrapper { fn new() -> Self { Self { obj: unsafe { c_complex_new() } } } fn process(&mut self, value: i32) { unsafe { c_complex_process(self.obj, value) }; } } impl Drop for SafeWrapper { fn drop(&mut self) { unsafe { c_complex_destroy(self.obj) }; } } AI Explanation: Ai giải thích: extern "C" tells Rust you are defining functions that follow the C Application Binary Interface (ABI), allowing Rust to link with C libraries. *mut CComplexObject is a raw pointer. It's unsafe because the Rust compiler cannot guarantee that what it points to is valid. The unsafe keyword is required to call these C functions or dereference raw pointers, as you are telling the compiler, "I have read the rules and I guarantee this operation is safe." The SafeWrapper struct is an idiomatic way to manage the raw pointer. It holds the pointer internally. By implementing the Drop trait, you ensure that the C object's memory is always cleaned up (c_complex_destroy) when the SafeWrapper goes out of scope, preventing memory leaks. This is a core Rust pattern called RAII (Resource Acquisition Is Initialization). extern "C" tells Rust you are defining functions that follow the C Application Binary Interface (ABI), allowing Rust to link with C libraries. *mut CComplexObject is a raw pointer. It's unsafe because the Rust compiler cannot guarantee that what it points to is valid. The unsafe keyword is required to call these C functions or dereference raw pointers, as you are telling the compiler, "I have read the rules and I guarantee this operation is safe." The SafeWrapper struct is an idiomatic way to manage the raw pointer. It holds the pointer internally. By implementing the Drop trait, you ensure that the C object's memory is always cleaned up (c_complex_destroy) when the SafeWrapper goes out of scope, preventing memory leaks. This is a core Rust pattern called RAII (Resource Acquisition Is Initialization). Giảm thiểu nguy cơ ảo giác Tất cả các LLM, bao gồm cả Gemini, đôi khi có thể ảo giác. Tất cả các LLM, bao gồm cả Gemini, đôi khi có thể ảo giác. Tất cả các LLM, bao gồm cả Gemini, đôi khi có thể ảo giác. Nhưng chúng tôi có một lợi thế: Rust compiler! The most powerful advantage of using AI to learn Rust is the feedback loop with the compiler. Bạn có thể đối xử với trình biên dịch như là nguồn cuối cùng của sự thật. Bạn có thể đối xử với trình biên dịch như là nguồn cuối cùng của sự thật. How to Check for AI Hallucinations: Làm thế nào để kiểm tra AI Hallucinations: Ask Gemini to write Rust code for a specific task. The AI generates the code. Paste this code directly into your local main.rs file or . the online Rust Playground Run cargo check. This command checks your code for errors without producing an executable. If the AI's code was incorrect (a "hallucination"): The Rust compiler (rustc) will almost certainly catch it. It will produce a high-quality, specific error message. You can then take this error message, feed it back to the AI, and ask: "The compiler gave me this error. Can you fix the code?" Ask Gemini to write Rust code for a specific task. The AI generates the code. Paste this code directly into your local main.rs file or . the online Rust Playground Run cargo check. This command checks your code for errors without producing an executable. If the AI's code was incorrect (a "hallucination"): The Rust compiler (rustc) will almost certainly catch it. It will produce a high-quality, specific error message. You can then take this error message, feed it back to the AI, and ask: "The compiler gave me this error. Can you fix the code?" Trò chơi Online Rust Playground Quá trình xác nhận đầu ra AI với trình biên dịch này là một công cụ học tập cực kỳ hiệu quả. Quá trình xác nhận đầu ra AI với trình biên dịch này là một công cụ học tập cực kỳ hiệu quả. Quá trình xác nhận đầu ra AI với trình biên dịch này là một công cụ học tập cực kỳ hiệu quả. AI khác và một số công cụ truyền thống để làm chủ Rust Several AI and non-AI tools help to assist your Rust learning journey. RustCoder Một công cụ miễn phí và mã nguồn mở được gọi là RustCoder đã được sử dụng hiệu quả như một nền tảng cho các công cụ mã hóa Vibe hiện đại như Cursor. Nó được đào tạo rộng rãi về mã Rust và có thể xử lý hầu hết các thách thức Rust tồn tại ngày nay. Nó thậm chí còn tạo ra mã “Rustic” (tôi đã tạo ra một thuật ngữ kỹ thuật mới chưa?) It even produces ‘Rustic’ code (did I just create a new technical term?). Nó mở cửa cho tất cả và miễn phí. Thêm chi tiết có sẵn bên dưới: https://www.cncf.io/blog/2025/01/10/rustcoder-ai-assisted-rust-learning/?embedable=true Ngôn ngữ lập trình Rust Online Documentation Hướng dẫn cuối cùng cho mọi thứ về Rust. Đây là một tài nguyên cổ điển không nên bỏ qua. Hiểu mã mà AI tạo ra sẽ dễ dàng hơn nhiều với tài nguyên trực tuyến miễn phí này. Understanding the code that AI produces will be much simpler with this free online resource. https://doc.rust-lang.org/stable/book/?embedable=true Các bài tập đồng hành - Rustlings Những bài tập này sẽ giúp bạn làm việc thông qua cuốn sách trực tuyến Rust một cách có hệ thống. Nếu bạn bị mắc kẹt, bạn có thể yêu cầu một AI cho câu trả lời! https://rustlings.rust-lang.org/?embedable=true Giá trị to lớn của việc học tập Rust hôm nay Rust ngày nay có nhu cầu rất lớn đối với lập trình hệ thống. Rust is in huge demand today for systems programming. Bảo mật thời gian biên dịch cho đồng thời đã thu hút sự chú ý của nhiều công ty có quy mô lên đến hàng tỷ người dùng. Có lẽ ngôn ngữ duy nhất có nhu cầu lớn hơn là Python cho tự động hóa và đại lý. Và Rust cũng đang bắt kịp trong không gian đại lý! Companies Pivoting to Rust Microsoft: Actively rewriting core Windows components, like parts of the kernel and the Win32 API, in Rust to reduce memory safety vulnerabilities. Amazon Web Services (AWS): Built Firecracker, the virtualization technology powering AWS Lambda and Fargate, entirely in Rust for security and speed. They also use it in parts of S3 and CloudFront. Google: Supports Rust for Android OS development and is funding efforts to write new Linux kernel modules in Rust, particularly for drivers, to improve kernel safety. Meta (Facebook): Rewrote their Mononoke source control server from C++ to Rust, citing performance and reliability improvements. They also use it heavily in their blockchain development. Apple: Apple is investing heavily in Rust for Robotics, AR/VR code, and Neural Engine processing. Hiring for Rust is at an all-time high. Cloudflare: Rust is used extensively across its product stack for performance-critical services, including its firewall, CDN, and Workers platform. Discord: Replaced a Go service with Rust to solve latency spikes in a real-time service, demonstrating Rust's superior performance for low-latency applications. Even today, many more companies are joining the bandwagon. Các nhà phát triển Rust có kỹ năng đang có nhu cầu cao. Skilled Rust developers are in high demand. Bước cơ bản quan trọng: Các dự án thực tế Bạn không thể học một ngôn ngữ chỉ bằng cách nghiên cứu các tính năng của nó. Bạn cần phải có được tay bẩn với các dự án thực sự. Bạn cần phải có được tay bẩn với các dự án thực sự. Bạn cần xây dựng các dự án chất lượng cao giải quyết các vấn đề kinh doanh thực sự. Và nếu có thể, mở nguồn cho họ và đạt được sự hấp dẫn của công chúng. Nếu bạn làm điều đó, các công ty sẽ đến với bạn thay vì bạn phải đến với họ! You need to build high-quality projects that solve real business problems. And if possible, open-source them and gain public traction. If you do that, companies will come to you instead of you having to go to them! Dự án GitHub này dưới đây là một hướng dẫn tuyệt vời cho các chi tiết lập trình hệ thống: https://github.com/codecrafters-io/build-your-own-x?embedable=true Thậm chí còn có các hướng dẫn tập trung vào Rust trong kho lưu trữ tuyệt vời này. There are even tutorials focused on Rust in this fantastic repository. Loại tuyển dụng nhập cảnh này là cơ hội tốt nhất bạn có thể nổi bật trong thị trường giết người ngày nay. Hàng ngàn sơ yếu lý lịch được tạo ra bởi AI đang tấn công các nhà tuyển dụng. This type of inbound recruitment is the best possible chance you have of standing out in today’s killer market. Thousands of AI-generated resumes are hitting recruiters. Một dự án mã nguồn mở mà các công ty đã áp dụng có thể là cửa sau của bạn vào MAANG! An open-source project that companies have adopted could be your back door into MAANG! Có rất nhiều lựa chọn có sẵn! Có rất nhiều lựa chọn có sẵn! Cuối cùng, khoảnh khắc quan trọng mà bạn đã chờ đợi! Quỹ đã được thiết lập vững chắc! Finally, the key moment you’ve been waiting for! The foundation has been firmly set! 15 ý tưởng dự án có thể đưa bạn vào MAANG Trí tuệ nhân tạo và Machine Learning A "Zero-Trust" Federated Learning Framework: Implement a secure multi-party computation (MPC) framework in Rust for training machine learning models on decentralized data. Provide a production-ready, performant, and memory-safe alternative to current Python-based frameworks, which often struggle with security and efficiency in real-world federated learning scenarios. High-Performance Inference Engine for Edge AI: Develop a lightweight, high-performance inference engine in Rust, optimized for resource-constrained edge devices. Create a runtime that is significantly faster and more memory-efficient than existing solutions like TensorFlow Lite, enabling complex AI models to run on a wider range of IoT devices and sensors. A Verifiable and Reproducible ML Pipeline Tool: Build a tool that ensures the entire machine learning pipeline, from data preprocessing to model training, is cryptographically verifiable and reproducible. Leverage Rust's performance to create a tool that can handle large-scale datasets and complex models, addressing the critical need for trust and auditability in AI systems. Blockchain and Web3 A Scalable and Interoperable Blockchain Sharding Implementation: Design and implement a novel sharding mechanism for a blockchain that addresses the trilemma of scalability, security, and decentralization. Create a Rust-based solution that is more performant and secure than existing sharding approaches, a major hurdle for mainstream blockchain adoption. A Privacy-Preserving Smart Contract Platform with Zero-Knowledge Proofs: Build a blockchain platform that allows for confidential smart contracts using zero-knowledge proofs. Create a developer-friendly platform in Rust that simplifies the creation of privacy-preserving decentralized applications (dApps), a significant gap in the current Web3 ecosystem. A High-Throughput, Cross-Chain Communication Protocol: Develop a secure and efficient protocol for interoperability between different blockchain networks. Build a Rust-based solution that is significantly faster and more reliable than existing bridge protocols, which are often bottlenecks and security risks in the Web3 space. Generative AI và Transformers An Optimized Inference Server for Large Language Models (LLMs): Create a highly optimized serving framework for LLMs that minimizes latency and maximizes throughput. Leverage Rust's concurrency and low-level control to build a server that can handle massive-scale inference for generative AI applications, a major operational challenge for companies deploying these models. A Memory-Efficient Transformer Architecture: Implement a novel Transformer architecture in Rust that significantly reduces the memory footprint during training and inference. Address the quadratic complexity of the self-attention mechanism, a major bottleneck for working with long sequences, making large models more accessible and cost-effective to train and deploy A Framework for Fine-Tuning and Deploying Generative AI Models with Strong Security Guarantees: Develop a framework that focuses on the secure fine-tuning and deployment of generative AI models, addressing concerns like data privacy and model inversion attacks. Provide a Rust-based solution that integrates privacy-enhancing technologies directly into the MLOps lifecycle for generative AI. Số lượng máy tính A High-Performance Quantum Circuit Simulator: Build a quantum circuit simulator in Rust that can handle a larger number of qubits and more complex quantum algorithms than existing simulators. Leverage Rust's performance and memory management to push the boundaries of classical simulation of quantum computers, a critical tool for quantum algorithm development. A Post-Quantum Cryptography Library for Secure Communication: Develop a comprehensive and easy-to-use library for post-quantum cryptography algorithms. Provide a production-ready Rust library that is highly performant and resistant to attacks from both classical and quantum computers, a critical need as the threat of quantum computing to current encryption standards grows. A Compiler for a High-Level Quantum Programming Language: Create a compiler that translates a high-level, expressive quantum programming language into low-level quantum assembly code. Build this compiler in Rust to ensure its correctness and performance, enabling developers to write complex quantum algorithms more easily and with greater confidence. DevOps và MLOps A Blazing-Fast, Cross-Platform Build and Deployment Tool: Develop a next-generation build and deployment tool in Rust that is significantly faster and more efficient than current solutions like Jenkins or Travis CI. Create a tool with a minimal footprint and first-class support for containerization and modern cloud-native environments, addressing the need for faster and more reliable CI/CD pipelines. A Secure and Observable Microservices Framework: Build a microservices framework in Rust that prioritizes security and observability from the ground up. Provide a framework with built-in features for service-to-service authentication, authorization, and detailed telemetry, addressing the growing complexity and security challenges of microservices architectures. An MLOps Platform for Rust-Based Models: Create an MLOps platform specifically designed for the lifecycle management of machine learning models written in Rust. Provide a seamless workflow for training, deploying, monitoring, and retraining Rust-based models, filling a gap in the current MLOps tooling which is heavily focused on Python. Đây là quá phức tạp! Tôi là một người mới bắt đầu! (AI để cứu hộ) Hãy nhớ, đây là con đường của bạn đến một công ty MAANG. Và AI đang ở đây để giúp bạn! Remember, this is your pathway to a MAANG company. And AI is here to help you! Đối với một người mới bắt đầu, giải quyết một dự án lớn, phức tạp là một cuộc chạy marathon, không phải là một cuộc chạy sprint. Trợ lý AI như Google AI Studio có thể đóng vai trò là người hướng dẫn cá nhân và đối tác lập trình của bạn. Hợp tác mã nguồn mở cung cấp cho cộng đồng và hỗ trợ để xem nó thông qua. Open-source collaboration provides the community and support to see it through. Quá trình suy nghĩ logic của bạn (Baby Steps) : Understand the Core Problem Before writing a single line of code, use AI to explain the project's domain. Ask it, "Explain federated learning in simple terms". Or, "What is the blockchain scalability trilemma?" : Break It Down Ask your AI assistant, "I want to build a quantum circuit simulator in Rust. What are the main components I need to build Break this down into smaller, manageable tasks." : Generate the Skeleton For a small task like "create a struct for a blockchain block," ask the AI to generate the initial Rust code. This gives you a starting point to build upon. : Code, Test, Refine, Repeat Write your code for one small part. If you hit an error, paste the code and the error message into the AI assistant and ask for help debugging. : Go Public Immediately Create a project on a platform like GitHub from day one. This signals your intent to collaborate and makes it easier for others to join. : Document Your Journey Use the AI to help you write a clear README.md file explaining your project's goal and how others can help. A good project description is critical for attracting collaborators. Làm thế nào AI trợ lý giúp : Ask for simple explanations of complex topics like "What is a zero-knowledge proof?" Concept Explanation : Generate boilerplate code, functions, and data structures to get you started. Code Generation : Paste your broken code and the error message to get suggestions for a fix. Debugging : Ask the AI to generate comments for your functions or to write a project README.md file. Writing Documentation : Use it as an interactive tutor that can answer your specific questions as they arise. Learning Sức mạnh của Open Source Mỗi dự án bạn xây dựng nên là mã nguồn mở. Bạn không cần phải là một chuyên gia tuyệt vời; bạn chỉ cần một ý tưởng và sẵn sàng hợp tác. Every project you build should be open-source. You don't need to be a fantastic expert; you just need an idea and the willingness to collaborate. Tải công việc chia sẻ: Bạn không cần phải tự xây dựng tất cả. Học hỏi từ những người khác: Xem lại mã từ những người đóng góp là một cách mạnh mẽ để học hỏi. Nhận phản hồi: Hơn mắt vào mã của bạn có nghĩa là chất lượng tốt hơn và tìm lỗi nhanh hơn. Xây dựng mạng lưới: Kết nối với các nhà phát triển khác có thể trở thành cố vấn hoặc đồng nghiệp trong tương lai. Các bước quan trọng đầu tiên cho người mới bắt đầu : Learn Rust Fundamentals Before starting a big project, complete a basic course. You can't use an AI assistant effectively without understanding the basics of the language. Make sure you understand Git: Git is fundamental. You should be familiar with the basics of Git and GitHub. : Choose a Single Project Pick the idea that excites you the most and stick with it. Focus is an underrated superpower. : Create a Public Repository Use GitHub to host your project. Blog about your product on Medium or HackerNoon. : Define a Clear Goal Write a one-paragraph description of what your project aims to achieve. Use AI if necessary, but make sure you understand everything you are talking about. AI can help you in that, too! : Find "Good First Issues" Look for beginner-friendly tasks in other open-source projects to get a feel for the contribution process. This gives you credibility and experience. Also, actual open source contributions are a dopamine hit! : Actively Seek Collaborators Share your project on platforms like the /r/rust subreddit or Discord communities. Create awareness about your project online with HashNode and LinkedIn as well. Tài nguyên học tập Tất cả các nguồn tài nguyên dưới đây có thể giúp bạn trên con đường của bạn để trở thành một Rustacean lành nghề: All of the resources below can help you on your path to becoming a skilled Rustacean: Comprehensive Rust (bởi Google) https://google.github.io/comprehensive-rust/?embedable=true Hướng dẫn sử dụng Linfa (ML Library) https://rust-ml.github.io/linfa/?embedable=true Xây dựng Blockchain trong Rust Tutorial https://blog.logrocket.com/how-to-build-a-blockchain-in-rust/?embedable=true Ứng dụng Command-Line trong Rust https://rust-cli.github.io/book/?embedable=true Sử dụng Perplexity.ai cho các nguồn lực để tìm hiểu về bất cứ điều gì! Đừng sử dụng Google; Sự nhầm lẫn là tốt hơn cho mọi thứ bao gồm mã! Blockchain, AI Agents và Generative AI hiện đang là các ứng dụng giết người cho Rust! Blockchain đặc biệt là rất có lợi nhuận! Sử dụng Perplexity.ai cho các nguồn lực để tìm hiểu về bất cứ điều gì! Sử dụng Đối với các nguồn lực để học về bất cứ điều gì! Nghiêm túc.ai Nghiêm túc.ai Đừng sử dụng Google; Sự nhầm lẫn là tốt hơn cho mọi thứ bao gồm mã! Đừng sử dụng Google; Sự nhầm lẫn là tốt hơn cho mọi thứ bao gồm mã! Blockchain, AI Agents, and Generative AI are currently killer applications for Rust! Blockchain in particular is highly lucrative! Kết luận Rust đứng như một trong những ngôn ngữ mạnh mẽ nhất nhưng đầy thách thức để học ngày nay. Nó có một phác thảo và một tập hợp các quy tắc không giống như bất kỳ ngôn ngữ chính thống nào khác. Đường cong học tập dốc này có thể được làm phẳng đáng kể bằng cách tận dụng các công cụ AI như Google AI Studio làm người hướng dẫn. Các tích hợp như chia sẻ màn hình sẽ làm cho việc gỡ lỗi các vấn đề sở hữu phức tạp trở thành một quá trình được hướng dẫn, thảo luận. Rust là tương lai chắc chắn của lập trình hệ thống an toàn và hiệu suất, và việc áp dụng nó bởi mỗi công ty công nghệ lớn chứng minh giá trị của nó. Sự thiếu hụt các nhà phát triển Rust chất lượng cao hiện nay, kết hợp với nhu cầu ngày càng tăng, làm cho việc học Rust trở thành một khoản đầu tư nghề nghiệp vô giá. Vì vậy, chưa bao giờ có thời điểm thích hợp hơn để bắt đầu hành trình của bạn với Rust. Với AI như là hướng dẫn của bạn, con đường là dễ dàng hơn bao giờ hết. Rust stands as one of the most powerful but challenging languages to learn today. It has a syntax and a set of rules unlike any other mainstream language. This steep learning curve can be flattened significantly by leveraging AI tools like Google AI Studio as a tutor. Integrations like screen sharing will make debugging complex ownership issues a guided, conversational process. Rust is the definitive future of secure and performant systems programming, and its adoption by every major tech company proves its value. The current shortage of high-quality Rust developers, combined with the growing demand, makes learning Rust an invaluable career investment. Therefore, there has never been a more opportune moment to begin your journey with Rust. Với AI như là hướng dẫn của bạn, con đường là dễ dàng hơn bao giờ hết. Với AI như là hướng dẫn của bạn, con đường là dễ dàng hơn bao giờ hết. I found the article below remarkably helpful for effectively preparing for a successful Rust career: https://medium.com/@CodeOps/i-spent-2-years-learning-rust-and-still-got-rejected-856b3f914520?embedable=true Xin hãy dành một khoảnh khắc để đọc nó; bạn có thể tiết kiệm cho mình hai năm chuẩn bị kết thúc tồi tệ. Xin hãy dành một khoảnh khắc để đọc nó; bạn có thể tiết kiệm cho mình hai năm chuẩn bị kết thúc tồi tệ. Chúc bạn tốt nhất, và làm theo lời khuyên trong bài viết trên nếu bạn đang chuẩn bị cho một sự nghiệp phát triển Rust! Chúc bạn tốt nhất, và làm theo lời khuyên trong bài viết trên nếu bạn đang chuẩn bị cho một sự nghiệp phát triển Rust! Chúc bạn tốt nhất, và làm theo lời khuyên trong bài viết trên nếu bạn đang chuẩn bị cho một sự nghiệp phát triển Rust! References Stack Overflow. (2023). 2023 Developer Survey. https://survey.stackoverflow.co/2023/#most-loved-dreaded-and-wanted-language-love-dread Khan Academy. (2023). Harnessing AI for education. https://www.khanmigo.ai/ The Rust Language Revolution: Why Are Companies Migrating? https://stefanini.com/en/insights/news/the-rust-language-technology-revolution-why-are-companies-migrating 2022 Review | The adoption of Rust in Business https://rustmagazine.org/issue-1/2022-review-the-adoption-of-rust-in-business Rust in 2025: Why Meta, Google, and Apple Are All In | Rustaceans https://medium.com/rustaceans/why-meta-google-and-apple-are-secretly-betting-on-rust-in-2025 Microsoft joins Rust Foundation - Microsoft Open Source Blog https://opensource.microsoft.com/blog/2021/02/08/microsoft-joins-rust-foundation Google Adopts Rust for Android: A Game-Changer for Mobile OS Security & Performance https://coinsbench.com/googles-rust-adoption-in-android-a-game-changer-for-mobile-os-development Amazon Web Services. (2020). Why AWS loves Rust. https://aws.amazon.com/blogs/opensource/why-aws-loves-rust-and-how-wed-like-to-help/ Discord Blog. (2020). Why Discord is switching from Go to Rust. https://discord.com/blog/why-discord-is-switching-from-go-to-rust General Rust Learning The Rust Programming Language ("The Book") https://doc.rust-lang.org/book Rustlings Exercises https://github.com/rust-lang/rustlings Comprehensive Rust (by Google) https://google.github.io/comprehensive-rust/ 11. AI/ML in Rust Linfa (A scikit-learn-like ML Framework) https://github.com/rust-ml/linfa https://rust-ml.github.io/linfa/ Tutorial: Build a Machine Learning Model in Rust https://www.freecodecamp.org/news/how-to-build-a-machine-learning-model-in-rust/ 12. Blockchain & Web3 in Rust Tutorial: Building a Blockchain in Rust https://blog.logrocket.com/how-to-build-a-blockchain-in-rust/ https://dev.to/iamzubin/how-to-build-a-blockchain-from-scratch-in-rust-38d6 13. Generative AI in Rust Hugging Face Candle (A minimalist ML framework) https://github.com/huggingface/candle 14. Quantum Computing in Rust Qiskit Rust (IBM's Quantum Framework Bindings) https://github.com/Qiskit/qiskit-rust 15. DevOps in Rust Book: Command-Line Applications in Rust https://rust-cli.github.io/book/ https://survey.stackoverflow.co/2023/#most-loved-dreaded-and-wanted-language-love-dread https://www.khanmigo.ai/ https://stefanini.com/en/insights/news/the-rust-language-technology-revolution-why-are-companies-migrating https://rustmagazine.org/issue-1/2022-review-the-adoption-of-rust-in-business https://medium.com/rustaceans/why-meta-google-and-apple-are-secretly-betting-on-rust-in-2025 https://opensource.microsoft.com/blog/2021/02/08/microsoft-joins-rust-foundation https://coinsbench.com/googles-rust-adoption-in-android-a-game-changer-for-mobile-os-development https://aws.amazon.com/blogs/opensource/why-aws-loves-rust-and-how-wed-like-to-help/ https://discord.com/blog/why-discord-is-switching-from-go-to-rust https://doc.rust-lang.org/book https://github.com/rust-lang/rustlings https://google.github.io/comprehensive-rust/ https://github.com/rust-ml/linfa https://rust-ml.github.io/linfa/ https://www.freecodecamp.org/news/how-to-build-a-machine-learning-model-in-rust/ https://blog.logrocket.com/how-to-build-a-blockchain-in-rust/ https://dev.to/iamzubin/how-to-build-a-blockchain-from-scratch-in-rust-38d6 https://github.com/huggingface/candle https://github.com/Qiskit/qiskit-rust https://rust-cli.github.io/book/ Google AI Studio đã được sử dụng trong bài viết này cho ý tưởng, phác thảo, mã và nghiên cứu. https://aistudio.google.com/ Google AI Studio was used in this article for ideation, outlining, code, and research. You can access it here: https://aistudio.google.com/ https://aistudio.google.com/ Tất cả các hình ảnh được tạo bởi tác giả bằng cách sử dụng NightCafe Studio, có sẵn tại đây:https://creator.nightcafe.studio/explore All images were generated by the author using NightCafe Studio, available here: https://creator.nightcafe.studio/explore https://creator.nightcafe.studio/explore