[erlang-questions] Erlang and syntax.

Maxim Velesyuk loz.accs@REDACTED
Sat Feb 22 21:33:08 CET 2014


>Sure macros allow you to write less code. But I spend 90% of my time
reading code, so I like programs that are optimized for my reading. If I
always need to refer to some other source file or document to understand
what the code is doing, then I am not going to be using your program very
long.

But when you see unknown function you still have no idea what it does and
you have to figure it out. Any abstraction works in same way.

>And then one person creates maps, another creates frames, both with the
same or similar syntax but with different semantics, both get used in the
same system, and the code is completely unreadable. No thanks.

Macros are dangerous as much as powerful. If programmer does not use them
correctly its a programmer's fault. In the end who is the target audience
of a programming language for concurrent, fault tolerant systems? Probably
the programmer who understands what he does. Should language designer force
programmer to write code in 'correct' way? I don't know, but valuable
spaces and programming patterns appeared from such ideas.

>You don't need it.

Who but the particular programmer can decide what does he need and what
doesn't ?


2014-02-22 21:46 GMT+04:00 Loïc Hoguin <essen@REDACTED>:

> Hello,
>
>
> On 02/22/2014 10:14 AM, Maxim Velesyuk wrote:
>
>> Often when I feel I need to change ast I remember how clumsy and
>> uncomfortable parse transform is, so I overcome myself and make
>> workarounds.
>>
>
> Why do you even feel the need to change the AST? Don't do that.
>
>
>  But macros are still useful, programmers use parse transform when they
>> have no other choice, and projects like merl appear.
>>
>
> Macros are not useful. Macros are what makes a perfectly readable program
> into the worst spaghetti code you have ever seen. Even EPP macros, which
> look pretty harmless as they have very limited capabilities, can make
> things a lot worse than it needs to be.
>
> Sure macros allow you to write less code. But I spend 90% of my time
> reading code, so I like programs that are optimized for my reading. If I
> always need to refer to some other source file or document to understand
> what the code is doing, then I am not going to be using your program very
> long.
>
> Macros make your programs worse than PHP and Java combined.
>
>
>  List and zip comprehensions could be implemented as macros, ets and
>> mnesia query language is actually prefix-notation language with code
>> quoting, even pattern matching and so long expected maps could be just a
>> libraries.
>>
>
> And then one person creates maps, another creates frames, both with the
> same or similar syntax but with different semantics, both get used in the
> same system, and the code is completely unreadable. No thanks.
>
>
>  Take a look at c++ and java, how they suffer from inventing new syntax.
>> Hopefully Erlang will not turn in such syntax-monster. It has syntax for
>> many things, but it still not as flexible as it could be.
>>
>> This forwards me back to my first question, why?
>>
>
> You don't need it.
>
> --
> Loïc Hoguin
> http://ninenines.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140223/85c215b4/attachment.htm>


More information about the erlang-questions mailing list