<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 13, 2014 at 10:51 AM, Garrett Smith <span dir="ltr"><<a href="mailto:g@rre.tt" target="_blank">g@rre.tt</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sigh. This *is* confusing. It just is.<br>
<br>
Loïc you *cannot* use Erlang without OTP. The VM starts a system,<br>
which consists of applications, which are supervisory trees of<br>
gen_servers.<br></blockquote><div><br></div><div>This is wrong - you can use Erlang without OTP.</div><div><br></div><div>OTP loads 60 odd modules, starts a code server and some other stuff and *then* executes your code.</div>
<div><br></div><div>You can "easily" roll your own system that uses far fewer modules and gets you up</div><div>and running, but then you don't get the shell, the code loader and a load of other goodies.</div>
<div><br></div><div>Appendix 3 of the 2'nd edition of Programming Erlang tells you *exactly* how to do this.</div><div><br></div><div>To summarise Appendix 3 - I load 3 modules in 20ms instead of the 1.1s Erlang + OTP takes (on the same machine) then you're up and running, not OTP but a with a code loader and simple I/O system.</div>
<div><br></div><div>Supervisors are *easily* made with a combination of links/monitors and trapping exits.</div><div><br></div><div>OTP was designed for teams of programmers, so that they would all write their code the same</div>
<div>way and use common tools for code loading, error logging, supervision and so on.</div><div><br></div><div>There is absolutely nothing stopping you from supervising and restarting programs using</div><div>spawn_link and trapping exits.</div>
<div><br></div><div>The relationship between Erlang and OTP is like C and unix. Unix is an OS written in C.</div><div>OTP is some middleware written in Erlang.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Supervisors are gen_servers btw.<br>
<br>
If you think OTP is optional, look at the first two lines of kernel.erl:<br>
<br>
-module(kernel).<br>
-behaviour(supervisor).<br></blockquote><div><br></div><div>But you don't need to load kernel.erl to run erlang programs - OTP needs to load kernel.erl</div><div>My stand-alone system does not need this. The only *critical* modules are error_handler.erl</div>
<div>and lists.erl</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Historically, OTP libraries came after Erlang the language, of course,<br>
but this so called OTP "framework" is now endemic to Erlang.<br></blockquote><div><br></div><div>Yes - there were two other middlewares *before* OTP</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What sucks IMO is that OTP is treated as "advanced" by the community<br>
and by book authors. I understand the history of this, but there's a<br>
cost: programmers delay learning core Erlang principles of<br>
*applications* -- i.e. supervisor trees -- because it's not taught up.<br>
It's also incredibly complicated, if you don't use e2.<br></blockquote><div><br></div><div>It's not incredibly complicated :-)<br></div><div><br></div><div>Applications and supervisor trees are not core concepts of Erlang - Erlang (the language)</div>
<div>has not a clue what an application or a supervision tree is. Applications and supervisors are</div><div>core concepts of OTP not Erlang.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The irony is that *advanced* Erlang programmers can get away<br>
programming outside the OTP guard rails. Beginners should not even<br>
consider doing this until they understand why OTP works and why they<br>
should deviate.<br></blockquote><div><br></div><div>No - beginners should start with spawn and spawn_link then learn to trap exits</div><div>and then learn that they can replace a lot of simple boilerplate code with the</div>
<div>OTP equivalents.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
e2 helps, a lot.<br>
<br>
The whole point of e2 is to simplify the correct use of OTP -- letting<br>
programmers *start* with applications, supervisors and gen_servers (in<br>
e2 they're called services and tasks -- simple huh). I know it's<br>
controversial, but it's controversial to those who have been teaching<br>
Erlang while this stuff was being baked. I don't run into new learners<br>
who object to starting with OTP using e2 (though maybe they're just<br>
being polite -- if you're out there and had problems learning with e2,<br>
please drop me a line, or yell at me here).<br></blockquote><div><br></div><div>Actually you could layer e2 on top of a primitive bootstrap (read my book for details).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I agree wholeheartedly with Pieter. It's just Erlang. Keeping the term<br>
OTP is a historic vestige. We're used to it, but it's a dead weight<br>
that adds only confusion.<br></blockquote><div><br></div><div>I think the problem with the name OTP is that is embedded in a load of books</div><div>and documentations. Change the names and you invalidate the documentation.</div>
<div><br></div><div>Change the names and you lose backwards compatibility</div><div><br></div><div>Cheers</div><div><br></div><div>/Joe</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The Ruby / Rails comparison is not accurate. It's more like Rails 1.0<br>
/ Rails 2.0.<br>
<br>
Sadly though, I just don't see "OTP" going away because there's a<br>
trickle of noise from this list :|<br>
<br>
I make videos to cope.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Feb 13, 2014 at 2:54 AM, Ivan Uemlianin <<a href="mailto:ivan@llaisdy.com">ivan@llaisdy.com</a>> wrote:<br>
> On 13/02/2014 08:13, Pieter Hintjens wrote:<br>
>><br>
>> ... (a) stop using OTP as a<br>
>> confusing and needless synonym for Erlang, ...<br>
><br>
><br>
> Is that what OTP is used as? I thought OTP was a set (or framework, or<br>
> platform) of libraries (behaviours, supervision, etc.) that facilitate the<br>
> development of highly scalable and reliable applications (telecoms-grade<br>
> scalability and reliability you might say). AFAIK it's open-source.<br>
><br>
> Yes, let's rename it to something that more closely reflects what it really<br>
> is. How about the "Open-source Telecoms-grade reliability and scalability<br>
> Platform"?<br>
><br>
> Ivan<br>
><br>
><br>
> --<br>
> ============================================================<br>
> Ivan A. Uemlianin PhD<br>
> Llaisdy<br>
> Speech Technology Research and Development<br>
><br>
> <a href="mailto:ivan@llaisdy.com">ivan@llaisdy.com</a><br>
> <a href="http://www.llaisdy.com" target="_blank">www.llaisdy.com</a><br>
> <a href="http://llaisdy.wordpress.com" target="_blank">llaisdy.wordpress.com</a><br>
> <a href="http://github.com/llaisdy" target="_blank">github.com/llaisdy</a><br>
> <a href="http://www.linkedin.com/in/ivanuemlianin" target="_blank">www.linkedin.com/in/ivanuemlianin</a><br>
><br>
> festina lente<br>
> ============================================================<br>
><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div>