Nobody understands templates?

bearophile bearophileHUGS at lycos.com
Tue Mar 4 18:00:21 PST 2014


Nick Sabalausky:

> But, I admit, I have wondered if a language could aid the 
> creation/usage of entity systems with some special language 
> features.

I have seen that a good way to learn lazyness and purity is to 
try to write some Haskell code. Then you can use the same ideas 
in other languages, like D. Similarly I've studied regular 
expressions in dynamic languages, and now I am able to use them 
in Java, C#, D, etc.

So I've seen that it's good to learn a feature/style in a 
language that uses it a lot, or even in a language designed 
around such feature. Because languages shape your mind, and 
specialized languages train your mind to use few specific 
features. Later in real-world situations often you can't use such 
specialized/esoteric/rare language, and you have to use a common 
language as Java. And sometimes if people use a feature a lot in 
other languages, eventually it gets ported even to the common 
languages (like lambdas in Java).

So even if you can't or you don't want to use a new language to 
use entity systems, training your mind a bit thinking in a new 
language designed for it could help use it in a common language, 
or could even suggest you few features to add to a more general 
purpose language as D.

Wouter van Oortmerssen shows very well that designing many small 
specialized languages helps you sharpen your mind and later you 
apply those ideas to more general situations:
http://strlen.com/language-design-overview

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list