\section{Erlang in Osmocom}

\begin{frame}{Introducing Erlang}
Erlang/OTP
\begin{itemize}
	\item is a functional, non-OO programming language
	\item promotes some principles that make it easier to write secure code
	\item was crreated by Ericsson for Telecom signalling applications
	\item has excellent built-in ASN.1 compiler + runtime support
	\item has {\tt gen\_fsm} support for well-defined finit state machines
\end{itemize}
\end{frame}

\begin{frame}{Safe and secure programming}
Erlang enables and encourages to
\begin{itemize}
	\item avoid defensive programming, rather fail-fast and raise exceptions
	\item avoid having global/shared state as everything is pass-by-value, not reference
	\item avoid accidential/improper reuse of variables by single assignment
	\item not have to worry about memory allocation problems like
		buffer overflows / double-free
\end{itemize}
\end{frame}

\begin{frame}{Erlang headaches}
If you're used to C/C++ or even Java, Erlang will give you headaches,
too.
\begin{itemize}
	\item you have no interative loops like for/while, but always
		have to use (tail) recursion
	\item you have to type a lot when accessing members of records
		(structures), as you need to specify the type name on
		every access
	\item avoiding global state may be useful, but very hard at
		times
\end{itemize}
\end{frame}

\begin{frame}{Reasons to use Erlang in Osmocom}
\begin{itemize}
	\item best ASN.1 support found as Free Software for any
		programming language
	\begin{itemize}
		\item TCAP/MAP use ASN.1 Information Object Classes,
			which e.g. asn1c doesn't support
		\item supports PER aligned and unaligned, required in
			RANAP/RRC for UMTS.
		\item very strict validation of input data, including
			range checks of integer values against
			constraings in ASN.1, etc.
	\end{itemize}
	\item built-in support for finite state machines
	\item Erlang {\em many processes and message passing} model 1:1
		match to ITU TCAP specification.
\end{itemize}
\end{frame}

\begin{frame}{Erlang in Osmocom projets}
\begin{itemize}
	\item all current Osmocom developers are C (possibly C++) developers
	\item nobody really likes to use some bloatet inefficient and
		unknown programming language (compared to C...)
	\item almost every other sub-project of Osmocom is implemented
		in pure C
	\item apart from my projects described here, Erlang hasn't
		really picked up with other developers
	\item Erlang wasn't chosen because we love it, but because it
		makes techical sense in some specific applications,
		compared to alternavies requiring to buy/user
		porprietary ASN.1 tools or write our own
\end{itemize}
\end{frame}
