[E-Lang] Name mangling
Ravi Pandya
ravi@iecommerce.com
Mon, 21 May 2001 10:56:23 -0700
I am working on integrating E as a scripting language for a fair-sized
system written in Java, and I have run into an unpleasant side effect of the
Python-inspired name mangling (e.g. "op__add(x)" instead of "add(x)"). There
are some classes that I'd like to use operator syntax in E, but a lot of
code will also be using them in Java. The mangled names will make the
Java-only code look quite ugly, unless I take on the task of maintaining two
sets of method names.
I can see the reasons for copying the Python classifications and formalisms
for the operators, assuming they have been well thought out and have stood
the test of time. However, I don't see a strong reason for adopting their
double-underscore name mangling convention, especially since (a) it is not
being adopted exactly, and (b) the probability of automated translation from
Python to E is essentially zero. The one reason could be that the more
ordinary names are more likely to cause a conflict with existing code, but I
think any existing usage is likely to be very similar to the E usage if the
names are well chosen, and the code readability argument seems more
compelling to me.
Ravi