index.html 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <!DOCTYPE html>
  2. <html >
  3. <head>
  4. <link rel=stylesheet type="text/css" href="https://synrc.com/synrc.css?v=1">
  5. <meta name="Author" content="5HT">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <meta property="og:image" content="images/s_64.png"/>
  8. <meta http-equiv="X-UA-Compatible" content="IE=IE10,chrome=1" />
  9. <title>MAD</title>
  10. </head>
  11. <body >
  12. <!--HEVEA command line is: hevea index.tex -o index.htm -->
  13. <!--CUT STYLE article--><!--HTMLHEAD-->
  14. <div class="nonselectedwrapper white" style="padding: 10px 0px 10px 0px;margin: 0px 0px 10px 0px;">
  15. <a href="//synrc.com/">
  16. <img style="float:left; margin-left: 55px; margin-top: 5px; margin-bottom:-5px;" src="http://synrc.com/images/synrc.png" border="0"></a>
  17. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" style="display:none;margin-top:39px;">
  18. <input type="hidden" name="cmd" value="_s-xclick">
  19. <input type="hidden" name="hosted_button_id" value="P8WQHAQK5HWWW">
  20. <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" style="width:74px;margin-top:0px;">
  21. </form>
  22. <div align=right style="float:right;width:700px;height: auto; margin: 20px 50px 0px 0px;">
  23. <script type="text/javascript">
  24. var args = (window.location).toString().split('/');
  25. var page_name = args[args.length-1];
  26. var menu = {'https://synrc.com/index.htm': 'Home',
  27. 'https://synrc.com/research.htm': 'Showcase',
  28. 'https://synrc.com/apps/': 'Apps',
  29. 'https://synrc.com/feedback.htm': 'Contacts', };
  30. Object.keys(menu).forEach(function (key) {
  31. if (page_name == key) { document.write('<div class="menu" style="font-weight: bold;">'+menu[key]+'</div>'); }
  32. else { document.write('<a class="menu" href="'+key+'">'+menu[key]+'</a>'); }
  33. });
  34. </script>
  35. </div>
  36. </div>
  37. <hr size="1">
  38. <!--ENDHTML-->
  39. <!--CUT DEF section 1 --><div class="nonselectedwrapper">
  40. <div class="article">
  41. <div class="toc">
  42. <!--TOC section id="sec1" TOC-->
  43. <h2 id="sec1" class="section">TOC</h2><!--SEC END -->
  44. <!--TOC paragraph id="sec2" -->
  45. <!--SEC END --><p>
  46. <a href="https://synrc.com/apps/mad/doc/web">Overview</a> <br>
  47. <a href="https://synrc.com/apps/mad/doc/web/setup.htm">1. Setup</a> <br>
  48. <a href="https://synrc.com/apps/mad/doc/web/deps.htm">2. Deps</a> <br>
  49. <a href="https://synrc.com/apps/mad/doc/web/config.htm">3. Configuration</a> <br>
  50. <a href="https://synrc.com/apps/mad/doc/web/commands.htm">4. Commands</a> <br>
  51. <a href="https://synrc.com/apps/mad/doc/web/bundles.htm">5. Bundles</a> <br>
  52. <a href="https://synrc.com/apps/mad/doc/book.pdf">Download PDF</a> <br>
  53. </p></div>
  54. <div class="articlecol">
  55. <!--TOC section id="sec3" MAD: Erlang Containers-->
  56. <h2 id="sec3" class="section">MAD: Erlang Containers</h2><!--SEC END -->
  57. <!--TOC subsection id="sec4" Purpose-->
  58. <h3 id="sec4" class="subsection">Purpose</h3><!--SEC END --><p>
  59. We were trying to make something minimalistic that fits out <a href="https://github.com/synrc">application stack</a>.
  60. The main idea of mad is to provide clean and simple rebar-like fast dependency manager that
  61. is able to build several types of packages and provides interface of containered deployments
  62. to virtualiezed environments.</p>
  63. <!--TOC subsection id="sec5" Several Types of Packaging-->
  64. <h3 id="sec5" class="subsection">Several Types of Packaging</h3><!--SEC END --><p>
  65. The key feature of mad is ability to create single-file bundled web sites.
  66. This target escript is ready to run on Windows, Linux and Mac.</p>
  67. <!--TOC subsection id="sec6" Deployment Options-->
  68. <h3 id="sec6" class="subsection">Deployment Options</h3><!--SEC END --><p>
  69. As a deploy tool mad is also supposed to launch, start, stop and manage containers, locally or remote.
  70. You can make containers from different type of packages, like making runc container with beam release.</p>
  71. <!--TOC subsection id="sec7" OTP Compliant-->
  72. <h3 id="sec7" class="subsection">OTP Compliant</h3><!--SEC END --><p>
  73. Mad supports ERTS boot files generation with systools and erlang application format used by OTP.
  74. This is the main format of application repository. Also boot files are suported on both LING and BEAM.</p>
  75. <!--TOC subsection id="sec8" Tiny Size-->
  76. <h3 id="sec8" class="subsection">Tiny Size</h3><!--SEC END --><p>
  77. And the good part:</p><div class="lstlisting"> Sources Binary
  78. mad 967 LOC 52 KB
  79. rebar 7717 LOC 181 KB</div>
  80. <!--TOC subsection id="sec9" History-->
  81. <h3 id="sec9" class="subsection">History</h3><!--SEC END --><p>We came to conclusion that no matter how perfect your libraries are,
  82. the comfort and ease come mostly from developing tools.
  83. Everything got started when <a href="https://github.com/proger">Vladimir Kirillov</a> decided to
  84. replace Rusty’s sync beam reloader. As you know sync uses
  85. filesystem polling which is neither energy-efficient nor elegant. Also
  86. sync is only able to recompile separate modules while
  87. common use-case in N2O is to recompile DTL templates
  88. and LESS/SCSS stylesheets. That is why we need to recompile
  89. the whole project. That’s the story how <a href="https://github.com/synrc/active">active</a> emerged.
  90. Under the hood active is a client subscriber
  91. of <a href="https://github.com/synrc/fs">fs</a> library, native filesystem listener for Linux, Windows and Mac.</p><p>De-facto standard in Erlang world is rebar.
  92. We love rebar interface despite its implementation.
  93. First we plugged rebar into active and then decided to drop its support,
  94. it was slow, especially in cold recompilation.
  95. It was designed to be a stand-alone tool, so it has some
  96. glitches while using as embedded library.
  97. Later we switched to Makefile-based build tool <a href="https://github.com/synrc/otp.mk">otp.mk</a>.</p><p>The idea to build rebar replacement was up in the air for a long time.
  98. The best minimal approach was picked up by <a href="https://github.com/s1n4">Sina Samavati</a>,
  99. who implemented the first prototype called ’mad’. Initially mad
  100. was able to compile DTL templates, YECC files, escript (like
  101. bundled in gproc), also it had support for caching with side-effects.
  102. In a month I forked mad and took over the development under the same name.</p><div class="center">Listing 1: Example of building N2O sample</div><p><br>
  103. </p><div class="lstlisting"> Cold Hot
  104. rebar get-deps compile 53.156s 4.714s
  105. mad deps compile 54.097s 0.899s</div><div class="center">Listing 2: Example of building Cowboy</div><p><br>
  106. </p><div class="lstlisting"> Hot
  107. make (erlang.mk) 2.588s
  108. mad compile 2.521s</div><p>
  109. <br><br>
  110. <h2><a name="testimonials"><b>About MAD</b></a></h2><blockquote>At the beginning, Mad was supposed to be only a Rebar-compatible dependency manager, after a while,
  111. I realized compiling applications as fast as possible with it could be a fascinating work as well.
  112. <div align=right>Sina Samavati,
  113. <a href="https://github.com/s1n4">Original MAD Author</a></div></blockquote>
  114. <!--div id="disqus_thread"></div>
  115. <script type="text/javascript">
  116. var disqus_shortname = 'synrc'; // required: replace example with your forum shortname
  117. (function() {
  118. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  119. dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
  120. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  121. })();
  122. </script>
  123. <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
  124. <a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a-->
  125. </p></div>
  126. </div>
  127. </div><div class="clear"> </div><!--CUT END -->
  128. <!--HTMLFOOT-->
  129. <div class="nonselectedwrapper">
  130. <div class="verywidecol">
  131. <div style="width:100%;height:300px;float:left;font-size:16pt;" align=center>
  132. <hr size=1>
  133. <br><br><br>
  134. <a href="//synrc.com/news/index.htm">Events</a> |
  135. <a href="//synrc.com/privacy.htm">Privacy Policy</a> |
  136. <a href="//synrc.com/feedback.htm">Feedback</a> |
  137. <a href="//synrc.com/brandbook.htm">Brandbook</a><br>
  138. Copyright &copy; 2005&ndash;2016 <a href="//synrc.com/index.htm"> Synrc Research Center s.r.o.</a>
  139. </div>
  140. </div>
  141. </div>
  142. <div class="clear"></div>
  143. <script type="text/javascript">
  144. var _gaq = _gaq || [];
  145. _gaq.push(['_setAccount', 'UA-29227518-1']);
  146. _gaq.push(['_trackPageview']);
  147. (function() {
  148. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  149. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'https://www') + '.google-analytics.com/ga.js';
  150. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  151. })();
  152. </script>
  153. <script type="text/javascript" src="https://synrc.com/hi.js"></script>
  154. <!--ENDHTML-->
  155. </body>
  156. </html>