[erlang-questions] A proposal for Unicode variable and atom names in Erlang.

Max Bourinov <>
Mon Oct 22 14:20:09 CEST 2012


Hi guys,

Just an idea: If you want to have Unicode in your code. There is always
working solution that doesn't require to touch Erlang anyhow. You need to
setup a pre-compile hook that will run kind off parse-transform tool (PTT)
that will pre-process code and replace Unicode parts of ut to currently
allowed set of chars. Of course in CRASH DUMPS you will see replaced atoms,
but PTT can generate replacement table so, you can refer to the original
Unicode value.

Yes, it is not very nice build-in Unicode support, but you can implement it
right now! :-)

My 1 cent.

Best regards,
Max




On Mon, Oct 22, 2012 at 3:55 PM, HH Veldstra <>wrote:

> On Mon, Oct 22, 2012 at 12:33 PM, Jesper Louis Andersen
> <> wrote:
> >
> > On Oct 22, 2012, at 11:24 AM, HH Veldstra <>
> wrote:
> >
> >> +1. Outwith very specific circumstances allowing non-English code is
> >> dumb if for no other reason that it will drastically reduce the pool
> >> of programmers that can be hired to work on your system.
> >
> > Not all unicode symbols are meant to be for foreign languages. There are
> some symbols which would be nice
> > to use in your programs. Some of the more mathematical code tend to use
> lots of greek symbols for instance. If you can name your variable with the
> right symbol, it becomes more readable since it is closer to what the paper
> writes.
> >
> > But to be really powerful you need ways to infix operators as well, so
> you can write ⊕ for 'xor' and so on.
>
> This might be off-topic now, but rather than modifying the core of a
> language for something that is of no clear benefit 99.99% of the time,
> one would be better off configuring their editor to handle the case
> you've described. This for Emacs for instance:
> http://www.emacswiki.org/emacs/PrettyLambda It has the benefit of not
> interfering with how other people like to see the code, and it takes
> way less time to set up than it is to even argue about the subject of
> this thread, much less wait for the suggestions to be implemented.
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121022/918e6bf0/attachment.html>


More information about the erlang-questions mailing list