News for hackers. Stuff that matters.
Re:Nim Language Draws from Best of Python, Rust, Go, and Lisp by dom96 on Tuesday February 21, 2017 @05:24AM (#13694607)
Can you explain what about Nim's type system is not good?
Re:Nim Language Draws from Best of Python, Rust, Go, and Lisp by feduzi on Tuesday February 21, 2017 @05:39AM (#13694658)
It 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.

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.

Re:Nim Language Draws from Best of Python, Rust, Go, and Lisp by dom96 on Tuesday February 21, 2017 @07:17AM (#13694938)
Because 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.