@csepp mhmm, but how are types helping to make things generic, don't take make things NOT generic?
Top-level
@csepp mhmm, but how are types helping to make things generic, don't take make things NOT generic? 4 comments
@csepp damn, I guess I never really had to solve that sort of thing, I'm not sure I understand what you're asking me in the first question. @csepp I'm just ranting over here, but maybe all these people are solving problems I haven't had to contend with yet too. If that's the case it's a bit frustrating to see them take hits at projects that tackle different scales of problems that shouldn't be hindered by the tools they need for their scale of problems~ @neauoire In more concrete terms, you have code that only cares if its input can be indexed randomly, or maybe iterated in sequence. A simple example is something like grep. If it's generic enough, you could grep through RAM, or through messages streaming through a network socket. But yeah, some people just don't realize others have different needs. Favoring compiler simplicity is entirely valid if you want to self host on simple hardware. |
@neauoire Say you want to implement substring matching. How do you make sure it doesn't need to know about the in-memory layout of strings? Like, how will it work on both arrays and ropes?
You need to dispatch on the type of an argument at *some* point, either at compile time or at run time.
And sure, you can copy-paste the code, or reimplement it for each data structure, but human time is more important than computer time.