3 ms·
What does the implementation look like under the hood? What are the limitations of your approach (i.e. generic interfaces) and are they fundamental or just on t
by politician 8y ago
What does the implementation look like under the hood? What are the limitations of your approach (i.e. generic interfaces) and are they fundamental or just on the todo list?
- deckar01 8y agoHere are a couple diffs that leave out the copied code: https://github.com/albrow/fo/compare/faf3c9f96a8ecd9d17ca968deff8e91bbb1a70fc...f9ce4c22557028f969d9b4292b3dac0f1b7f05e7 https://github.com/albrow/fo/compare/faf3c9f96a8ecd9d17ca968... https://github.com/albrow/fo/compare/f76c531f839e5e76e5f6b7f424943cf45b823e06...master https://github.com/albrow/fo/compare/f76c531f839e5e76e5f6b7f...
- webkike 8y agoIt's very likely monomorphizing the types, i.e. creating a unique type for each generic invocation.
- polymathist 8y agoThe Fo compiler parses and type-checks Fo source code and then generates and outputs Go code. It generates a unique concrete type for each usage of a generic type. You can look at the examples directory of the repo to see what this output looks like: https://github.com/albrow/fo/tree/master/examples/box https://github.com/albrow/fo/tree/master/examples/box. Generic interfaces are pretty fundamental IMO. It's something I plan to add to the language before the v1 release.