ერლანგი
ფაილის გაფართოება | .erl |
---|---|
გამოქვეყნების თარიღი | 1986 |
შემქმნელი | ერიქსონი |
ბოლო ვერსია | 18.0 / 24/06/2015 |
პარადიგმა | ფუნქციური, თანადროული |
ტიპების მინიჭება | დინამიკური, ძლიერი |
ენების ზეგავლენით | პროლოგი |
ენებზე ზეგავლა | Clojure, სკალა |
ოპერაციული სისტემა | მრავალპლატფორმული |
ლიზენზია | Apache License 2.0 მე-18-ე ვერსიიდან და Erlang Public License მე-17-ე ვერსიამდე |
ვებ გვერდი | http://www.erlang.org |
Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted |
ერლანგი (მათემატიკოსი აგნერ ერლანგის მიხედვით, და არგრეთვე როგორც Ericsson Language-ის შემოკლებით), არის თანადროული, ფუნქციური, ცხადი დროიანი და გაშვებული კოდის განაწილების შემძლე პროგრამირების ენა. მას გააჩნია შეცდომების მიმართ ტოლერანტობის მექანიზმი და აგრეთვე გაშვებული კოდის განახლების, გათიშვის გარეშე, რაც საშუალებას იძლევა შეუჩერებრივი პროგრამების შექმისთვის.
მაგალითები
ერლანგში ფაქტორიალის ფუნქცია:
<source lang="erlang"> -module(fact). % This is the file 'fact.erl', the module and the filename MUST match -export([fac/1]). % This exports the function 'fac' of arity 1 (1 parameter, no type, no name)
fac(0) -> 1; % If 0, then return 1, otherwise (note the semicolon ; meaning 'else') fac(N) -> N * fac(N-1). % Recursively determine, then return the result % (note the period . meaning 'endif' or 'function end') </source>
დახარისხების ალგორითმი Quicksort-ი:
<source lang="erlang"> %% quicksort:quicksort(List) %% Sort a list of items -module(quicksort). % This is the file 'quicksort.erl' -export([quicksort/1]). % A function 'quicksort' with 1 parameter is exported (no type, no name)
quicksort([]) -> []; % If the list [] is empty, return an empty list (nothing to sort) quicksort([Pivot|Rest]) -> % Compose recursively a list with 'Front'
% from 'Pivot' and 'Back' from 'Rest' quicksort([Front || Front <- Rest, Front < Pivot]) ++ [Pivot] ++ quicksort([Back || Back <- Rest, Back >= Pivot]).
</source>
რესურსები ინტერნეტში
- Official Erlang website(ინგლისური)
- trapexit.org Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted - Site with plenty of information about Erlang/OTP](ინგლისური)
- Erlang on dmoz.org Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted(ინგლისური)
- Erlang for Skeptics: A book on Erlang for beginners (work in progress) Lua error: Cannot create process: proc_open(/dev/null): Failed to open stream: Operation not permitted(ინგლისური)
- Learn You Some Erlang: A tutorial on Erlang for beginners(ინგლისური)
|