last.tex 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. \begingroup
  2. \section{History}
  3. \paragraph{}
  4. The N2O was born in 2013 in spring. It's started as a process of
  5. reimplementation of Nitrogen Web Framework behavior for better
  6. performance and code reducing. The initial version had its own
  7. render core along with pure websocket nature of the IO protocol.
  8. \paragraph{}
  9. First official release of N2O was made in October 2013 when
  10. N2O was presented as one having AES/CBC pickling,
  11. REST transformations, own TeX handbook and
  12. JavaScript compiler. It is also known as version 0.10.
  13. \paragraph{}
  14. In this minor release BERT transformations mainly were improved using parse\_transform.
  15. Was introduced ETS caching. Tiny 50 LOC Makefile called {\bf otp.mk} was
  16. suggested for easy production deployment. It's still best option to deploy
  17. applications. It was release 0.11.
  18. \paragraph{}
  19. In January 2014 release xen hosting in LING VM
  20. was initially introduced. Dependencies
  21. start to freezing; asset and deploy options were improved.
  22. \paragraph{}
  23. April 2014 release was a giving hand to pure
  24. JavaScript SPA applications. Now pages could be served
  25. in nginx behind Erlang cowboy web server. Initial version of
  26. N2O protocol was introduced in this release. New twitter-format
  27. stack trace messages was added for error reporting. {\bf bert.js}
  28. was rewritten and jQuery was removed in this release. In 1.4 release
  29. was also introduced unified logging schema for KVS and N2O. And main
  30. WebSocket endpoint was totally rewritten to support N2O protocol.
  31. \paragraph{}
  32. The release of May 2014 is still supported. In this release
  33. new build tool {\bf mad} was initially introduced. Version 1.5.
  34. \newpage
  35. \paragraph{}
  36. August 2014 version 1.8 received new cookie session manager
  37. synchronized with ETS table where all entries zipped with session keys.
  38. Client binary requests was made to exists in {\bf bin} sub-protocol.
  39. KVS was first added to sample application in this release.
  40. Full HTML elements and attributes were added, which caused the growth of
  41. the nitrogen DSL size to the size of N2O.
  42. \paragraph{}
  43. September 2014 release was numbered 1.9.
  44. New client side protocol pipeline along with new {\bf n2o.js}.
  45. For mad was issued new dynamic loader
  46. which is able to host working directory inside ETS table and readable
  47. from erlang executable script on Windows, Linux and Mac. UTF-8 support
  48. was optimized in {\bf utf8.js}. New experimental {\bf rails} protocol and {\bf crashdump.io}
  49. logging backend module were added in version 1.9.
  50. \paragraph{}
  51. October 2014 version 1.10 was minor again. The only message in changelog
  52. were added: "nothing special". The first malfunction bug which was fixed is the
  53. racing which happened during async DOM bulding. Yes, N2O is faster than browser.
  54. \paragraph{}
  55. January 2015 version 2.1. Major Release. N2O book from now
  56. on can be purchased in a hardcover print. For business
  57. applications validations were introduced. {\bf n2o.js}, {\bf binary.js}, {\bf nitrogen.js},
  58. {\bf template.js} were slightly optimized. KJELL color support from now on enabled in
  59. new {\bf review} sample application.
  60. Log level support and several field and racing fixes in HTML elements.
  61. \paragraph{}
  62. March 2015 version 2.3. Initial Haskell implentation of N2O server is introduced.
  63. New N2O WebSocket protocol specification for all stack of {\bf synrc} and {\bf spawnproc} applications.
  64. New auto-expiring cookie-based session and cache managers. Revised and more sane XHR fallback.
  65. Automatic language detection from routes in context.
  66. Several element fixes and latest Cowboy 1.0.1.
  67. \newpage
  68. \begin{lstlisting}[caption=Bootstraping in a minute]
  69. $ ./mad app sample
  70. Create File: "sample/sys.config"
  71. Create File: "sample/apps/sample/priv/static/synrc.css"
  72. Create File: "sample/apps/sample/src/web_app.erl"
  73. Create File: "sample/apps/rebar.config"
  74. Create File: "sample/apps/sample/rebar.config"
  75. Create File: "sample/apps/sample/src/sample.app.src"
  76. Create File: "sample/apps/sample/src/index.erl"
  77. Create File: "sample/apps/sample/src/web_sup.erl"
  78. Create File: "sample/apps/sample/priv/static/spa/index.htm"
  79. Create File: "sample/rebar.config"
  80. Create File: "sample/apps/sample/priv/templates/index.html"
  81. Create File: "sample/apps/sample/src/routes.erl"
  82. $ cd sample
  83. $ time ./mad dep com pla
  84. ...
  85. Ordered: [kernel,stdlib,fs,cowlib,crypto,
  86. compiler,syntax_tools,ranch,gproc,
  87. cowboy,erlydtl,n2o,sample,active,mad,sh]
  88. real 0m41.901s
  89. user 0m17.785s
  90. sys 0m5.108s
  91. $ ./mad rep
  92. Configuration: [{n2o,[{port,8000},
  93. {route,routes},
  94. {log_modules,web_app}]},
  95. {kvs,[{dba,store_mnesia},
  96. {schema,[kvs_user,
  97. kvs_acl,kvs_feed,
  98. kvs_subscription]}]}]
  99. Applications: [kernel,stdlib,fs,cowlib,crypto,
  100. compiler,syntax_tools,ranch,
  101. gproc,cowboy,erlydtl,n2o,
  102. sample,active,mad,sh]
  103. Erlang/OTP 17 [erts-6.2] [source] [64-bit] [smp:4:4]
  104. [async-threads:10] [hipe] [kernel-poll:false]
  105. Eshell V6.2 (abort with ^G)
  106. 1>
  107. \end{lstlisting}
  108. \paragraph{}
  109. N2O is fast energy efficient binary protocol for IoT and WebSocket applications.
  110. I hope you will find this retrospective useful in your discovering of N2O.
  111. \newpage
  112. \section{Afterword}
  113. Hope you find \footahref{http://synrc.com/apps/n2o}{N2O},
  114. \footahref{http://synrc.com/apps/kvs}{KVS}, and
  115. \footahref{http://synrc.com/apps/mad}{MAD} stack small and concise,
  116. because it was the main goal during development.
  117. We stay with minimal viable functionality criteria.
  118. \paragraph{}
  119. N2O is free from unnecessary layers and code calls as much as possible.
  120. At the same time it covers all your needs to build
  121. flexible web messaging relays using rich stack of protocols.
  122. \paragraph{}
  123. Minimalistic criteria allows you to see the system's
  124. most general representation, which drives you to describe efficiently.
  125. You could be more productive by focusing on core.
  126. Erlang N2O and companion libraries altogether make
  127. your life managing web applications easy without
  128. efforts due to its naturally compact and simple design, and absence of code bloat.
  129. \paragraph{}
  130. You can see that parse\_transform is very useful, especially in JavaScript
  131. protocol generation (SHEN) and REST record-to-proplist generators. So having
  132. quote/unquote in language would be very useful. Fast and small
  133. Erlang Lisp (LOL) is expecting compiler is this field as universal
  134. Lisp-based macro system.
  135. \paragraph{}
  136. All apps in stack operate on its own DSL records-based language:
  137. N2O --- \#action/\#element; KVS --- \#iterator/\#container.
  138. This language is accessible directly from Erlang-based languages: Joxa, Elixir, Erlang, Lol.
  139. \paragraph{}
  140. We hope that this book will guide you in the wild world of Erlang web development
  141. and you will be enlightened by its minimalistic power.
  142. \endgroup