News for hackers. Stuff that matters.
Re:We don't need runtime type checks by paskozdilar on Thursday March 03, 2022 @03:23PM (#30546432)
I love Python because you can just do

    foo = "bar"
and be done with it. The interpreter knows it's a string variable. But I don't really care about runtime dynamic typing - I can't wait for Go to get parametric polymorphism, interfaces and runtime type dispatching can be quite clumsy. I would be perfectly fine with typed function arguments in a Pythonic language and being able to only call functions that fit the variable type (which is what I end up doing anyway with typehints and mypy).

I think Go made a right decision there - they kept the static typing but added a walrus := operator for automatic type inference. Every function has a type signature so the type inference algorithm is pretty trivial, and the language still feels like Python:

    result, err := FunctionThatMayFail()
Re:We don't need runtime type checks by kaba0 on Friday March 04, 2022 @04:26AM (#30552460)
Basic type inference has been around for decades, Go isn’t responsible for it. Haskell, scala, etc had it for a long time.
Re:We don't need runtime type checks by paskozdilar on Friday March 04, 2022 @01:23PM (#30558415)
>Basic type inference has been around for decades, Go isn’t responsible for it.

I never said it was.