Re:What If C++ Abandoned Backward Compatibility?
by steveklabnik on Saturday March 28, 2020 @03:05PM
(#22713501)
For fun, I whipped this up in Rust. I decided to go with an explicit struct to serialize it into, because it makes the error handling easier, and is a bit more idiomatic. I kept unwrap because it's similar to the python semantic of throwing an exception. It's pretty close though!
[ Parent
| on HN ]
Re:What If C++ Abandoned Backward Compatibility?
by steveklabnik on Saturday March 28, 2020 @08:02PM
(#22715254)
Apparently you can deserialize the date directly with serde and chrono too! So this could be even shorter.
Re:What If C++ Abandoned Backward Compatibility?
by BiteCode_dev on Saturday March 28, 2020 @03:28PM
(#22713703)
And Rust is very, very expressive and concise for a bare metal language. Serde is a beautiful thing.