Apr 19, 2020
This week, I spent more time on Rust language learning, read code and practice, made the ribbot fetch new open issues from given projects. The next thing will let it get news from Medium source – automate the RiB news generating process over time.
Rust documentation is very well written. I enjoyed reading it. For example, the Closures, the writer even thought about the readers’ next thought – if they want to use Closure in functions syntax – and thoroughly practically explained the concept, with code demos – a lovely narrative.
Closures don’t require you to annotate the types of the parameters or the return value like
fnfunctions do. Type annotations are required on functions because they’re part of an explicit interface exposed to your users. Defining this interface rigidly is important for ensuring that everyone agrees on what types of values a function uses and returns. But closures aren’t used in an exposed interface like this: they’re stored in variables and used without naming them and exposing them to users of our library.
Closures are usually short and relevant only within a narrow context rather than in any arbitrary scenario. Within these limited contexts, the compiler is reliably able to infer the types of the parameters and the return type, similar to how it’s able to infer the types of most variables.
Making programmers annotate the types in these small, anonymous functions would be annoying and largely redundant with the information the compiler already has available.
As with variables, we can add type annotations if we want to increase explicitness and clarity at the cost of being more verbose than is strictly necessary.
I somehow like reading documentation more than blog posts, because I can get good enough information with helpful documentation. In contrast, by reading blog posts, I have to receive too many thoughts and opinions, which I don’t really care, from different writers. Reading blog posts is about wasting half energy on exhaust extra information to me.
Emacs is a powerful tool. I started to use that from Emacs server that we shared the same session when programming. I was too enjoyed to save my attention from only switch screens between terminal Emacs and browser, and now I practice those commands every day.
I tried Beaker, a peer-to-peer web browser, and some DeFi apps as well. Learn CKB by its developers’ blog posts, but reading code is most helpful for programming, so as documentation (if there is one).
News from Rust in Blockchain world,
- Mobilecoin is open sourced, and they submitted a PR to the next Rib issue
- Libra has a new white paper. Lane commented in the Rust in Blockchain TG group that, it’s basically just a database
- Komodo is rewriting their code in Rust
- IPFS Rust implementation
- Filecoin Node Rust implementation
Things from blockchain world – too many!
- Trail of Bits Blog has a bunch of great content on blockchain research and development
- These hooks in ERC777 open up the issue of reentrancy attacks
- Working in progress business plan
Build on CKB
- Made ckb-rpc-test to do transaction programming on CKB
- Brainstorm on transaction use cases, eg. ferrisfencing game
- Ribbot in Rust programming
- CKB code reading to follow the logic
- Command line and emacs lisp learning
- w/ Alex & Brian
- w/ Jan
- w/ Jane
- w/ a hackathon guy
- w/ Ronen
Another more or less coffee recipe
- One shot Bourbon whiskey (even I love scotch more)
- One shot moka brewed espresso (better if you can get a shot from semi-automatic espresso machine)
- A small sugar cube
Melt the sugar cube with hot espresso, then add the whiskey in. Note that the iced version tastes much better (I think). Just shake (or add ice) the sugar espresso to cool it down, then add whiskey in. And shake it! Serve it with ice.