Cody  Lindgren

Cody Lindgren

1626683100

Character data type in Rust || Char || Rust Programming

In this video we will study about character or char data type in Rust. These are Unicode values and 4 Bytes in length.

#Rust #char #rustlang #cargo

#rust #character #rustlang

Character data type in Rust || Char || Rust Programming

I made a Voxel Engine with Rust (NO GAME ENGINE)

Time to LEVEL UP my graphics programming skills by making a Voxel Engine from scratch using the Rust programming language.

I’ve been considering remaking my Unity voxel rpg game using Rust, this is my first test to see if I’m capable of doing a 3D voxel rendering application.
I managed to implement voxel rendering, chunk management, flying camera and simple lightning. Future plans is to optimize the code, I have not done any benchmarks, but it does need some speed improvements.

This was made using wgpu-rs which is a wrapper over OpenGL, DirectX, Vulkan, Metal or WebGPU.

The voxel project is open source here!
https://github.com/TanTanDev/first_voxel_engine

Want to support me?
XMR:
43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur

Resources:
Graphics rendering api:
https://wgpu.rs/

The tutorial I followed to learn wgpu:
https://sotrh.github.io/learn-wgpu/

Relevant resources that may help when learning how to make a voxel engine:
https://sites.google.com/site/letsmakeavoxelengine/

A note on these videos, I think they do a great job in showing the realities of making a voxel engine, and at the same time providing good information on how it works.

Voxel Game Mesh Optimizations by @Hopson
https://youtu.be/VQuN1RMEr1c

I Made Minecraft in 24 Hours by @Sam Hogan
https://youtu.be/Nj8gt_92c-M

Making Minecraft from scratch in 48 hours (NO GAME ENGINE) by @jdh
https://youtu.be/4O0_-1NaWnY

The voxel game I was talking about that I’m considering remaking:
Adding Flying to my Voxel Game: https://youtu.be/6eLDNrnshhg

#rust #rustlang

I made a Voxel Engine with Rust (NO GAME ENGINE)
Cody  Lindgren

Cody Lindgren

1626288780

Rust Crash Course - Mutability

Mutability of Variables in Rust

#Rust #mutability #rustlang #cargo

#rust #mutability #rustlang #cargo

Rust Crash Course - Mutability

1 Year of Rust Game Development

I talk about why I used the Rust programming language for a whole year!
It has become my favorite programming language, especially to make games with.

I showcase my projects, then talk about some of the things I love about Rust.
The community, awesome libraries, the rust enum, and more

#gamedev #rustlang

#gamedev #rustlang #rust

1 Year of Rust Game Development

Rustlang vs C++: Which Language Should You Learn in 2021?

Rustlang VS C++: Which Language Should You Learn in 2021? | Rust Language vs C++ | Learn to Code

A StackOverFlow survey has Rust well ahead of C++ as the most loved programming language, sitting at the number 1 spot with 78.9% preferred, with the later sitting in 22nd spot at 46.7%.

It’s somewhat related to C++ in terms of syntax and functions, but the similarities end there.

Rustlang solves issues like memory errors and concurrency that C++ has been struggling with for almost 2 decades. The compiler can be a little brutal, but does offer much better memory safety and better data ownership relationships to make concurrency easier to prevent a data race. It does this without the use of garbage collection, and at the speed of a rocket ship.

It’s an open-source language developed by Mozilla, so naturally Rust can be found in this internet browser, but it has a wide range of applications including developing game engines, building operating systems and smart file storage, and even simulation generators used for virtual reality headsets.

SUBSCRIBE to Kofi Group:https://www.youtube.com/channel/UC1mBXiJnLtiDHMtpga0Ugaw?view_as=subscriber


00:00 - Intro
02:08- The choices, Rustlang or C++?
05:08 - The tale of the tape, Rustlang vs C++
05:23 - Rustlang Pros
07:15 - Rustlang Cons
08:26 - C++ Pros
10:52 - C++ Cons
*

Blog article version: https://www.kofi-group.com/rustlang-vs-c-which-language-should-you-learn-in-2021/

Remote jobs: https://www.kofi-group.com/search-jobs/

Kofi Group helps startups outcompete FAANG (Facebook, Amazon, Apple, Netflix, Google) and big tech in the highly competitive, war for talent.

Our videos cover hiring tips and strategies for startups, software engineering and machine learning interview preparation, salary negotiation best practices, compensation analysis, computer science basics, artificial intelligence, tips for other recruiters, and much more!

Hit the SUBSCRIBE button and we’ll see you in the comments!

––––––––––––––––––––––––––––––
Skydive by Loxbeats https://soundcloud.com/loxbeats
Creative Commons — Attribution 3.0 Unported — CC BY 3.0
Free Download / Stream: http://bit.ly/2uUKEmd
Music promoted by Audio Library https://youtu.be/hpAp6GMSM30
––––––––––––––––––––––––––––––

#rustlang #rustlanguage #c++ #softwareengineering #kofigroup #startup #faang

#rustlang #cplusplus #rust

Rustlang vs C++: Which Language Should You Learn in 2021?

Pong Game Tutorial using The Rust Programming Language

Pong game tutorial using the Rust Programming Language and a game framework called GGEZ.

I decided to start working on this tutorial before vacation, it was suppose to be a small project, but apperantly making tutorials takes a long time!

➤ Source code!
https://github.com/TanTanDev/rusty_pong

[ Timestamps ]
0:00 Intro
0:11 Requirements
0:22 Project setup
1:06 Getting the basics down
3:49 Drawing things on the screen
5:33 Player positioning
7:45 Ball setup
8:32 Input
9:49 Player collision
10:30 Cleanup movement code
11:23 Ball movement
13:24 Scoring
15:44 Fixing score positioning
16:30 BOUNCE!
18:35 Adding a middle line
19:32 General tips and thoughts!

[About]
Hey! I’m an indie game developer, that loves testing out different game engines and languages.
I usually tackle some shorter projects in form of devlogs. Sometimes when I feel extra juicy, I upload the source code of the projects I’m showcasing! I try to upload weekly, hope you guys enjoy!

#rustlang #gamedev

#rustlang #rust

Pong Game Tutorial using The Rust Programming Language

Snake But I Made It For Keyboard Using RUST

I made a snake game for keyboard using the Rust Programming language.

➤ Snek github page:
https://github.com/TanTanDev/wooting_snake

➤ Download game: (Wooting keyboard compatible only)
https://github.com/TanTanDev/wooting_snake/releases/tag/1.00

[ Timestamps ]
0:00 Epic gameplay
0:58 What Have I Done Oh My
1:17 Selling you on the idea
1:40 Rust programming
2:00 So It Begins
2:33 TanTans mixtape - 0 Day
3:16 Keyboard sdk problems
3:41 TanTans mixstape - SNEK GOS NOM
4:09 Sound effects
4:30 Gameplay, no commentary
4:52 Play it yourself?
5:30 SNEK GOES BAIBAI

➤ Music
♫ Track: Nintendo膣69 - ブラジル蒸気モリー (BrvzilivnVvpormollyBitch)
♫ Watch: https://www.youtube.com/watch?v=aOm6KTPACHQ

[About]
Hey! I’m an indie game developer, that loves testing out different game engines and languages.
I usually tackle some shorter projects in form of devlogs. Sometimes when I feel extra juicy, I upload the source code of the projects I’m showcasing! I try to upload weekly, hope you guys enjoy!

#rustlang #gamedev

#rust #rustlang

Snake But I Made It For Keyboard Using RUST

Rust Language and 5 Things You Need to Know About it in 2021

Rust Language and 5 Things You Need to Know About it in 2021| Rust Programming Language | Rustlang

Rust (Rust Language) is a systems-level programming language designed with safety in mind. The compiler is there to help you every step of the way, and barring any logic flaws, there’s a pretty good chance your code will work – even if there are a few little mistakes or hiccups.

C++ compiler messages are notoriously difficult to decipher, and while they’ve made huge advancements on how errors are communicated, the Rust language does it on a whole other level. There is a reason why Rustlang is one of the hottest programming languages used today.

It’s estimated that there are almost a million rustlang developers world-wide, and while these sound like rookie numbers when compared to the tens of millions that use JavaScript and Python, it’s still significant.

SUBSCRIBE to Kofi Group:https://www.youtube.com/channel/UC1mBXiJnLtiDHMtpga0Ugaw?view_as=subscriber


00:00 - Intro
01:55 - What is rust language
02:55 - Why use rust language
05:04 - Things to look out for with rust language
06:40 - How does rust language stack up against golang
*

Website: https://www.kofi-group.com/

Blog article version: https://www.kofi-group.com/rust-programming-language-5-things-you-need-to-know/

Remote jobs (including rustlang jobs): https://www.kofi-group.com/search-jobs/

Kofi Group helps startups outcompete FAANG (Facebook, Amazon, Apple, Netflix, Google) and big tech in the highly competitive, war for talent.

Our videos cover hiring tips and strategies for startups, software engineering and machine learning interview preparation, salary negotiation best practices, compensation analysis, computer science basics, artificial intelligence, tips for other recruiters, and much more!

Hit the SUBSCRIBE button and we’ll see you in the comments!


Music - Forgotten by XIAO-NIAO
https://www.youtube.com/watch?v=2NnS--Q54


#rustlanguage #rustlang #rust #rustprogramming #kofigroup

#rustlang #rust

Rust Language and 5 Things You Need to Know About it in 2021
Flo  D'Amore

Flo D'Amore

1615776033

Introduction to Apache Arrow with Rust

This article explores what I have learned while working with Apache Arrow in Rust

For the past few months, I’ve been working on an application that is responsible for processing in-memory data. The project is exciting to me for two reasons. One is that the project is written entirely in Rust, and the other is the opportunity to learn about new topics and libraries. This article explores what I have learned while working with Apache Arrow.

When I first started working on the project, I was not aware of Apache Arrow. I just needed a way to aggregate data as efficiently as possible. I even built a proof-of-concept that provided most of the functionality that I needed, including joins. It was a rough draft, but I could already tell that there were some performance issues. One fundamental issue was the performance of aggregation functions on the data structure that represented a data set in a row-based format. This design meant that column-based operations like filtering and mathematical operations were costly. There were a few other concerns, so I decided to do some more research which finally led me to Apache Arrow.

What is Apache Arrow

Apache Arrow is a language-agnostic software development platform used to build applications that process and transport large data sets. Not only did this product provide a column-oriented data format, but it also provided a few other helpful libraries and a developer ecosystem maintained by the Apache Software Foundation.

Memory Format

The core feature of Apache Arrow is its in-memory columnar data format which is a specification for structuring tabular data sets in memory and provides a well-defined type system. This makes the format an ideal building block for projects like database systems or data frame libraries. One major benefit of this memory format is that it excels at processing large chunks of data and enables vectorization using SIMD operations.

Libraries

Other libraries are provided as companions to Apache Arrow. They provide common functionality that you wouldn’t want to implement yourself. Two Rust-specific libraries I found helpful were DataFusion and Arrow Flight. DataFusion is a query engine built on Apache Arrow that provides data frame and SQL query APIs. Arrow Flight is a serialization library that is used for transporting data across a network. I’ll go into more detail about these libraries in later articles.

Developer Ecosystem

One important factor in deciding on Apache Arrow was the developer ecosystem. Apache Arrow is maintained by the Apache Software Foundation which provides a governing body and decision-making process. The foundation also works to maintain a community of open-source developers that is open to everyone.

Rust Arrow Implementation

There are multiple implementations of Apache Arrow, but I will focus on the Rust version. This section will be broken into four parts: low-level arrays, high-level constructs, data readers, and compute kernels. Not every aspect of the library will be covered but just enough to get a good idea of how it can be used.

#rust #rustlang #programming

Introduction to Apache Arrow with Rust
Donato  Roob

Donato Roob

1614702660

My Journey to Running A Workflow Automation Engine in A Browser

About a week ago I got seriously bothered to figure out whether it is possible to run BPXE (a workflow automation engine I am developing) in a browser. I mean, theoretically, it was always a possibility (Rust can target wasm32-unknown-unknown after all), but how does this translate to having something more than an in-and-out library that takes the heavy lifting away from JavaScript?

So I set out on a journey.

It’s been a frantic week, suffice to say! The problem is that this engine is more than just a library, it’s rather a long-running engine disguised as a library so that it can be precisely customized to do what needs to be done. It uses Rust’s async a lot. It also has an embedded scripting capability (👋 Rhai!).

It has a lot of dependencies.

As a result of my journey, I’ve published a couple of crates under the umbrella of wasm.rs.

The first one is really simple. I just wanted a better way to see my debugging output. So I wrote a drop-in replacement for dbg! macro that works both in the browser and other targets. I do realize that WebAssembly is no longer just for “web” and I’ll see if anything needs to be done about other WebAssembly targets.

Nevertheless, please welcome wasm-rs-dbg!

The next one was really important. I’ve tried running BPXE and its own tests on a bunch of async executors (from Tokio, futures crate, async-executor, etc.) to no avail. They all kept breaking when I was running them in the browser. Mostly due to the unavailability of synchronization primitives in the default standard library. Even though some of these were explicitly “local” (one thread) executors.

#rust #wasm #async #browser #rustlang

My Journey to Running A Workflow Automation Engine in A Browser
Jam  Dana

Jam Dana

1603692932

How to Build a single Binary gRPC server-client with Rust

There are plenty of resources for the basics of Rust and for protocol buffers + gRPC, so I don’t want to waste your time with heavy introductions. I want to bring you to action as soon as possible.

If you’re here I’ll make a few assumptions about you.

  • You can write code in another language, but you have an interest in Rust
  • You have basic familiarity with the command line for simple tasks (like listing files with ls)
  • You used web service APIs like REST, GraphQL or gRPC in code you’ve written
  • You’ve skimmed through the  official protocol buffers (v3) docs at least once
  • You are looking for some example code that you can copy/paste and modify

Goals for the post

My goal is to walk through writing a small async Rust CLI application. It will take user input from a client, send it to a remote gRPC server, and return output to the client.

The finished code is available in my  rust-examples repo, as  cli-grpc-tonic-blocking. But I encourage you to follow along, as I will narrate changes while I make them.

#rustlang #grpc #rust

How to Build a single Binary gRPC server-client with Rust
Houston  Sipes

Houston Sipes

1603119600

Processing 19 million rows CSV in 1 second with Rust

Background & Use Case

As part of my new years resolution, I need exploration of the Rust. Here is my last article about the Rust.

https://medium.com/@jayhuang75/file-processing-go-vs-rust-6e210a3168fd

Today’s use case is the dataset from Kaggle, which contain bike share information for Montreal from 2016 to 2019.

The dataset is followed:

start_date: Date and time of the start of the trip ( AAAA-MM-JJ hh: mm )

start_station_code: Start station ID

end_date: Date and time of the start of the trip ( AAAA-MM-JJ hh: mm )

end_station_code : Endstation ID

is_member : Type users. (1: Subscriber, 0: Non-subscriber)

duration_sec: Total travel time in seconds

The dataset has 35 files and around 1G.

For a simple use case, we want to find out all the is_member lines and get the total counts.

The output should be :

Image for post

output of processed

Application design

All is about the design, the application design is important, think is much important before you start coding.

Good software design and architecture come from the whiteboard and not from the keyboard.

in order to maximize the single machine, we will consider using the worker pool and build-in iterator.

Image for post

Create a channel of unbounded capacity.

Based on the CPU number of your machine, create the worker pool.

Image for post

#rustlang #rust

Processing 19 million rows CSV in 1 second with Rust
Maud  Rosenbaum

Maud Rosenbaum

1602909060

Explaining Rust’s Modules

It’s Different

When beginning with Rust and having the need to expand to other files in subfolders of the project, one can stumble over the module concept of Rust very fast.

Whatever technology or programming language we use, we tend to structure our ideas and concepts in directories and files, in order to maintain a valuable overview as the project accelerates and expands, to encapsulate knowledge, and to create strong coherence.

Creating these folders in a Rust project, it strikes home fast: Things are very different here. A C-based language programmer tends to import files to get the respective types or namespaces within one’s scope. Playing around with some context help of the IDE or searching the internet, we learn that Rust thinks in modules, not files.

Rust works with modules, as part of a module tree. There is no such thing as file imports.

A Module in Rust

Important concepts in the Rust Module System¹ are packagescratesmodules, and paths. This article focuses on modules² and paths, when defined in multiple files and how to bring the split parts together.

Creating a base project

Creating a new project from a template in one’s favorite IDE (or terminal editor) is usually the first step into a new project, and the Rust project will probably look similar to this:

project
|-- src
|-- target 
|-- .gitignore
|-- Cargo.lock
|-- Cargo.toml

#devops #software-development #programming #rust #rustlang

Explaining Rust’s Modules

Running Rust in the Browser with Web Assembly

I’ve recently been working on a Rust course for the Qvault 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.

For those of you who don’t care about how it works, and just want to give it a try, checkout the demo: Rust WASM Playground.

How It Works

The architecture is fairly simple:

  • User writes code in the browser
  • Browser sends code to server
  • Server adds some glue and compiles code to WASM
  • Server sends WASM bytes or compiler errors back to browser
  • Browser runs WASM and displays console output, or shows compiler errors

Writing code and shipping it to the server hopefully needs no explanation, it’s a simple text editor coupled with the fetch API. The first interesting thing we do is compile the code on the server.

Compiling the Code

Qvault’s server is written in Go. I have a simple HTTP handler with the following signature:

func (cfg config) compileRustHandler(w http.ResponseWriter, r *http.Request)

At the start of the function we unmarshal the code which was provided in a JSON body:

type parameters struct {
	Code string
}

decoder := json.NewDecoder(r.Body)
params := parameters{}
err := decoder.Decode(&params)
if err != nil {
	respondWithError(w, 500, "Couldn't decode parameters")
	return
}

Next, we create a temporary folder on disk that we’ll use as a “scratch pad” to create a Rust project.

usr, err := user.Current()
if err != nil {
	respondWithError(w, 500, "Couldn't get system user")
	return
}
workingDir := filepath.Join(usr.HomeDir, ".wasm", uuid.New().String())
err = os.MkdirAll(workingDir, os.ModePerm)
if err != nil {
	respondWithError(w, 500, "Couldn't create directory for compilation")
	return
}
defer func() {
	err = os.RemoveAll(workingDir)
	if err != nil {
		respondWithError(w, 500, "Couldn't clean up code from compilation")
		return
	}
}()

As you can see, we create the project under the .wasm/uuid path in the home directory. We also defer an os.RemoveAll function that will delete this folder when we are doing handling this request.

#golang #languages #rust #wasm #rust #rustlang #wasm #web assembly

Running Rust in the Browser with Web Assembly

Implementation of Binary Search Tree in Rust

While experimenting with Rust I’d like to see Rc and RefCell in action to better understand how smart pointers in Rust work. In this post I implement binary search tree in Rust using only Rc and RefCell.

Basically, Binary Search Tree is a binary tree data structure with the following properties

  • given a node and its key k, any key in the node’s left subtree is less than k
  • given a node and its key k, any key in the node’s right subtree is greater than k

Let’s get started by creating a new project cargo new bstree

Create a new folder src/bs_tree and inside bs_tree folder create a file node.rs which will contain implementation for a single node

#algorithms #rustlang #binary-tree #rust #data-structures

Implementation of Binary Search Tree in Rust