Skip to content

Commit

Permalink
Module 0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBruns committed Apr 9, 2024
1 parent 2d50880 commit 9b6c0a5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions _posts/2024-03-01-00.01.00-real-time-fault-tolerance.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ As we go along through this material, we will want to be searching extensively,

# Fundamentals (50 modules):

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.
0: Before you EVEN start down the Rust-Lang portion of this program of study, spend some time [carefully reviewing the reasons WHY anyone would want to use Rust-Lang](https://g.co/gemini/share/539967298e84) ... maybe, you will come away from this thinking that this course should really be much more heavily based on C-Lang, although we will get into plenty of legacy C code along the way, as we work through examples and ask our AI assistants to help us understand why something is done as it is in C-Lang. [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 seriously compelling advantages over C-Lang in some aspects, since memory safety is going to remain one of the most significant concerns in programming. That has been recognized for some time [thus Rust-Lang came into existence], 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 in C largely falls on the C developer, but that will change with standards and automation. The C-Lang developer can use C development tools that aid in memory safety; there are scads of bright people working on changes to C [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/).
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 invoke [rustc](https://doc.rust-lang.org/rustc/what-is-rustc.html) to compile and then run the ["Hello, World!" example](https://doc.rust-lang.org/rust-by-example/hello.html), which means that you need to ensure that you have everything ready to go. At first, you're just going to get a start with Rust program anatomy, including things like [comments](https://doc.rust-lang.org/rust-by-example/hello/comment.html) or additional *junk* code you care to add, just to monkey around ... the NECESSITY of monkeying around with the hello_world program can't be stressed enough; after all, this is a just sandbox; so [read ahead to *learn ahead of the class*, do things when you don't know what you're doing, look over other examples upon [Rust By Example](https://doc.rust-lang.org/rust-by-example/index.html)] but, be sure to add stupid stuff and find different ways to ***break*** the simple program.You want to come away from this with some vague sense of how Rust checks formatting correctness at compile time, noting that Rust is an ahead-of-time compiled language and uses linters. You will especially want to notice *and break* the syntax of main() function with the body wrapped in {} and the [formatted print](https://doc.rust-lang.org/rust-by-example/hello/print.html).

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).
Add different kinds of junk filler code ... just to 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/index.html), with its collection of [over 700 lints](https://rust-lang.github.io/rust-clippy/master/index.html). You can master these ***later***, but at first you want to RAPIDLY get a very 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) and by all means if you use VSCode, be SURE to ALSO work through [the tutorial for using Rust within VSCode](https://code.visualstudio.com/docs/languages/rust) to *start* getting a sense of how you might eventually get a feel for [how VSCode can be used for Rust development](https://g.co/gemini/share/1526dd613f89).

Be sure to compile and run trial example programs beyond just [Hello, World!](https://doc.rust-lang.org/rust-by-example/hello.html). 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/). The POINT of getting way ahead of yourself in the **Preliminary** module is to go wild, explore how much you can learn in just one day ... don't worry about getting it down perfectly, you will not have ***really*** broken anything -- we will be coming back to this material again and again ... at first, just install Rust, compile and run the hello_world program, drink from the firehose and ... ***BREAK THINGS.***

2-10: Start scratching the surface of how Rust actually works by methodically going through each one of the exercises in [rustlings](https://github.com/rust-lang/rustlings/) the *right way* ... because [rustlings](https://github.com/rust-lang/rustlings/) is going to be the best way for large audiences of Rust noobs to assuredly 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 theoretically deep resource for exploring concepts. You will also want to rely upon [Rust By Example](https://doc.rust-lang.org/rust-by-example/index.html) for practical ideas for alternative examples to tie all of the concepts together so that you might 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).

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)
Expand Down

0 comments on commit 9b6c0a5

Please sign in to comment.