Rust for Clojurists
41–44 of 44 posts
Re: Rust for Clojurists
#42Re: Rust for Clojurists
#43Good article. He missed out the main pro though (and literally the only reason I ever use any Lisp): hot swapping. The ability to change code on the fly as the program is running. For this to actually work you need 2 things: 1. No explicit types: Everything in Clojure is just a list or hash map, so I can add extra members to anything at runtime no problem. The amount of static checks Rust does at compile time makes t…
Re: Rust for Clojurists
#44Good article. He missed out the main pro though (and literally the only reason I ever use any Lisp): hot swapping. The ability to change code on the fly as the program is running. For this to actually work you need 2 things: 1. No explicit types: Everything in Clojure is just a list or hash map, so I can add extra members to anything at runtime no problem. The amount of static checks Rust does at compile time makes t…
You can certainly have a hash map of trait objects in Rust (it just points to the vtable and the data). This means anything that has an impl for the Trait can be stored in the hash map.
Rust also doesn't have exceptions, using algebraic data types to hold on to the errors and return them up the stack. Because it's on the stack, it's not some global state that's mutated, but we just went back to the calling function and we can attempt to try again.