4 ms·
Can you explain what about Nim's type system is not good?
by dom96 10y ago
Can you explain what about Nim's type system is not good?
- feduzi 10y agoIt is more an expression of confusion rather than type system quality evaluation, but why does JSON parser's implementation returns its own types like JsonNode? Why doesn't it just return core types like: * JSON String -> NIM String * JSON Object -> NIM Hash * and so on... I've also had the same question when looking at https://crystal-lang.org https://crystal-lang.org. PS: I do not claim Nim's type system to be bad as I do not have an exact counterexample of a "better" type system.
- dom96 10y agoBecause the type of a JSON object's fields is not known at compile-time. let s = parseJson("{'A': 'foo'}") s["A"] # What type is this? We don't know until we parse the JSON.
- deleted 10y ago[deleted]