News for hackers. Stuff that matters.
Re:Show HN: Fo: An experimental language which adds generics... by pionar on Tuesday June 12, 2018 @04:00PM (#17297416)
Generics (when used/implemented correctly) provide way more than just elimination of type assertions. It provides compile-time type safety, rather than runtime safety. It also provides elimination of the overhead (which isn't trivial, reflection is not inconsequential) and boilerplate code. It also allows you to use the same function/method for many different types without having to resort to boxing everything to an interface/object.
Re:Show HN: Fo: An experimental language which adds generics... by eropple on Tuesday June 12, 2018 @04:34PM (#17297719)
Depending on the implementation, too, generics can be more friendly in other ways. C# emits code for both value types and reference types when appropriate and uses the correct paths as needed.