Conversation

Jarkko Sakkinen

IMHO, good design goals for any Rust crate would be that:

1. It should run on your toaster.
2. It should run on #Amiga.

Once I stopped using Cargo and 3rd party crates when making my own crates I've started to enjoy Rust for real :-) IMHO, programming should be fun, not efficient or "productive". If I have to start to be too efficient I'll immediately stop this career.

#rust
1
1
9

@jarkko How did you go about not using cargo or external crates? Just invoke rustc directly with a makefile?

1
0
0
@teotwaki https://github.com/puavo-org/tpm2_library/blob/main/Makefile

Of course for apps I use crates but on those I also tend to dilate towards less cluttered abstractions (e.g., i prefer json crate over serde_json). That is what I use in tpm2sh.

This another project I'm working on which does not have dependencies: https://codeberg.org/jarkko/zmodem2. For this there's no priority to do Makefile for CI as it does not target for Linux kernel.
1
0
1
@teotwaki not for all projects but for basic protocol implementations that you want translate to any environment, it's really useful to focus on this type of robustness.

E.g., for zmodem2 I'm redesigning it as something that walks and talks stream trait implementation but is not such [1]. Then in my example apps I'll migrate them to Tokio and demonstrate how to wrap it for that use and purpose.

With traits, when I use them, my strategy is usually pick stuff that gets the first iteration done fastest. Then I start to drop over time stuff that maturizes and keep only the essential traits. If you have stable code, the benefit of productivity in the first phase starts to degenerate into something that can get in the way of bug fixes etc.

[1] https://docs.rs/futures/latest/futures/stream/
0
0
0