61 karma · joined Feb 4, 2017 (9y ago) · 17 submissions
comment 4y ago · link · parent
https://podcasts.apple.com/us/podcast/the-haskell-interlude/...
comment 7y ago · link · parent
[0] https://doc.rust-lang.org/std/str/pattern/trait.Pattern.html...
comment 7y ago · link · parent
// #1 @ 916,616: 21x29
let parts: Vec<&str> = l.split(['@', ',', ':', 'x'].as_ref()).collect();
let x = parts[1].trim().parse::<i32>().expect("x as i32");
let y = parts[2].trim().parse::<i32>().expect("y as i32");
let w = parts[3].trim().parse::<i32>().expect("width as i32");
let h = parts[4].trim().parse::<i32>().expect("height as i32");
[0] https://doc.rust-lang.org/std/primitive.str.html#method.spli...comment 7y ago · link · parent
For example in rust most code that can fail will return a Result and thus the compiler forces you to handle that. However, that code can just as easily panic and behave like an uncaught exception would (thread exiting). An example would be the division operator and the array index operator. Both division-by-zero and out-of-bounds errors can certainly be handled by using a Result but in this case the Rust developers made a decision to use panic. Are these both exceptions bc they are handled like a typical uncaught exception or are they errors bc it’s conceivable to handle them just like a failed file open?
comment 8y ago · link · parent
I also just want to comment that skepticism to high claims is good but your comment seems a bit too harsh. Briefly looking at his post where he goes into his “fastest hash table” it’s quite long, very detailed and has similar graphs. That doesn’t seem under-researched to me.
comment 9y ago · link · parent
comment 9y ago · link · parent
A counter example to this is the typescript compiler which some might describe as a transpiler. It does sophisticated control flow analysis to, for example, make sure all branches of an if statement return the same type.
comment 9y ago · link · parent
> Halliday’s character combines the worst traits of Elon Musk, Mark Zuckerberg and Kim Dotcom.
Do you think its purpose is to inspire you to be a better person? Since when are fiction books self help books? Since when are perfect characters the most interesting ones?
comment 9y ago · link · parent
comment 9y ago · link · parent