async is what the ' in Unison is. I guess, because it is so commonly used in Unison.
And Rust decided, if the println!() fails, then panic!(). But I can see merit in a language that can guarantee that a given function cannot terminate your program. And that would mean we’d have to at least ignore the result in Rust:
And like, yeah, are you seeing the parallels? It’s a handful of small design decisions that make a huge difference here.
And you can absolutely argue that Rust took the less rigorous, less consistent approach for its println!().
I do think, that’s fine. Rust doesn’t give guarantees for not terminating to begin with and so, if println!() should ever not work, I do think, it’s fine to abort mission.
And the decision to not make println!() async doesn’t affect the remaining language design. Most production codebases will practically never use println!() anyways and should someone genuinely need an async_println!(), then that can be built.
But yeah, personally, it does excite me to see that the Unison authors thought differently. Even if it’s just sheer curiosity what they do with it and whether that added consistency is nice to work with.
But yeah, personally, it does excite me to see that the Unison authors thought differently. Even if it’s just sheer curiosity what they do with it and whether that added consistency is nice to work with.
This is what attracted me. Before I sold out to VB and Access in the early 1990s, I was just a labourer and hobby programmer of the “language junkie” type. The same three programs written in every language I could find (Metaphone, Pong, and Rolodex).
Now I’m retired (but 10 years away from programming) and want to try to reboot that hobby. I thought I was just making a tiny little complaint about my aged brain, not opening up a whole thread!
No worries, I think everyone’s having a grand time discussing Unison. I’m guessing, this whole post attracted lots of language junkies for obvious reasons…
You’ve done a great job of showing what it feels like when I see Rust sometimes. There’s something about the way that it “builds up” on the page over time…
I’ve never written any Rust - I’ll get to it one day! - but I found this article interesting look at how and why design decisions effect the final syntax: https://matklad.github.io/2023/01/26/rusts-ugly-syntax.html
Oh, well, I hope, it was clear that the third and fourth code sample aren’t actually valid Rust, but yeah, I did write them to look like typical Rust production code.
And yeah, that article is great. I feel the same way, the semantics are just different. And whether you like those semantics, depends on what you’re doing.
If you’re just writing a quick script where you don’t really need error handling and you probably won’t have more than a few files etc., then Rust’s semantics can be painful.
But if you’re writing a larger application, then Rust’s strictness and explicitness often just portrays the reality you have to deal with anyways. And it makes you deal with it right away, which can be frustrating at times, but overall feels like it boosts my productivity.
Ah, now you’re talking my language. 🙃
Well, for one you’re forgetting the main():
fn main() { println!("Hello, World!"); }
Then Rust already has syntactic sugar to omit the Unit-return-type, so it’s really:
fn main() -> () { println!("Hello, World!"); }
And then Rust decided to make println!() blocking. It could also look like this:
async fn main() -> () { println!("Hello, World!").await; }
async
is what the'
in Unison is. I guess, because it is so commonly used in Unison.And Rust decided, if the println!() fails, then panic!(). But I can see merit in a language that can guarantee that a given function cannot terminate your program. And that would mean we’d have to at least ignore the result in Rust:
async fn main() -> () { let _ = println!("Hello, World!").await; }
And like, yeah, are you seeing the parallels? It’s a handful of small design decisions that make a huge difference here.
And you can absolutely argue that Rust took the less rigorous, less consistent approach for its println!().
I do think, that’s fine. Rust doesn’t give guarantees for not terminating to begin with and so, if println!() should ever not work, I do think, it’s fine to abort mission.
And the decision to not make println!() async doesn’t affect the remaining language design. Most production codebases will practically never use println!() anyways and should someone genuinely need an
async_println!()
, then that can be built.But yeah, personally, it does excite me to see that the Unison authors thought differently. Even if it’s just sheer curiosity what they do with it and whether that added consistency is nice to work with.
This is what attracted me. Before I sold out to VB and Access in the early 1990s, I was just a labourer and hobby programmer of the “language junkie” type. The same three programs written in every language I could find (Metaphone, Pong, and Rolodex).
Now I’m retired (but 10 years away from programming) and want to try to reboot that hobby. I thought I was just making a tiny little complaint about my aged brain, not opening up a whole thread!
No worries, I think everyone’s having a grand time discussing Unison. I’m guessing, this whole post attracted lots of language junkies for obvious reasons…
You’ve done a great job of showing what it feels like when I see Rust sometimes. There’s something about the way that it “builds up” on the page over time… I’ve never written any Rust - I’ll get to it one day! - but I found this article interesting look at how and why design decisions effect the final syntax: https://matklad.github.io/2023/01/26/rusts-ugly-syntax.html
Oh, well, I hope, it was clear that the third and fourth code sample aren’t actually valid Rust, but yeah, I did write them to look like typical Rust production code.
And yeah, that article is great. I feel the same way, the semantics are just different. And whether you like those semantics, depends on what you’re doing.
If you’re just writing a quick script where you don’t really need error handling and you probably won’t have more than a few files etc., then Rust’s semantics can be painful.
But if you’re writing a larger application, then Rust’s strictness and explicitness often just portrays the reality you have to deal with anyways. And it makes you deal with it right away, which can be frustrating at times, but overall feels like it boosts my productivity.