3 ms·
I've been considering Rust (or Swift) for webapp backend, but these cons are spot on: Named parameters are missing, and one can't build natural looking JSON val
by Ciantic 11y ago
I've been considering Rust (or Swift) for webapp backend, but these cons are spot on: Named parameters are missing, and one can't build natural looking JSON validation if one can't nest them nicely.
Swift looks promising though, if a bit in flux.
I've been ramming my head against Scala lately, and while it's nice at times I would like to have compiled language.
- philippnagel 11y agoDid you check out D (http://dlang.org http://dlang.org) yet?
- Ciantic 11y agoNot seriously, maybe I should. I know it has some crazy good macro support if I'm correct, this should allow some nice libraries. Though my first problem with any language is: Does it have type safe SQL builder? Scala has Slick and Quill, and lesser extent JOOQ. Rust has Diesel (not sure how good). It's pointless to start stringly type the database, when pretty much every backend call needs to access it.
- kazagistar 11y agoCould you show an example of what you mean by "natural looking JSON validation"? I am not sure I have seen what you are referring to.
- Ciantic 11y agoI think succint is the word I want. Nested validation logic that looks like the object you are validating. Unfortunately Play docs are not succint, but you may get the idea from here: https://www.playframework.com/documentation/2.3.x/ScalaJsonCombinators https://www.playframework.com/documentation/2.3.x/ScalaJsonC... I tried to implement similar (typesafe) myself using TypeScript: https://github.com/Ciantic/model-validation https://github.com/Ciantic/model-validation there are certain problems I hit with TypeScript, and also I don't want my backend to be JavaScript so I've stopped working on it.
- fierycatnet 11y agoThere's Clojure too, if you are into that. Check this out http://codahale.com/a-small-nice-thing/ http://codahale.com/a-small-nice-thing/