rust

The Mars Rover Challenge in Rust: Houston, Do You Copy?

The Mars Rover Challenge in Rust: Houston, Do You Copy?

Our rover navigation system is ready for its maiden voyage, but first, it needs to know where to go! The mission parameters have provided specific test scenarios to validate our implementation. My rover needs to interpret these commands: 5 5 1 2 N LMLMLMLMM 3 3 E MMRMMRMRRM Enter fullscreen mode Exit fullscreen mode And respond with precise positional data: 1 3 N 5 1 E Enter fullscreen mode Exit fullscreen mode Establishing Communication: Receiving User Input My first challenge was creating a communication channel with Mission Control. I turned to Rust's powerful std::io module to establish this vital link:…
Read More
Implementing Webpack from Scratch, But in Rust – [3] Using NAPI-RS to Create Node.js Addons

Implementing Webpack from Scratch, But in Rust – [3] Using NAPI-RS to Create Node.js Addons

Referencing mini-webpack, I implemented a simple webpack from scratch using Rust. This allowed me to gain a deeper understanding of webpack and also improve my Rust skills. It's a win-win situation! Code repository: https://github.com/ParadeTo/rs-webpack This article corresponds to the Pull Request: https://github.com/ParadeTo/rs-webpack/pull/4 The title seems unrelated to this series, as implementing webpack with Rust involves Node.js plugin development. But don't worry, let me explain. When we use webpack for bundling, don't we often run the following command? webpack --config webpack.config.js Enter fullscreen mode Exit fullscreen mode Similarly, we want our RS Webpack to support such a command. But how can…
Read More
Playing with Rust: Building a Safer rm and Having Fun Along the Way

Playing with Rust: Building a Safer rm and Having Fun Along the Way

Welcome to my YOLO series, where I'll be showcasing simple tools and projects that I've built—sometimes for fun, sometimes to solve specific problems, and other times just out of pure curiosity. The goal here isn't just to present a tool; I'll also dive into something interesting related to the process, whether it's a technical insight or a lesson learned while crafting these little experiments. Introducing rrm: The Command-Line Tool Nobody Asked For Nobody asked for it, and nobody want it—but here it is anyway. Meet rrm, a tool that solves a problem only I seem to have (but hey, it…
Read More
What are targets for in Rust?

What are targets for in Rust?

In Rust, targets refer to specific configurations that determine how your code is compiled and executed. Targets specify the platform or architecture for which Rust should compile the code. Types of Targets in Rust: Binary Targets (Binaries): These are executable programs that your project can build. In your Cargo.toml, you can define multiple binary targets. By default, if your project has a main.rs, Cargo will treat it as a binary target. You can also create additional binaries by placing other *.rs files in a src/bin/ directory. Library Targets: This is when you're building a library instead of an executable program.…
Read More
Survey: C to Rust conversion and corresponding tools

Survey: C to Rust conversion and corresponding tools

Hello all, We are performing an anonymous survey to understand developers' perspectives on C to Rust conversion and corresponding tools. You can take the survey at: Survey Link The survey will be taken once and will take approximately 7 minutes to complete. No personal identifying information will be collected. The information you will share with us if you participate in this study will be kept completely confidential to the full extent of the law. The study is reviewed by our IRB under: IRB 2024-1170. If you have any questions about this research, please contact Aravind Machiry at amachiry@purdue.edu. If you…
Read More
Qopy: My Favorite Clipboard Manager as a Developer

Qopy: My Favorite Clipboard Manager as a Developer

As a developer, I'm always on the lookout for tools that can make my workflow smoother and more efficient. Recently, I stumbled upon Qopy, an open-source clipboard manager that works on Linux and Windows. What's Qopy? Qopy is a straightforward clipboard manager that aims to improve upon the standard clipboard experience. It's designed to be user-friendly, reliable and fast. Why Is it so good Here are some reasons why Qopy is so good: It handles everything: Text, images, files: Qopy can store it all. It's fast: Built with Rust, it's super speedy and doesn't slow you down. Easy to use:…
Read More
Implement React v18 from Scratch Using WASM and Rust – [24] Suspense(1) – Render Fallback

Implement React v18 from Scratch Using WASM and Rust – [24] Suspense(1) – Render Fallback

Based on big-react,I am going to implement React v18 core features from scratch using WASM and Rust. Code Repository:https://github.com/ParadeTo/big-react-wasm The tag related to this article:v24 Suspense is undoubtedly one of the most appealing features in the new version of React, so let's implement it ourselves. This article is the first part, focusing on implementing the Fallback rendering of Suspense. Consider the following code as an example: import { Suspense } from 'react'; export default function App() { return ( <Suspense fallback={<div>loading</div>}> <Child /> </Suspense> ); } function Child() { throw new Promise((resolve) => setTimeout(resolve, 1000)); } Enter fullscreen mode Exit…
Read More
Borrowing and References in Rust Explained

Borrowing and References in Rust Explained

To understand references in Rust, it will be beneficial to have knowledge on how the ownership system in Rust works. Recap on Rust Ownership Model Rust has an ownership system where only one variable can lead to a specific piece of data in the memory. The variable is called the owner of the data. The data can be stored either on the stack or the heap. Variables that have a fixed size, like integers, float, or booleans are stored on the stack, while variables that can grow or change in size are stored on the heap. Here, x is a…
Read More
3 Common Mistakes Beginners Make When Learning Rust

3 Common Mistakes Beginners Make When Learning Rust

In 2024, the Stack Overflow Developer Survey voted Rust the most admired language. Rust's unique combination of performance, safety, and ergonomics has made it a popular choice for systems programming, web development, blockchain, and more. However, as with any powerful tool, getting the most out of Rust requires a solid understanding of its fundamentals. In this article, I want to share three common mistakes beginners often make when learning Rust and practical solutions to help you avoid them. All the code is available and open source here: https://github.com/FrancescoXX/three-rust-mistakes Let's get started! 1. Confusion Around the let Keyword If you're from…
Read More
Lifetimes in Rust explained

Lifetimes in Rust explained

I want to discuss a fundamental concept you must grasp to master the Rust programming language: “Lifetimes.” Usually, when we learn about a programming language, we reference other languages, like “it works like in JavaScript,” “it’s similar to Python,” and so on. We can’t make this analogy in this case because “Lifetimes” are peculiar to the Rust programming language. Lifetimes in Rust ensure that references are valid as long as they are used, preventing common bugs like dangling pointers and use-after-free errors. This article explores lifetimes, their significance, and how to work with them through examples. If you prefer a…
Read More
No widgets found. Go to Widget page and add the widget in Offcanvas Sidebar Widget Area.