{"id":1363,"date":"2021-07-20T06:38:46","date_gmt":"2021-07-20T06:38:46","guid":{"rendered":"https:\/\/blog.amt.in\/?p=1363"},"modified":"2021-07-20T06:38:46","modified_gmt":"2021-07-20T06:38:46","slug":"introduction-to-elixir","status":"publish","type":"post","link":"https:\/\/blog.amt.in\/index.php\/2021\/07\/20\/introduction-to-elixir\/","title":{"rendered":"Introduction to Elixir"},"content":{"rendered":"<p>Elixir is a dynamic, functional language designed for building scalable and maintainable applications. It\u00c2\u00a0is a\u00c2\u00a0functional,\u00c2\u00a0concurrent, general-purpose\u00c2\u00a0programming language\u00c2\u00a0that runs on the\u00c2\u00a0Erlang\u00c2\u00a0virtual machine\u00c2\u00a0(BEAM). Elixir builds on top of Erlang and shares the same abstractions for building distributed, fault-tolerant applications. Elixir also provides a productive tooling and an extensible design. The latter is supported by compile-time\u00c2\u00a0meta-programming\u00c2\u00a0with\u00c2\u00a0macros\u00c2\u00a0and\u00c2\u00a0polymorphismvia protocols.<\/p>\n<p>Jos\u00c3\u00a9 Valim is the creator of the Elixir programming language, an R&amp;D project of\u00c2\u00a0Plataformatec. His goals were to enable higher extensibility and productivity in the Erlang VM while keeping compatibility with Erlang&#8217;s ecosystem.<\/p>\n<p>All Elixir code runs inside lightweight threads of execution (called processes) that are isolated and exchange information via messages.\u00c2\u00a0Due to their lightweight nature, it is not uncommon to have hundreds of thousands of processes running\u00c2\u00a0concurrently\u00c2\u00a0in the same machine. Isolation allows processes to be garbage collected independently, reducing system-wide pauses, and using all machine resources as efficiently as possible (vertical scaling).<\/p>\n<p>Processes are also able to communicate with other processes running on different machines in the same network. This provides the foundation for distribution, allowing developers to coordinate work across multiple nodes (horizontal scaling).<\/p>\n<p>Elixir is used by companies such as E-MetroTel,\u00c2\u00a0Pinterest and\u00c2\u00a0Moz.\u00c2\u00a0Elixir is also used for web development, by companies such as\u00c2\u00a0Bleacher Report,\u00c2\u00a0Discord, and Inverse,\u00c2\u00a0and for building embedded systems.\u00c2\u00a0The community organizes yearly events in United States, Europe\u00c2\u00a0and Japan\u00c2\u00a0as well as minor local events and conferences.<\/p>\n<p>Some of the features of Elixir are as follows:<\/p>\n<ul>\n<li>A language that\u00c2\u00a0compiles\u00c2\u00a0to\u00c2\u00a0bytecode\u00c2\u00a0for the\u00c2\u00a0Erlang\u00c2\u00a0Virtual Machine (BEAM)<\/li>\n<li>Everything is an\u00c2\u00a0expression<\/li>\n<li>Erlang functions can be called from Elixir without\u00c2\u00a0run time\u00c2\u00a0impact, due to compilation to Erlang bytecode, and vice versa<\/li>\n<li>Meta programming allowing direct manipulation of\u00c2\u00a0AST<\/li>\n<li>Polymorphism\u00c2\u00a0via a mechanism called protocols. Like in\u00c2\u00a0Clojure, protocols provide a\u00c2\u00a0dynamic dispatch\u00c2\u00a0mechanism. However, this is not to be confused with\u00c2\u00a0multiple dispatch\u00c2\u00a0as Elixir protocols dispatch on a single type.<\/li>\n<li>Support for documentation via Python-like docstrings in the Markdown formatting language<\/li>\n<li>Shared nothing concurrent programming\u00c2\u00a0via message passing (Actor model)<\/li>\n<li>Emphasis on\u00c2\u00a0recursion\u00c2\u00a0and\u00c2\u00a0higher-order functions\u00c2\u00a0instead of\u00c2\u00a0side-effect-based\u00c2\u00a0looping<\/li>\n<li>Lightweight concurrency utilizing Erlang&#8217;s mechanisms<\/li>\n<li>Railway oriented programming via the\u00c2\u00a0<code>with<\/code>\u00c2\u00a0construct<\/li>\n<li>Built-in tooling\u00c2\u00a0for managing dependencies, code compilation, running tests, formatting code, remote debugging and more<\/li>\n<li>Lazy\u00c2\u00a0and\u00c2\u00a0async collections\u00c2\u00a0with streams<\/li>\n<li>Pattern matching\u00c2\u00a0to promote assertive code<\/li>\n<li>Unicode\u00c2\u00a0support and\u00c2\u00a0UTF-8\u00c2\u00a0strings<\/li>\n<\/ul>\n<p>The above is a brief about Elixir complied from various sites. Watch this space for more updates on the latest trends in Technology.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elixir is a dynamic, functional<\/p>\n","protected":false},"author":1,"featured_media":1365,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[181,154,7],"tags":[183,156,18],"class_list":["post-1363","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-elixir","category-programming-language","category-techtrends","tag-elixir","tag-programming-language","tag-technology"],"_links":{"self":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":1,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"predecessor-version":[{"id":1366,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/posts\/1363\/revisions\/1366"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media\/1365"}],"wp:attachment":[{"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amt.in\/index.php\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}