@atamakahere

11 Followers
6 Following
80 Posts
Recently started working on making an SDK for an E2EE cloud storage service, It is so much fun to deal with cryptographic and HTTP endpoints in async manner, I excited to see how does it turns out. Will keep it updated here!

Super useful diagram that explains all available transformations between Result and Option standard #Rust types and their interactions.

Source: https://docs.google.com/drawings/d/1EOPs0YTONo_FygWbuJGPfikO9Myt5HwtiFUHRuE1JVM/edit

Rust Result/Option Transformations

Result<T, E> Result<U, E> Result<T, F> Option<T> T E Option<E> unwrap, expect, unwrap_or[_else], unwrap_or_default () unwrap_err, expect_err Err(e) Ok(t) Some(t) ok_or[_else] ok err map, and[_then] map_err None or[_else] Option<U> map, and[_then] U map_or [_else] filter, xor, or[_else], replace

Google Docs
@0ref works

@sanchayan
> I don't understand how folks are productive in languages without strong static types. I envy you.

+1 on that

@msf rely on functional paradigm wherever possible. Keeps the code clean and efficient as well.
Here is a non-exhaustive checklist
1. Avoid immutable as much as possible
2. Use monadic types/functions (option, results)
3. Iterators > loops
I am working on a personal project, basically implementing a BTC like blockchain in #c
So far, it coming together in nice shape, i can sign and verify a transaction
Next step is to generate a block and block mining
Finally, the hard part, which is block synchronisation between nodes, which I think is the hardest of all.
Will share the source code once I feel it’s presentable

Unpopular opinion but #rust for rustaceans is not written in a way to make it easier to understand .
It lacks visual aids like graphs, tables, figures that would make it easier to understand. Some sentences goes beyond the scope of reader and is not emphasised on. It is a great book of knowledge but I think it can be made simpler to understand and read, reducing the friction will help more devs to become better at rust.

I have already read and understood the concepts from the book.

I will leave this as it is.

Oh this is pretty neat:

'In addition, #Rust for #Linux is now being built-tested in Rust's
pre-merge CI. That is, every change that is attempting to land into the
Rust compiler is tested against the kernel, and it is merged only if it
passes -- thanks to the Rust project for that!'

I’m reading the “Linux Systems Programming” book by Robert Love, while reading the 2nd chapter, File I/O and learning about open, read and write syscall. I implemented these programs as an exercise for myself

1. Example program to use open syscall
2. /etc/passwd file parser, using open read syscall
3. cp cmd using open read and write

I have spent more than 6hrs on the 2nd one because the read syscall fills the buffer and I have to read it line by line, later I used read to get single char.