This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
#[derive(Debug)] | |
enum Type { | |
Num, | |
Bool, | |
List(Box<Type>), | |
Func(Box<Type>, Box<Type>), | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/lib.rs b/src/lib.rs | |
index 24534a8..8121dd9 100644 | |
--- a/src/lib.rs | |
+++ b/src/lib.rs | |
@@ -170,6 +170,11 @@ fn wait_lock<'a, T>(lock: &'a InnerMutex<T>) -> MutexGuard<'a, T> { | |
} | |
} | |
+#[inline] | |
+fn poll_lock<'a, T>(lock: &'a InnerMutex<T>) -> Option<MutexGuard<'a, T>> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hydra-32t-1m-flume time: [89.310 us 90.372 us 91.435 us] | |
Found 6 outliers among 100 measurements (6.00%) | |
4 (4.00%) high mild | |
2 (2.00%) high severe | |
hydra-32t-1m-floom time: [98.935 us 100.76 us 102.84 us] | |
Found 6 outliers among 100 measurements (6.00%) | |
5 (5.00%) high mild | |
1 (1.00%) high severe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arch Linux, 4 cores, 8 threads, AMD Ryzen 7 | |
=========================================== | |
create-flume time: [133.58 ns 133.99 ns 134.43 ns] | |
change: [-2.8490% -2.1632% -1.5710%] (p = 0.00 < 0.05) | |
Performance has improved. | |
create-crossbeam time: [189.86 ns 190.24 ns 190.67 ns] | |
change: [+1.3594% +1.8473% +2.3118%] (p = 0.00 < 0.05) | |
Performance has regressed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
cweb_version=0.6.26 | |
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz | |
curl -Lo cargo-web.gz $cweb | |
gunzip cargo-web.gz | |
chmod u+x cargo-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
cweb_version=0.6.26 | |
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz | |
curl -Lo cargo-web.gz $cweb | |
gunzip cargo-web.gz | |
chmod u+x cargo-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the length of a list | |
def len = l -> | |
if l = [] | |
then 0 | |
else len(:> l) + 1 | |
# Find the nth element in a list | |
def nth = n -> l -> | |
if n < 1 | |
then <: l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sum types with type parameters | |
data Maybe T = | |
| Some T | |
| None | |
data Pet = | |
| Dog | |
| Cat | |
| Hamster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = struct { | |
io: struct { | |
print: |msg| { | |
__print(msg); | |
}, | |
println: |msg| { | |
self.print(msg + "\n"); | |
}, | |
input: || { | |
__input() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{ | |
collections::{HashMap, VecDeque, hash_map::DefaultHasher}, | |
hash::{Hash, Hasher, BuildHasherDefault, BuildHasher}, | |
}; | |
#[derive(Debug)] | |
pub enum Error { | |
NoSuchHash, | |
DuplicateHash, | |
} |