2 ms·
I think I’m functional languages, or more generally languages that require you to very carefully express your types, that you have to avoid dealing in JSON exce
by klysm 5y ago
I think I’m functional languages, or more generally languages that require you to very carefully express your types, that you have to avoid dealing in JSON except at the very edges of your program. If you do truly need dynamic content that can be a real pain but usually there is an okay way to express it - you just have to throw away the structure.
- square_usual 5y agoI'm okay with throwing away structure sometimes - it does make sense when, if you're at the point where you need to manipulate the output JSON while being abstract enough to not care about the input, I could see why you'd want to ignore it. But when the language syntax makes that hard or inelegant to do it's kind of a pain. As a point of comparison, ReasonML and ReScript both have great ways to express JS-like objects with types (OCaml, which both are based on, suffers from a slightly more verbose syntax), and TypeScript of course leads the way in making dynamic-ish objects still work. Ideally I'd find a functional language with row polymorphism that also had a great ecosystem, but that's asking for too much.
- Zababa 5y ago> Ideally I'd find a functional language with row polymorphism that also had a great ecosystem, but that's asking for too much. Your best bet here would be Rescript, OCaml or Purescript and leverage the JS ecosystem. There's also http://www.ocamljava.org/ http://www.ocamljava.org/, which seems to be not really active. I'm not sure if I would call any option great though.