The Rust Programming Language For Game Tooling: Dan Olson Principal Software Architect
The Rust Programming Language For Game Tooling: Dan Olson Principal Software Architect
Dan Olson
Principal Software Architect
Who am I?
• Working in games since 2004, Treyarch since 2008.
• Performs well.
• Performs well.
• Performs well.
• Performs well. 🤔
print_md5_sum(result);
Source: https://stackoverflow.com/a/1220177/69283
print_md5_sum(result);
Source: https://stackoverflow.com/a/1220177/69283
print_md5_sum(result);
Source: https://stackoverflow.com/a/1220177/69283
print_md5_sum(result);
Source: https://stackoverflow.com/a/1220177/69283
print_md5_sum(result);
Source: https://stackoverflow.com/a/1220177/69283
• Performs well.
• Performs well.
• Performs well.
• Performs well. 😀
• Heavily multithreaded.
• Multithreading
• Parsing Text
• C ABI compatibility
• Web Applications
• GUIs
The Rust Programming Language For Game Tooling
1/8 - Error Handling
• Result – holds the success or failure state of an operation.
Caused by:
The system cannot find the file specified. (os error 2)
file_names file_names
.iter() .par_iter()
.map(|x| hash_file(x)) .map(|x| hash_file(x))
.collect(); .collect();
file_names
.par_iter()
.map(|x| hash_file(x, &mut count))
.collect();
#[derive(Deserialize)]
struct Config {
string: String,
number: i32,
list: Vec<String>,
}
Ok(())
}
Source: https://crates.io/crates/pyo3
The Rust Programming Language For Game Tooling
7/8 - Web Applications
• There are lots and lots of crates for web apps. I like rouille for quick, simple ones.
rouille::start_server("0.0.0.0:80", move |request| {
Response::text("hello world")
});
Source: https://docs.rs/rouille/3.1.1/rouille/
• But tide or actix-web might be better for more substantial apps.
#[async_std::main]
async fn main() -> tide::Result<()> {
let mut app = tide::new();
app.at("/orders/shoes").post(order_shoes);
app.listen("127.0.0.1:8080").await?;
Ok(())
}
Source: https://crates.io/crates/tide
The Rust Programming Language For Game Tooling
8/8 - GUIs
• Native Rust: iced, druid, egui
Source: https://crates.io/crates/egui
• 27 individual contributors.
• Bad Rust code has the same safety guarantees as good Rust code!
• Initial hurdles are high, but large productivity gains after they are cleared.
https://careers.treyarch.com/