Email or username:

Password:

Forgot your password?
Top-level
Csepp 🌢

@neauoire I partially agree with this, but it feels like it contradicts something you linked to recently: "Any part of the system that cannot be changed or that is not sufficiently general is a likely source of impediment."
permacomputing.net/human-scale

How do you make a procedure generic without using types of some sort?

Making code reusable is a necessity if you don't want users of the language to be doing pointless busywork instead of solving their real-life problems with code.

5 comments
Devine Lu Linvega

@csepp mhmm, but how are types helping to make things generic, don't take make things NOT generic?

Csepp 🌢

@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.

Devine Lu Linvega

@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.

Devine Lu Linvega

@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~

Csepp 🌢

@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.

Go Up