What is Erlang?

Erlang is a general purpose functional programming language and a runtime environment. It has built in support for concurrency, fault tolerance, distribution and highly scalable used for applications require high uptime. Erlang is available as an open source. Erlang was originally developed to be used in several large telecommunication systems where require high concurrency , availability and fault tolerance.

Explain what is OTP (Open Telecom Platform)?

OTP is a set of useful middleware, libraries, and tools written in the Erlang programming language. It includes its own distributed database, applications to interface towards other languages, debugging and release handling tools and it is important part of the open-source distribution of Erlang. The name OTP stand for Open Telecom Platform, which was a branding attempt before Ericsson released Erlang/OTP as opensource.

What are the key features of Erlang?

Features for Erlang-

  • Concurrent
  • Soft real-time
  • Fault-tolerant
  • Distributed
  • Non-stop applications(Highly availablity)
  • Hot swapping (code can be update without restarting the system.)
  • Immutable data
  • Pattern matching
  • Functional programming

What is erlang? Why it is best programming language for distributed applications?

Name the datatypes that erlang provides?

Data Types in Erlang-

  • Number
  • Atom
  • Bit Strings and Binaries
  • Reference
  • Fun
  • Port Identifier
  • Pid
  • Tuple
  • Map
  • List
  • String
  • Record
  • Boolean

What is the command to disconnect node in Erlang?

By calling erlang: disconnect_node (Node) will force disconnection of the node.

Explain what is modules in Erlang?

A Erlang module consists of a sequence of attributes and functions, each terminated by period (.)

how module is stored in Erlang?

A Erlang module has the same name as base file name. for example search_user.erl module name will be search_user.

What is bit strings in Erlang?

A bit string is a erlang data type used to store an area of untyped memory. Bit strings are represented using the bit syntax. Bit strings that consist of a number of bits that are divisible by eight, are called binaries

What is pattern matching in Erlang?

A pattern matching is a way of checking a given sequence of terms with some other pattern of terms and find out if it matches or not. In pattern matching, a left-hand side pattern is matched against a right-hand side term. If the pattern match successfully, any unbound variables in the pattern become bound, If the pattern matching fails, a run-time error occurs.

What is PID datatype in Erlang?

PID stand for Process Identifier. It is a datatype used for holding the unique process identifiers which are assigned to process when created. Processes communicate by sending and receiving messages through PID. Messages are sent by the send operator ! and received by calling receive keyword.

How to include a file in Erlang? what is the command used?

The following are the way to include file in Erlang-

  • include (File).
  • include_lib (File).

What is Erlang processes?

Erlang is designed for massive concurrency that is achieved by creating processes in Erlang. Erlang processes are lightweight that can grow and shrink dynamically with small memory footprint, fast to create and terminate, and the scheduling overhead is low.

In Erlang how process is created?

The process is created by calling spawn(built in function), and spawn forms a new process and returns the pid. spawn(Module, Name, Args) -> pid() Where - Module = Name = atom() Args = [Arg1,...,ArgN] ArgI = term()

What are guard sequence in Erlang?

A guard sequence is a sequence of guards, separated by semicolon (;). The guard sequence is true if at least one of the guards is true. (The remaining guards, if any, are not evaluated.)

What are the valid guard expressions in Erlang?

Valid guard expressions are

  • The atom true
  • Other constants (terms and bound variables), all regarded as false
  • Calls to the BIFs specified in table Type Test BIFs
  • Term comparisons
  • Arithmetic expressions
  • Boolean expressions
  • Short-circuit expressions (andalso/orelse)

List out the pre-defined macros in Erlang?

The following are pre-defined Macros in Erlang-

  • ? Module: Ireturns the name of the current module.
  • ? Module_String: returns the name of the current module, as a string
  •  ? File: returns the current file name
  •  ? Line: returns the current line number
  • ? Machine: returns the current machine name, ‘BEAM.’

Explain what is epmd?

epmd is a small name server which is used by Erlang programs when establishing distributed Erlang communications. It is also point out as an Erlang Port Mapper Daemon. It used for mapping the symbolic node names to machine addresses.

What is map in erlang?

A map is a compound data type with a variable number of key-value pair.Each key-value association in the map is called an association pair. The key and value parts of the pair are called elements. The number of association pairs is called the size of the map.

What is hot swapping in erlang?

Hot swapping is a mechanism to replace existing code with new one without stopping the system.

What is records in Erlang?

A record is a data structure which is used for storing a fixed number of elements. It is similar to a struct in C, has named fields. Records are translated to tuple expressions during compilation.

Back to Top