2 ms·
A few months ago I read monomorphism is the way to go performance wise. Something about people writing fast code with Flow/TypeScript than with plain JavaScrip
by k__ 9y ago
A few months ago I read monomorphism is the way to go performance wise.
Something about people writing fast code with Flow/TypeScript than with plain JavaScript because the typing leads to less polymorphic code which is easier to optimize for the compiler.
- tom_mellior 9y agoIn this context, "monomorphism" just meant that OCaml requires you to write "+" to add integers and "+." to add floats (and yet other things to add bignums or whatever). This has nothing to do with performance per se. It doesn't make OCaml code faster than languages that allow you to write "+" for both int+int and float+float. The compiler knows anyway.