Is there an elephant in the room?

There is no simple answer to that. If we had a simple answer, we would not see 
the abundance of diverging RFCs, we would not see smth that I call the "master 
caution lamp effect" \- people tend to leave "suddenly and unexpected" the 
community, but the explanations they tell are not consistent (there are 
different reasons for everyone). Let's try it anyway:

  * Nim does not reify.



"Modern" PLs tend to be blurry. They programmer has to establish a framework 
primarily, after that he can go on and work on the specific task. The compiler 
then tends to generalize constantly, and to achieve this, the compiler will use 
or "abuse" the framework. Typically, the compiler will add some runtime for it 
(it should not be entitled to do so, but....) The programmer will end with a 
generalized and a specialized version of the program. Now, if programmer will 
rework the program, or combine it with another program, she will realize that 
the generalized part of the program is much more orthogonal (making less 
asssumptions) to the environment than the specialized part. This is an 
advantage.

But Nim is not blurry. Nim is razorsharp. It will not generalize, it will not 
add runtime at all. If the programmer then wants to generalize, there will be 
many possible generalizations at the same time. The programmer will be led 
astray and, at the very end, **will run into exhaustion.**

This is the "Nim drama". How to overcome this? Adding a nice new pragma? 
Waiting for IC?

Again, there is no simple answer/solution for that. We now have legacy. We 
can't do a soft restart. So, the divergence and the friction it causes, will be 
there to stay.

But there is a way out. The friction at the surface can be found in the 
compiler itself, the compiler being working against itself. If we change the 
underlying logic in the compiler, the friction will disappear. Unavoidably, we 
will have a split between Nim "as specified" and "Nim under the hood", the 
latter now working with an extended type system, GADTs (generalized algebraic 
datatypes) everywhere.

Reply via email to