News for hackers. Stuff that matters.
Re:Pyston v2: Faster Python by mrtranscendence on Wednesday October 28, 2020 @04:33PM (#24923807)
I'll be honest, as someone whose non-Python programming (paltry as it is) is mostly done in statically-typed functional languages, I have a bit of a bias against Go for the whole generics thing. I'll give it a closer look at some point.
Re:Pyston v2: Faster Python by omginternets on Wednesday October 28, 2020 @05:10PM (#24924192)
I gotta be honest, the lack of generics has never bothered me.

The type-assertion escape hatch has always been largely sufficient for all but the most performance-critical projects (of which I have exactly 1, and it was a side project), and runtime panics due to failed assertions are quite easy to eliminate via wrapper types.

My advice: just go for it. You almost certainly won't miss generics.

(Edit: I've broken my own rule and given advice without first asking what kind of programming you do. My assertion holds for most run-of-the-mill stuff, e.g. writing REST interfaces, network servers, etc. If you're within 2-sigma of the industry, you won't miss generics.)

Re:Pyston v2: Faster Python by throwaway894345 on Wednesday October 28, 2020 @09:48PM (#24926216)
I understand; lots of people have this sentiment. It’s an inconvenience in many cases, but we’re comparing it against Python, which has no type safety at all much less generics (apart from Mypy, which has many, many other issues).
Re:Pyston v2: Faster Python by pjmlp on Thursday October 29, 2020 @03:12AM (#24928052)
All dynamic languages are generic by default.
Re:Pyston v2: Faster Python by throwaway894345 on Thursday October 29, 2020 @07:42AM (#24929435)
If that's how you define "generic", then Go is also generic by virtue of `interface{}`.
Re:Pyston v2: Faster Python by pjmlp on Thursday October 29, 2020 @08:26AM (#24929728)
No, because interface{} in an empty type that needs to be type cast to the actual type before use.

Dynamic languages do that implicitly.

Implement max in Go with interface{} without casts and reflection:

   def max(a, b):
     if a >= b:
        a
     else:
        b
Re:Pyston v2: Faster Python by throwaway894345 on Thursday October 29, 2020 @10:30AM (#24930820)
I'm not aware of any definition of 'generic' that prohibits casting. It certainly seems like a very arbitrary condition. Basically I'm familiar with two definitions:

1. The abstract idea of writing an algorithm that supports a variety of types. This allows for casting, reflection, dynamic typing, etc.

2. The specific idea of a type system that allows for parameterized types (aka "typesafe generics"). This definition excludes castng, reflection, and dynamic typing.

Typically "typesafe generics" is what people talk about when they discuss "generics", but since you chose to pick the "dynamically typed languages are generic" nit, I assumed you were talking about (1).