Skip to content

Instantly share code, notes, and snippets.

View zhangsoledad's full-sized avatar
🏠
Working from home

zhangsoledad zhangsoledad

🏠
Working from home
View GitHub Profile
@rylev
rylev / rust-in-large-organizations-notes.md
Last active February 2, 2023 10:08
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
@edmundsmith
edmundsmith / writeup.md
Created July 7, 2019 20:47
Method for Emulating Higher-Kinded Types in Rust

Method for Emulating Higher-Kinded Types in Rust

Intro

I've been fiddling about with an idea lately, looking at how higher-kinded types can be represented in such a way that we can reason with them in Rust here and now, without having to wait a couple years for what would be a significant change to the language and compiler.

There have been multiple discussions on introducing higher-ranked polymorphism into Rust, using Haskell-style Higher-Kinded Types (HKTs) or Scala-looking Generalised Associated Types (GATs). The benefit of higher-ranked polymorphism is to allow higher-level, richer abstractions and pattern expression than just the rank-1 polymorphism we have today.

As an example, currently we can express this type:

@doitian
doitian / memory_pool.rs
Last active March 21, 2018 03:11
Parity Bitcoin memory pool annotations
// miner/src/memory_pool.rs
// impl MemoryPool
// https://github.com/paritytech/parity-bitcoin/blob/687f78598478e31ff556a385c07b4035ad2d4b8b/miner/src/memory_pool.rs#L652
pub fn insert_verified(&mut self, t: IndexedTransaction) {
// make_entry 比较重要的一步是递归的找到在 pool 中的祖父 tx,如果 A input 指向 B,
// B 是 A 的父 tx。A 的祖父 tx 是 A 的所有父 tx 和每个父 tx 的祖父 tx 的集合。
let entry = self.make_entry(t);
let descendants = self.storage.remove_by_parent_hash(&entry.hash);
self.storage.insert(entry);
@chriseth
chriseth / async.md
Last active January 21, 2025 00:00
Async Solidity Contracts

Having seen @pirapira's sketch of Bamboo ( https://github.com/pirapira/bamboo/ ), which proposed to add better control about the "smart contract program flow", even across calls, I thought that this should certainly be added to Solidity, and actually, it might even be possible now to a certain degree using inline assembly.

The problem is that with many functions in a contract, it is not always clear which can be called at which stage in the contract's lifetime. Certain smart contracts would be easier to understand if written as follows:

@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active January 13, 2025 03:52
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@staltz
staltz / introrx.md
Last active June 6, 2025 21:39
The introduction to Reactive Programming you've been missing