With forced functional programming, you may be referring to serenity's builders? For example
.send_message(|m| m
.content("text")
.embed(|e| e
.description("...")
.timestamp("...")
)
.components(|c| c
.create_action_row(|r| r
.create_button(|b| b
.style(ButtonStyle::Primary)
.label("press me")
.custom_id("button1")
)
)
)
).await?;
In the next breaking release (`next` branch in git), we have a new by-value builder style which has
turned out to be a better design in many ways:
And a PR is open to make the API even better (replace redundant CreateComponents with Vec<CreateActionRow>) and more will be coming presumably.
Does this seem more rusty to you? We're open to more criticism - developmenet on serenity is quite active currently (e.g.
52 PRs merged in the last month)
Comments
I did a small discord bot 4-5 months ago with serenity, and while it worked, I found it was a mess.
It felt like someone was trying to force functional programming on rust, with typenames from java.
Sure it works but the code looked very verbose, and the ridiculous types like 'ApplicationCommandInteractionDataOptionValue' definitely did not help.
Serenity works well, it's just definitely not rust-style.
The type in question has since been renamed to CommandDataOption, as well as other such long types (https://github.com/serenity-rs/serenity/pull/1899).
With forced functional programming, you may be referring to serenity's builders? For example
In the next breaking release (`next` branch in git), we have a new by-value builder style which has turned out to be a better design in many ways: And a PR is open to make the API even better (replace redundant CreateComponents with Vec<CreateActionRow>) and more will be coming presumably.Does this seem more rusty to you? We're open to more criticism - developmenet on serenity is quite active currently (e.g. 52 PRs merged in the last month)
The word you're looking for is 'idiomatic'
You might like Twilight[1]. It is a smaller project, but a lot more modular and "rusty".
[1]: https://github.com/twilight-rs/twilight