2 ms·
Something I've been wondering is whether a Rust-embedded language has a place for making the "glue API server"-writing experience better. Rocket is an amazing l
by brundolf 6y ago
Something I've been wondering is whether a Rust-embedded language has a place for making the "glue API server"-writing experience better. Rocket is an amazing library, but Rust's strictness - much as I love it - still slows down the iteration phase quite a bit. Imagine being able to hack out an API, twiddling JSON and reshaping data, in something like Passerine, and then step the different pieces down to Rust code as they solidify
- smt88 6y agoYou can hack out an API in Open API Spec (I recommend Stoplight as a GUI for that) and then stand it up as a mock server for initial UI dev. If the language has a code generator written for it, you can then generate method stubs and types for your server. If not, you can still use your spec as a validation document that you feed into a library before responding to a request.
- brundolf 6y agoThat's not really what I mean... I mean that throwing together an API, even one with a bit of business logic, is still nontrivially easier in Flask than it is in Rocket (despite Rocket being the gold-standard for this in the Rust world). If we really want the Rust ecosystem to compete with, say, Go when it comes to regular web APIs, I think we're going to need more than just a framework. An embedded scripting language could be the ticket
- slightknack 6y agoI'm currently thinking of ways to make macros that serialize Rust structs to Passerine values (and vice-versa) a la serde. I think being able to hack out an API in a high-level language and then tossing it down to something like Rust for the low-level perf gains is a great idea. Furthermore, I'd like for this to be possible: - project |- Aspen.toml |- src ||- ... passerine code |- ffi ||- ... rust code Where Passerine could just wrap and call the Rust code automagically. This is still a ways off though...
- brundolf 6y agoSounds awesome! You've done great work already, I can't wait to see where it goes from here :)