use std::io::Write;
fn main() {
std::io::stdout().write(b"Hello, world!\n").unwrap();
}
The reason people often use println! is that println! is variadic and can support any number of arguments to format in the string. For example: println!("x is: {}", x);
This also has the benefit of allowing type checking at compile time, as opposed to using a function like printf in C, which does not have such power. Additionally, this allows Rust to take references to the variables entered without the programmer's specification, in order to prevent unnecessary copying.
https://gleam.run/