Skip to content

Commit

Permalink
Rust lang BASIC of BASICS
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBruns committed Apr 8, 2024
1 parent 02c4996 commit 2d50880
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 14 deletions.
2 changes: 1 addition & 1 deletion _posts/2024-03-01-00.00.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ At some point, when we have really squeezed all the just out of the ol' lemon, w

"Please develop a 200 module training regimen for a year-long deep dive into learning to program with Rust-Lang, including WASM, the Tauri application toolkit, ROS2 with Rust bindings and other intracies of Rust-Lang and getting closer to the machine. The general objective for this year-long training regimen should be in the realm of developing the capabilities and toolchain for developing fault-tolerant real-time operating systems for swarm robotics."

The POINT of ***this exercise*** is about developing the [Diffversity aproach to IMMERSION learning](https://azynch.github.io/Diffversity/) ... and overwhelming ourselves with an understanding of the topic ... in order to be able to ask progressively better questions ... in our FIRST revision of our 200-module syllabus, there are SIX different sections: 1)Fundamentals (50 modules), 2) Systems Programming (40 modules), 3) Embedded & Real-Time Systems (40 modules), 4)WebAssembly & Tauri (20 modules), 5) Robotics & ROS2 (30 modules), 6) Distributed Systems (20 modules). The first thing that we do is to skim over the outline syllabus and then start "***putting some meat on the bones***" of the outline, by adding some additional content to each of the sections ... but as we do this, our understanding of the outline will change and we will start re-prioritizing the content of the Sections or even adding/subtracting Sections from the outline ... we will keep the ORIGINAL outline here for reference, with REV1 as separate document with future REVS being increment in [Semantic Versioning](https://semver.org/) ##.##.## fashion ... so this post [even if we update/clarify the above description] will be the ORIGINAL starting point, but we will alway be working on a new UPDATED outline.
The POINT of ***this exercise*** is about developing the [Diffversity aproach to IMMERSION learning](https://azynch.github.io/Diffversity/) ... and overwhelming ourselves with an understanding of the topic ... in order to be able to ask progressively better questions ... in our FIRST revision of our 200-module syllabus, there are SIX different sections: 1)Fundamentals (50 modules), 2) Systems Programming (40 modules), 3) Embedded & Real-Time Systems (40 modules), 4)WebAssembly & Tauri (20 modules), 5) Robotics & ROS2 (30 modules), 6) Distributed Systems (20 modules). The first thing that we do is to skim over the outline syllabus and then start "***putting some meat on the bones***" of the outline, by adding some additional content to each of the sections ... but as we do this, our understanding of the outline will change and we will start re-prioritizing the content of the Sections or even adding/subtracting Sections from the outline ... we will keep the ORIGINAL outline here for reference, with REV1 as separate document with future REVS being increment in [Semantic Versioning](https://semver.org/) ##.##.## fashion ... so this post [even if we update/clarify the above description] will be the ORIGINAL starting point, but we will alway be working on the [next new UPDATED rev of outline](https://azynch.github.io/template/2024/03/01/00.01.00-real-time-fault-tolerance.html) even as we maintain archive of starting prior-to-next-rev points *as cookie crumbs to follow back to the beginning.*

# Fundamentals (50 modules):

Expand Down
61 changes: 48 additions & 13 deletions _posts/2024-03-01-00.01.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,101 @@
---
layout: post
title: "Rust, WASM, Tauri, ROS2, CR for RT-FT Swarm Robotics; REV 00.01.00"
title: "Rust, WASM, Tauri, ROS2, CR in Swarm Robotics; REV 00.01.00"
subtitle: "Developing The Accelerated Immersive Learning Process"
date: 2024-03-01 4:29:00
categories: template
---

The goal is to provide a comprehensive, but not exhaustive, curriculum that will enable the learner to build a solid foundation in Rust-Lang, WebAssembly, Tauri, ROS2, and distributed systems.

It is intended to be an intensive, immersive, yet thorough and well-rounded curriculum to provide the foundational skills for a goal of building fault-tolerant real-time operating systems for robot swarms.

As we go along through this material, we will want to be searching extensively, exhaustively for inexpensive demonstration or prototype-level projects and development communities that are working in areas tangentially related to the theoretical study outlined in this syllabus. Of course, the exact content for any self-starting autodidact can be adapted based on that individual's prior experience and their specific learning requirements.

# Fundamentals (50 modules):

0: Before you EVEN start down the Rust-Lang portion of this program of study, [carefully review the reasons WHY you want to use Rust-Lang](https://g.co/gemini/share/539967298e84), because [C-Lang is likely to remain the dominant force in low-level programming long into the foreseeable future](https://g.co/gemini/share/87dc72e2cb30). Rust-Lang is offering compelling advantages in some aspects, since memory safety is indeed one of the most significant concerns in programming. But that is recognized now, but many writing code in the C programming language, even if the C standard does not [in its current form] inherently provide memory safety. The responsibility of ensuring memory safety largely falls on the C developer, but that will change. The developer can use development tools that aid in memory safety; there are people working on changes [driven by memory safety issue] to the language/compiler and libraries. It's certainly not foolproof, but [packaging several features into profiles can do ***much*** [although far from everything] to enforce memory safety](https://g.co/gemini/share/c49b6967474b). Developers can follow certain practices to achieve memory safety, such as: a) [nulling out pointers when freeing memory to avoid Use-After-Free bugs and double free bugs](https://g.co/gemini/share/ff0bed4ab86e), b) [performing bound checks to avoid Out-Of-Bounds (OOB) read and write vulnerabilities](https://g.co/gemini/share/39a0c582ef8f). c) [avoiding recursion or using it within known limits to prevent Stack Exhaustion and Heap Exhaustion vulnerabilities](https://g.co/gemini/share/cad42032c5d4). Although *practices* can help, they do not guarantee memory safety to the degree that Rust-Lang can. But there's a **LOT** of C code out there already and it's not going away soon, partly because ***even*** [high-level programming will not soon be replaced by conversational AI](https://g.co/gemini/share/de1515337e6c), there will always be important niches where C's raw control and established ecoystem are irreplaceable for troubleshooting issues in low-level programming. It is probably worth going down the Rust-Lang path as a novice or journeyman, even if one does not start out with an aim for mastery. It is strongly recommended that one working in this area be a *knows-just enough-to-dangerous* polyglot, ie there are topics in machine learning, AI and large language models that call for at least being able to follow a serious discussion in the Python ecosystem, you will want to think about those ways for [expeditiously ascending the Rust-Lang learning curve](https://g.co/gemini/share/3c9d44a968dc) that make the most sense for you getting up to speed as rapidly as possible.
0: Before you EVEN start down the Rust-Lang portion of this program of study, [carefully review the reasons WHY anyone would want to use Rust-Lang](https://g.co/gemini/share/539967298e84) ... maybe this course should be more heavily based on C-Lang, although we will get into plenty of legacy C code along the way. [C-Lang is likely to remain the dominant force in low-level programming long into the foreseeable future](https://g.co/gemini/share/87dc72e2cb30). Rust-Lang is offering compelling advantages in some aspects, since memory safety is indeed one of the most significant concerns in programming. But that is recognized now, but many writing code in the C programming language, even if the C standard does not [in its current form] inherently provide memory safety. The responsibility of ensuring memory safety largely falls on the C developer, but that will change. The developer can use development tools that aid in memory safety; there are people working on changes [driven by memory safety issue] to the language/compiler and libraries. It's certainly not foolproof, but [packaging several features into profiles can do ***much*** [although far from everything] to enforce memory safety](https://g.co/gemini/share/c49b6967474b). Developers can follow certain practices to achieve memory safety, such as: a) [nulling out pointers when freeing memory to avoid Use-After-Free bugs and double free bugs](https://g.co/gemini/share/ff0bed4ab86e), b) [performing bound checks to avoid Out-Of-Bounds (OOB) read and write vulnerabilities](https://g.co/gemini/share/39a0c582ef8f). c) [avoiding recursion or using it within known limits to prevent Stack Exhaustion and Heap Exhaustion vulnerabilities](https://g.co/gemini/share/cad42032c5d4). Although *practices* can help, they do not guarantee memory safety to the degree that Rust-Lang can. But there's a **LOT** of C code out there already and it's not going away soon, partly because ***even*** [high-level programming will not soon be replaced by conversational AI](https://g.co/gemini/share/de1515337e6c), there will always be important niches where C's raw control and established ecoystem are irreplaceable for troubleshooting issues in low-level programming. It is probably worth going down the Rust-Lang path as a novice or journeyman, even if one does not start out with an aim for mastery. It is strongly recommended that one working in this area be a *knows-just-enough-to-dangerous* polyglot, ie there are topics in machine learning, AI and large language models that call for at least being able to follow [and ask useful clarifying questions in] a serious discussion in the Python ecosystem, you will want to think about those ways for [expeditiously ascending the Rust-Lang learning curve](https://g.co/gemini/share/3c9d44a968dc) that make the most sense for you getting up to speed as rapidly as possible.

1: [Preliminaries: Basic Installation](https://doc.rust-lang.org/book/ch01-01-installation.html) ... start with the normally recommended [rustup](https://rust-lang.github.io/rustup/concepts/index.html) basic installation process and move on a trial [Hello, World!](https://doc.rust-lang.org/rust-by-example/hello.html) just to ensure that you have everything ready to go. Even, just the Hello, World trial gets you a start with Rust program anatomy especially the main() function with the body wrapped in {}. You might want to try experimenting a bit with [rustfmt](https://github.com/rust-lang/rustfmt) tool for formatting Rust code according to style guidelines, but also take a quick overview look at the other [Rust development tools](https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html) such as [rustfix](https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html#fix-your-code-with-rustfix) and [rust-clippy tool](https://doc.rust-lang.org/clippy/), with its collection of [over 700 lints](https://rust-lang.github.io/rust-clippy/master/index.html). You will also want to get a high level overview of the [rust-analyzer extension for VSCode](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) as well as other Rust-related extensions for VSCode, such as [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) to start getting a feel for [how VSCode can be used for Rust development](https://g.co/gemini/share/1526dd613f89). Be sure to compile and run trial programs like [Hello, World!](https://doc.rust-lang.org/rust-by-example/hello.html) noting that Rust is an ahead-of-time compiled language. Then experiment with Rust's [Cargo build system and package manager](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html) and skim over [The Cargo Book](https://doc.rust-lang.org/cargo/).

2-10: Start scratching the surface of Rust with the exercises in [rustlings](https://github.com/rust-lang/rustlings/), which might be the best way for large audiences of Rust noobs to learn the most basic basics of fundamental programming in Rust. While you are going through the exercises, you will want to use [***The Rust Programming Language*** book](https://doc.rust-lang.org/book/index.html), the most comprehensive and theoretical resource for concepts as you are going through [rustlings](https://github.com/rust-lang/rustlings/). You will also want to rely upon [Rust By Example](https://doc.rust-lang.org/rust-by-example/index.html) for practical alternative examples to tie all of the concepts together to firmly understand [common programming concepts, keywords and syntax](https://doc.rust-lang.org/book/ch03-00-common-programming-concepts.html),[variables and mutability](https://doc.rust-lang.org/book/ch03-01-variables-and-mutability.html), [data types](https://doc.rust-lang.org/book/ch03-02-data-types.html), [functions](https://doc.rust-lang.org/book/ch03-03-how-functions-work.html), [comments](https://doc.rust-lang.org/book/ch03-04-comments.html), [control flow](https://doc.rust-lang.org/book/ch03-05-control-flow.html).

1: [Installation](https://doc.rust-lang.org/book/ch01-01-installation.html), test the installation with [Hello, World!](https://doc.rust-lang.org/book/ch01-02-hello-world.html), review Rust program anatomy especially the main() function with the body wrapped in {}, experiment a bit with [rustfmt](https://github.com/rust-lang/rustfmt) tool for formatting Rust code according to style guidelines, but also take a quick look at the other [Rust development tools](https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html) such as [rustfix](https://doc.rust-lang.org/book/appendix-04-useful-development-tools.html#fix-your-code-with-rustfix), the [rust-clippy](https://doc.rust-lang.org/clippy/) collection of [over 700 lints](https://rust-lang.github.io/rust-clippy/master/index.html), the [rust-analyzer extension for VSCode](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer), compile and run, note that Rust is an ahead-of-time compiled language, then experiment with Rust's [Cargo build system and package manager](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html) and skim over [The Cargo Book](https://doc.rust-lang.org/cargo/).
11-20: [Resource Acquisition Is Initialization(RAII)](https://doc.rust-lang.org/rust-by-example/scope/raii.html) [ownership and moves](https://doc.rust-lang.org/rust-by-example/scope/move.html), [borrowing](https://doc.rust-lang.org/rust-by-example/scope/borrow.html), [lifetimes](https://doc.rust-lang.org/rust-by-example/scope/lifetime.html)
21-30: [Structs](https://doc.rust-lang.org/book/ch05-00-structs.html), [enums and pattern matching](https://doc.rust-lang.org/book/ch06-00-enums.html)

2-10: Rust basics - syntax, data types, variables, functions, control flow
11-20: Ownership, borrowing, lifetimes
21-30: Structs, enums, pattern matching
31-35: Error handling, Option, Result

36-40: Modules, crates, workspaces

41-45: Testing, debugging, documentation

46-50: Standard library, common collections

# Systems Programming (40 modules):

VLSI, FPGA, and ASIC design are EXACTLY a big part of this curriculum, but they are important to the development of real-time fault-tolerant systems and communication meshes. Computer architectures are still rapidly evolving, eg witness the rise of HBM3 to get past the Von Nueumann bottleneck and place memory closer to processing units. Accordingly, we delve into different side trips into research topics in computer architectures to ensure that we provide a foundation for understanding the "bare metal" that Rust programs will be getting closer to in the future.

51-60: Memory layout, pointers, unsafe Rust

61-65: Concurrency, threads, sync primitives

66-70: Parallelism, rayon, crossbeam

71-75: FFI, linking to C code

76-80: Allocators, custom allocators

81-90: Performance, profiling, optimization

# Embedded & Real-Time Systems (40 modules):

91-100: Embedded basics, no_std, memory-mapped registers

101-105: Interrupts, exceptions, fault handling

106-110: Device drivers, I/O

111-120: Real-time scheduling, RTOS concepts

121-125: Time handling, clocks, timers

126-130: Predictability, worst-case execution time

# WebAssembly & Tauri (20 modules):

WebAssembly and Tauri are included to enable UI development and potential off-loading of computation.

131-135: WebAssembly basics, Rust to WASM

136-140: JavaScript interop, wasm-bindgen

141-145: Tauri fundamentals, project setup

146-150: UI development with Tauri

# Robotics & ROS2 (30 modules):

The robotics portion covers essential concepts and ROS2 integration.

151-160: Robotics fundamentals, kinematics, control

161-165: Sensors, actuators, interfacing

166-170: ROS2 architecture, nodes, topics

171-175: Navigation, path planning, obstacle avoidance

176-180: Computer vision, image processing

# Distributed Systems (20 modules):
181-185: Distributed algorithms, consensus, gossip
186-190: Fault tolerance, replication, sharding
191-195: Networking, protocols, message passing
196-200: Security, authentication, encryption

These distributed systems modules START to prepare us for the challenges of swarm robotics, such as coordination, resilience, and security.

181-185: Distributed algorithms, consensus, gossip

WebAssembly and Tauri are included to enable UI development and potential off-loading of computation. The robotics portion covers essential concepts and ROS2 integration.
186-190: Fault tolerance, replication, sharding

191-195: Networking, protocols, message passing

Finally, distributed systems modules prepare for the challenges of swarm robotics, such as coordination, resilience, and security. Extensive practice projects and coding exercises should accompany the theoretical material.
196-200: Security, authentication, encryption

This is an intensive curriculum but provides a thorough foundation for the ambitious goal of building fault-tolerant real-time operating systems for robot swarms. The exact content can be adapted based on prior experience and specific project requirements. Let me know if you would like me to elaborate on any part of the curriculum!
10 changes: 10 additions & 0 deletions _posts/2024-03-01-00.02.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: "Rust, WASM, Tauri, ROS2, CR in Swarm Robotics; REV 00.02.00"
subtitle: "Developing The Accelerated Immersive Learning Process"
date: 2024-03-01 4:28:00
categories: template
---


Place holder ... will be revised/refactored based on copy of final edited version of [REV 00.01.00](https://azynch.github.io/template/2024/03/01/00.01.00-real-time-fault-tolerance.html)
10 changes: 10 additions & 0 deletions _posts/2024-03-01-00.03.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: "Rust, WASM, Tauri, ROS2, CR in Swarm Robotics; REV 00.03.00"
subtitle: "Developing The Accelerated Immersive Learning Process"
date: 2024-03-01 4:27:00
categories: template
---


Place holder ... will be revised/refactored based on copy of final edited version of [REV 00.02.00](https://azynch.github.io/template/2024/03/01/00.02.00-real-time-fault-tolerance.html)
10 changes: 10 additions & 0 deletions _posts/2024-03-01-00.04.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: "Rust, WASM, Tauri, ROS2, CR in Swarm Robotics; REV 00.04.00"
subtitle: "Developing The Accelerated Immersive Learning Process"
date: 2024-03-01 4:26:00
categories: template
---


Place holder ... will be revised/refactored based on copy of final edited version of [REV 00.03.00](https://azynch.github.io/template/2024/03/01/00.03.00-real-time-fault-tolerance.html)

0 comments on commit 2d50880

Please sign in to comment.