Elektrine lite

← Feed

@talios@mastodon.nz

Post #3691979

2026-07-09 09:47 UTC

@yakmoose@cloudisland.nz Multiple ways - one thing I liked about DamnHandly is that UriTemplate.fromTemplate() parsed/validated the template into a UriTemplate class, so you could have fast fail of constants (say in a library package, separate from usage). Whereas stdtemplate just takes a string, and returns a string - so leaves it all to run time. Sure, I could solve that just adding templates for every uritemplate as a String constant, but if the typesystem could that for me - win! Tradeoffs I guess. This does keep the API the same between its Go, Java, PHP, Python, Ruby, Rust, Swift, TypeScript versions. It’s part of there design - no reason I couldn't provide my own UriTemplate class that wraps it (also part of there design system): * no language idiomatic API, only 1 low level primitive - we do encourage language-specific wrapper/alternative libraries

Replies (1)

  • @yakmoose@cloudisland.nz 2026-07-09 10:32

    @talios@mastodon.nz I’m a loser, so I’d pick one that follows the template rfc and isn’t just dumb strings so I can fuck around with a uri as a thing… maybe I’m damaged… but we always want to fuck around with a uri more than just making it … But now I’ve got a new life, and it involves more JavaScript than one should consider reasonable … worst timeline

    Open ##3691978