Rahul  Gandhi

Rahul Gandhi


Asynchronous Programming in Rust

Asynchronous programming greatly improves our development with faster and more responsive code. Learn about how async works in Rust and when you should use it.

Asynchronous programming is a form of parallel programming that allows a unit of work to run separately from the primary application thread and then proceeds to notify the main thread if said work was executed successfully or not. The benefits of asynchronous code cannot be overemphasized. From better performance to enhanced responsiveness, asynchronous programming has in many ways improved the way we write code and consequently its quality.

Why Async?

We all love how Rust allows us to write fast, safe software, so it’s easy to see why one might ask the point of bothering with async programming in Rust. A simple answer is: it allows us to run multiple tasks concurrently on the same OS thread. For example, a typical way to download two different webpages in a threaded application would be to spread the work across two different threads like this:

fn main() {
  fn get_two_sites() {
     // Spawn two threads to do work.
      let thread_one = thread::spawn(|| download("https://www.jellof.com"));
      let thread_two = thread::spawn(|| download("https://www.yam.com"));

      // Wait for both threads to complete.
      thread_one.join().expect("thread one panicked");
      thread_two.join().expect("thread two panicked");

#rust #web-development

What is GEEK

Buddha Community

Asynchronous Programming in Rust
Alayna  Rippin

Alayna Rippin


OS in Rust: An executable that runs on bare metal

This is the very first blog of the series that pertains to create a basic Operating System using Rust Programming Language.

The aim of this series is to learn and understand the basics of Operating System. Through this series, you will get some ideas about the internal components of Operating System and how they interact with each other.

In this article, we will create a freestanding binary (an executable) that has the capability to run on bare metal. To create that executable we need to follow certain steps:

Steps to create a bare-metal executable:

  • Disable standard library
  • Define custom panic handler
  • Provide language items
  • Provide entry point
  • Build executable

#functional programming #rust #rust programming language #system programming

Skyla  Feeney

Skyla Feeney


Dart asynchronous programming: Streams

This article covers one of the fundamentals of reactive programming: streams, which are objects of type [Stream](https://api.dart.dev/stable/dart-async/Stream-class.html).

If you’ve read the previous article on futures, you might remember that each future represents a single value (either an error or data) that it delivers asynchronously. Streams work similarly, but instead of a single thing, **a stream can deliver zero or more values and errors **over time.

This article is the third one based on the Flutter in Focus video series Asynchronous Programming in Dart. The first article, Isolates and event loops, covered the foundations of Dart’s support for background work. The second one, Futures, discussed the _Future_ class.

If you think about the way a single value relates to an iterator of the same type, that’s how a future relates to a stream.

Image for post

#dartlang #flutter #programming #asynchronous-programming #programming-languages

RUST on programming language

The title is a bit confusing to understand the context of the content. In this blog, I am going to run around and see the different aspects of programming language rust. And talk about the concepts that it introduces that are useful for various aspects of programming.

What is Rust?

Simply putting it is a statically as well as strongly typed programming language.

Let me explain:

_statically typed _indicates that all the datatypes that are expressed in the code are known at compile time and memory allocation is done properly.

Image for post

Then what is 👆 that? Let’s just say rust knows what you want to say.

But this doesn’t mean you could declare variables for a complex data type and expect rust to understand. Here comes the next point I mentioned above.

_strongly typed _indicates that the types are designed to make it harder to write syntatically incorrect code.

If you were to do even a little mistake with the syntax or definition of variables then the errors are caught at compile time. Not just the syntax errors but there are various tests build in the compiler to check for unused variablesdead code(Code that will never run), infinite loops as well as the lifetime of variables.

#security #programming #programming-languages #rust

Trycia  Hintz

Trycia Hintz


Learning Rust Together! Going through the Rust Programming book!

First episode in a series where we dive into The Rust Programming language! We are following a book of the same name (sometimes called “The Book”) which can be found here https://doc.rust-lang.org/book/title-page.html.

This episode goes through chapters 1 & 2. We build a Guessing game app and learn some of the language basics!

– Watch live on Tuesday nights from 9pm - 11pm Eastern at https://twitch.tv/tommcgurl

#rust #rust programming

Malvina  O'Hara

Malvina O'Hara


Rust Casting, Shadowing, Consts and Static

A mix of topics of casting, shadowing, constants and static variables inside the Rust Programming Language.

This Rust programming language tutorial series is aimed at easing your training step by step. Rust is a systems level language aimed at speed and safety and can be run cross-platform, including embedded systems and even the browser with WebAssembly (WASM)!

#rust #rust casting #rust programming