~/talk

Developing VK.com web API DSL with macros

Talkat RustRush 2018 · 2018-12-15..12-16· [rust]
slides:none on file

A Rust DSL named VK RS generates URL-encoded VK.com API calls via macros, using serde for payloads and reqwest for HTTP, encoding API version and permission per endpoint. Implementation claims cover about 100–150 of ~400 endpoints, produces documentation with links to vk.com, handles lifetimes and generics inside macros, and serializes vectors/options into query strings. A central request macro emits builder-pattern structs and defaults; the codebase ends up as 500+ lines of macros and runs on stable Rust with procedural macro support.

AI-written summary · about

  1. 0:00Start
  2. 0:27Who am I?
  3. 3:02Why DSL?
  4. 4:07Basic architecture
  5. 7:18API call example
  6. 8:11Response example
  7. 8:27Simple request description
  8. 10:39Problems
  9. 12:00Solution: other macro for reference types
  10. 13:24Solution: a set of standard conversions
  11. 14:13Solution: use #[doc] attributes in macros directly
  12. 15:18Most common input syntax of request! macro
  13. 15:33Most common input syntax of request_ref macro
  14. 16:35Codegen? No, procedural macros!
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.