News for hackers. Stuff that matters.
Re:Show HN: Fo: An experimental language which adds generics... by thanatos_dem on Tuesday June 12, 2018 @03:08PM (#17296813)
Noooooo! interface{} is a raw type. It’s like “Object” in java land. It has no meaning in its own right, and needs to be carefully checked whenever you want to actually use it. The proliferation of interface{} across the go ecosystem is really unfortunate, and will be hard to correct once generics are finally supported.

I haven’t dug too far into the Fo code yet, but I’d guess that it’s doing something akin to type erasure in Java, and adding conversions and type checks transparently when compiling down to a go binary. Sort of like how if you ever pop open a class file and dig into it, you’ll never see any references to generics. Everything compiles down to objects in the end with generated type checks.

Re:Show HN: Fo: An experimental language which adds generics... by weberc2 on Tuesday June 12, 2018 @07:00PM (#17298866)
Well, it is in the literal sense that it enables generic algorithms, just like the one, unnamed static type in all dynamic languages. But of course this is pedantry and no one really means this when talking about generics.