Parameterised Modules in Erlang

前端 未结 2 1008
余生分开走
余生分开走 2020-12-16 06:00

I was going through mochiweb source code and got to see something i never used before. The module declaration especially in mochiweb_request and mochiweb_

2条回答
  •  再見小時候
    2020-12-16 06:20

    Question 1 is: Is it stable to use in production for now or i can wait till it is made official?

    It is very stable for production use and has been for some time now. It is not part of the official standard.

    Question 2 is: How did the mochiweb guys get the confidence of using it, if it is not yet official?

    You will have to ask the mochiweb guys for this. Perhaps they believe they can quickly change it if it was pulled.

    Question 3: Why is it not yet official? (because, to me, it brings some Object Oriented features in)

    Because it is littered with controversy. It is not clear what benefits it bring to the language and how it makes stuff easier to do, so P. Modules have its proponents and opponents. Hence, the current standpoint is that it is part of the implementation, so people can play with it and see if they feel it makes their code easier to read and write. The non-officiality means it can be pulled without deprecation though, and it seems as if the Erlang guys reserve that right.

    personal bias: I kind-of like it, but I won't ever be using it for getting OOP-features into Erlang. OOP is an ugly behemoth of utter crap that has no place in programming ever. It is just misery that will haunt your programs until they are rotten to the core, walking around like zombies and being mad. The only solution at that point is the shotgun. Rather, I'd like to use it as ML-style functors - which is more static in I feel it matches the idioms of Erlang better.

    Last Question: No where in the Erlang Docs have i found this feature talked about. No text book, Not even home. So how did those who have used it already find out how and why to use it? Has it already been included in the commercial version of the Erlang Run time system found here?

    The author presented the thing at an Erlang conference some years ago. Since then it has been a combination of word-of-mouth and so on.

提交回复
热议问题