I’ve recently been working on getting Rust support in the boot.dev app. In order to write a more engaging course, I want students to be able to write and execute code right in the browser. As I’ve learned from my previous posts on this topic, the easiest way to sandbox code execution on a server is to not execute code on a server. Enter Web Assembly, stage left. Deprecation Disclaimer! This recently stopped working due to the io::set_print function being completely deprecated.
Rust and Go are two of the industry’s biggest successes when it comes to developing modern programming languages. Both languages compete in terms of backend web development, and it’s a fierce competition. Golang and Rust are new languages, have growing communities, and are fast and efficient. When it comes to microservice architectures, frameworks, and apps, Rust and Go are household names on the backend. Similarities Rich Standard Libraries Rust and Go share many traits, especially when it comes to web development.
Loops in Rust aren’t the same as standard C-style languages. The syntax is different and there are some powerful options that make looping easier. First, let’s go over some looping basics, then we will cover how to handle breaking and continuing in nested loops in Rust. Standard For-Loop fn main() { for x in 0..10 { println!("{}", x); } } Which prints: 0 1 2 3 4 5 6 7 8 9 0.
Let’s take a look at some of the common pitfalls with the keywords let and mut. Then, we will learn how immutable != constant by using variable shadowing. Getting started with Rust can be daunting. Rust is well-known for being a safe language. One of the ways in which Rust is safe is through type-safety. Rust is strongly typed and defaults to immutable values. The “let” Keyword The simplest way to create a new variable in Rust is by using the “let” keyword:
One of the primary goals of the Go programming language is to make concurrency simpler, faster, and more efficient. With Rust growing in popularity let’s see how its concurrency mechanisms stack up against Go’s. A Refresher On Goroutines In Go, concurrency is accomplished by spawning new goroutines: package main import ( "fmt" "time" ) func main() { go func() { for { fmt.Println("one second passed") time.Sleep(time.Second) } }() fmt.Println("waiting 10 secs for goroutine") time.
Go and Rust are two of the hottest compiled programming languages, but which is more popular, Go or Rust?. I develop in Go full-time and love it, and I’m learning more about Rust recently - it’s an exciting language. Let’s explore some differences between the two and look at which is growing faster in the popularity polls. Popularity Stats According to the StackOverflow 2019 surveys, Go is ahead in the polls when it comes to programming and markup languages.