{"id":277,"date":"2011-03-02T22:06:33","date_gmt":"2011-03-02T21:06:33","guid":{"rendered":"http:\/\/trigonakis.com\/blog\/?p=277"},"modified":"2011-03-14T22:45:14","modified_gmt":"2011-03-14T21:45:14","slug":"introduction-to-erlang-installing-erlang","status":"publish","type":"post","link":"http:\/\/trigonakis.com\/blog\/2011\/03\/02\/introduction-to-erlang-installing-erlang\/","title":{"rendered":"Introduction to Erlang : Installing Erlang"},"content":{"rendered":"<div class=\"seriesmeta\">This entry is part 2 of 16 in the series <a href=\"http:\/\/trigonakis.com\/blog\/series\/introduction-to-erlang\/\" class=\"series-57\" title=\"Introduction to Erlang\">Introduction to Erlang<\/a><\/div><h3>About Erlang<\/h3>\n<p>Erlang is a <strong>functional programming language<\/strong> which has many features more commonly associated with an operating system than with a programming language: concurrent processes, scheduling, memory management, distribution, networking, etc.<\/p>\n<p>The initial open-source Erlang release contains the implementation of Erlang, as well as a large part of Ericsson&#8217;s middleware for building <strong>distributed high-availability systems<\/strong>.<br \/>\n<!--more--><\/p>\n<h3>Installing Erlang<\/h3>\n<h4>Ubuntu &amp; derivatives<\/h4>\n<p>If I am not mistaken, in Ubuntu 10.04+, Erlang system is preinstalled, because it is used by some other subsystems, such as CouchDB database.<\/p>\n<p>In Ubuntu, you can install Erlang from the repositories:<\/p>\n<pre lang=\"bash\">\r\n$ sudo apt-get install erlang\r\n<\/pre>\n<p>The version installed will not be the latest, but this should not bother you for now..<\/p>\n<h4>Building from source<\/h4>\n<p>You can download Erlang source from <a href=\"www.erlang.org\/download.html\" target=\"_new\">here<\/a>. Untar the downloaded file, nagivate into the folder and run the configure script:<\/p>\n<pre lang=\"bash\">\r\n#you can use the --prefix=\/path\/to\/the\/installation\/folder\r\n#the default is \/usr\/local\/lib\/erlang\r\n$ .\/configure \r\n<\/pre>\n<p>If no problems appear, run:<\/p>\n<pre lang=\"bash\">\r\n$ make \r\n<\/pre>\n<p>and then<\/p>\n<pre lang=\"bash\">\r\n#as the root user, or \"sudo make install\"\r\n$ make install \r\n<\/pre>\n<h4>Windows<\/h4>\n<p>Download and run the <a href=\"www.erlang.org\/download.htm\" target=\"_new\">installer<\/a>.<\/p>\n<h3>Accessing the Erlang Emulator<\/h3>\n<p><strong>Erlang Emulator<\/strong> is an interactive shell which you can use to test and run your code.<br \/>\n<div id=\"attachment_281\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/trigonakis.com\/blog\/wp-content\/uploads\/2011\/03\/erl.png\"><img aria-describedby=\"caption-attachment-281\" loading=\"lazy\" src=\"http:\/\/trigonakis.com\/blog\/wp-content\/uploads\/2011\/03\/erl.png\" alt=\"Erlang Emulator\" title=\"Erlang Emulator\" width=\"600\" height=\"84\" class=\"size-medium wp-image-281\" srcset=\"http:\/\/trigonakis.com\/blog\/wp-content\/uploads\/2011\/03\/erl.png 644w, http:\/\/trigonakis.com\/blog\/wp-content\/uploads\/2011\/03\/erl-300x42.png 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-281\" class=\"wp-caption-text\">Erlang Emulator<\/p><\/div><br \/>\nIn order to get access to the emulator do:<\/p>\n<h5>Linux, Mac OS X, and Unix<\/h5>\n<p>Open a terminal and type:<\/p>\n<pre lang=\"bash\">\r\n$ erl\r\n<\/pre>\n<h5>Windows<\/h5>\n<p>You can either click the Erlang icon created by the installer or run the <code>werl<\/code> command.<\/p>\n<h5>Quit<\/h5>\n<p>In order to exit the emulator type <\/p>\n<pre lang=\"erlang\">1> q().<\/pre>\n<h3>Programming Editor\/IDE<\/h3>\n<h4>Emacs<\/h4>\n<p>I personally use Emacs for programming Erlang. There is an Erlange editing mode in Emacs. In Ubuntu you can install it by:<\/p>\n<pre lang=\"bash\">\r\nsudo apt-get install erlang-mode\r\n<\/pre>\n<p>Details <a href=\"http:\/\/www.erlang.org\/doc\/apps\/tools\/erlang_mode_chapter.html\" target=\"_new\">here<\/a>.<\/p>\n<h4>Erlide for Eclipse<\/h4>\n<p>There is an Eclipse plugin supporting Erlang called Erlide. For download and installation details go <a href=\"http:\/\/erlide.sourceforge.net\/\" target=\"_new\">here<\/a>.<\/p>\n<h4>Others<\/h4>\n<p>There are some other alternatives, including a <a href=\"http:\/\/sourceforge.net\/projects\/erlybird\/\" target=\"_new\">Netbeans IDE plugin<\/a>. For more details go <a href=\"http:\/\/www.erlang.org\/faq\/tools.html\" target=\"_new\">here<\/a>.<\/p>\n<h3>Documentation<\/h3>\n<p>You can access Erlang Documentation <a href=\"http:\/\/erlang.org\/doc\/\" target=\"_new\">online<\/a>. <\/p>\n<p>What I use the most is the <a href=\"http:\/\/erlang.org\/doc\/man\/\" target=\"_new\">Manual Pages<\/a>. It is a very useful resource since there are tons of built-in function that will help you avoid reinventing the wheel..<\/p>\n<h3>Next<\/h3>\n<p>The next post will be about the basic types in Erlang..<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This entry is part 2 of 16 in the series <a href=\"http:\/\/trigonakis.com\/blog\/series\/introduction-to-erlang\/\" class=\"series-57\" title=\"Introduction to Erlang\">Introduction to Erlang<\/a><\/div><p>About Erlang Erlang is a functional programming language which has many features more commonly associated with an operating system than with a programming language: concurrent processes, scheduling, memory management, distribution, networking, etc. The initial open-source Erlang release contains the implementation of Erlang, as well as a large part of Ericsson&#8217;s middleware for building distributed high-availability [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[40,51,28],"tags":[26,27,42],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1ouW6-4t","_links":{"self":[{"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/posts\/277"}],"collection":[{"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":23,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":290,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/posts\/277\/revisions\/290"}],"wp:attachment":[{"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/trigonakis.com\/blog\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}