3 ms·
My experience parallels the writer's... I did a foray over the holidays to try to make some base-layer and generic on top of rocket then actix-web then tide. I
by ldiracdelta 6y ago
My experience parallels the writer's... I did a foray over the holidays to try to make some base-layer and generic on top of rocket then actix-web then tide. I can get any of their toy examples to work, but building up a complex system with mixins to genericize some boiler plate code wasn't possible for my tiny brain. I may be hide-bound, but the lack of inheritance is a pain. I know I'm not right, but OO inheritance solves some problems well.
In the django ecosystem, I can take an existing component with a vast API surface, inherit from it, tweak a tiny part of it and then put it back in the system and I'm off to the races. With rust, you have to re-implement the entire API surface to experiment with a tweak or go upstream and modify the original source, which isn't a great long-term solution -- maintaining patches. The diesel ORM is great, but it seems that each api returns a different type and doing a builder pattern generically across different functions and getting the types correct is like being in the worst C++ templating hell.
I love the speed of execution, the type checking, the borrow checker, but the coding friction is real. I'd love to see more complex examples in all the rust web frameworks that do real work with good function partitioning in addition to the simple examples.
- ibraheemdev 6y ago> The diesel ORM is great, but it seems that each api returns a different type and doing a builder pattern generically across different functions and getting the types correct is like being in the worst C++ templating hell. Diesel provides the `into_boxed` method [0] for composing queries. [0]: https://docs.diesel.rs/diesel/query_dsl/trait.QueryDsl.html#method.into_boxed https://docs.diesel.rs/diesel/query_dsl/trait.QueryDsl.html#...