=Paper= {{Paper |id=Vol-2372/SEIM_2019_paper_20 |storemode=property |title=The DSL for composing functions for FaaS platform |pdfUrl=https://ceur-ws.org/Vol-2372/SEIM_2019_paper_20.pdf |volume=Vol-2372 |authors=Nikita Gerasimov }} ==The DSL for composing functions for FaaS platform== https://ceur-ws.org/Vol-2372/SEIM_2019_paper_20.pdf
The DSL for composing functions for FaaS platform
                                                          Nikita Gerasimov
                                                Mathematics and Mechanics Faculty
                                                    Saint Petersburg University
                                                      St. Petersburg, Russia
                                                    n.gerasimov@2015.spbu.ru


   Abstract—This article describes the problems that occur when       function, which, in fact, is also a microservice, but with some
using the Function as a Service model: the complexity of the          differences [3]:
centralized description of the separate function interaction within
the whole system and the possibility of dependent components            • A microservice is a standalone application having nec-
interface divergence during a process of their development. We            essary libraries. A function is code that implements
propose a domain-specific language called Anzer as a solution             only necessary logic. Function start, its initialization,
to these problems which enables to describe the types of data
transmitted, the composition of functions, the semantics of their         connection to a database are carried out by a platform,
interaction and logic of error handling. To check the consistency         which means a function itself is not self-sufficient.
and compliance of the declared and implemented types, software          • A microservice can be run separately, and a function can
has been produced making it possible to automate the creation             often be started only within a framework of a serverless
of new functions and maintain their integration with others at            platform.
all stages of system development and support. The language and
                                                                        • A microservice typically runs in daemon mode, respond-
software in combination with each other prevent errors associated
with a mismatch between input data format expected by the                 ing to incoming requests. A function is often run only
function and actually transmitted one. All this enables to simplify       when it is requested to execute it.
and speed up the process of developing systems based on the
concept of Function as a Service.                                        In summary, a function is similar to a microservice but often
   Index Terms—serverless, faas, static typing, function composi-     is not self-sufficient, does not store the state, uses capabilities
tion, domain-specific language                                        of the platform to run and communicate. Such peer-to-peer
                                                                      computing platform called FaaS (Function as a Service).
                       I. I NTRODUCTION
                                                                         In addition to Amazon, cloud FaaS platform services are
   The development of the Internet, the emergence of a large          provided by Google (“Google CloudFunctions”), Microsoft
amount of data and process control automation have led to             (“Azure Functions”) and IBM (“IBM Cloud Functions” based
an increase in the software modularity. An earlier approach to        on the “Apache OpenWhisk” platform). In addition to cloud
partitioning programs into components was service-oriented            providers, there are self-hosted solutions: Apache OpenWhisk,
architecture (SOA), which is characterized by getting partic-         Fission, OpenFaaS and other.
ular sets of functions separated into independent modules.               Simple applications with a web interface, or IoT (Internet of
Each module is responsible for a certain range of tasks. The          things) systems, often use separate, independent functions to
interaction is carried out either using enterprise service bus or     perform actions when certain events occur. However, systems
RPC API.                                                              in the FaaS platform can be built through the composition of
   The next iteration of the development of modular distributed       functions. For example, in a subsystem that processes data, one
software architectures is microservice architecture. The ap-          component passes intermediate results to another in a chain.
proaches are very similar at first glance, but the difference         One of the obvious applications of such a composition is ETL
is in details. Microservices usually tend to perform much             (Extract, Transform, Load) processes. Using a FaaS platform
fewer functions and have fewer dependencies, which simplifies         it is easy to implement a similar data conversion scheme if
scaling [1]. In addition, they provide one or more API methods        each step is allocated to one or more functions. The functions
rather than complex RPC interfaces covering most of the               work in parallel, independently, do not store the state, return
subject area.                                                         result of the work or an error message.
   Microservice architecture imposes certain requirements on
                                                                         The benefits of serverless computing:
the infrastructure: deploy automation, automation of testing,
infrastructure for service discovery.                                   1) No need for infrastructure support (in case of using
   Without preliminary preparation of such an environment,                 cloud-based FaaS solution providers).
developing large systems in such a paradigm leads to greater            2) No need to implement supporting code, such as logging,
costs than developing a monolithic system [2].                             connecting to databases etc.
   In 2014 Amazon introduced AWS Lambda serverless plat-                3) Simple scaling of individual components rather than a
form (serverless computing platform) within Amazon Web                     system as a whole.
Services cloud platform. The main logical unit in it is a               4) No downtime costs because functions run on demand.
   5) The need for a competent division of logic into modules,         In addition to Amazon, IBM provides the ability to de-
       based on the concept definition.                             scribe the composition of functions using a developed Java-
   The use of the solution mentioned above also has its             Script library and “IBM Composer” functionality built in IBM
drawbacks:                                                          CloudFunctions [5]. The solution also makes it possible to
   1) Lower transparency of the system compared to a mono-          describe conditions, number of function retries and some other
       lithic application.                                          features. An important difference between IBM Composer and
   2) Difficulties with debugging of functions and a system as      AWS State Machine is that composition in the former is also
       a whole.                                                     a function that can participate in composition.
   3) There is no commercial solutions or standards in the             Microsoft provides 2 mechanisms for the composition of
       field of systems testing that built in the FaaS platforms.   functions in its “Azure Functions” platform: “Azure App
   4) An unresolved issue of resources caching that should          Logic” and “Azure Durable Functions”. Just as “IBM Com-
       be initialized each time the function runs (for example,     poser”, the mechanisms are built in the platform and provide
       database connections).                                       an opportunity to describe conditions, cycles, number of
   Another problem that may arise during the development            retries, etc. [5].
and support of such a system is the control of interaction and         If choosing among serverless self-hosted platforms, Fission
compatibility of individual functions within the whole system.      and Fn enable to describe processes as the composition of
To solve this problem some FaaS cloud service providers             functions using “Fission Workflows” and “Fn Flow” respec-
make it possible to describe the order of functions run or          tively [6]. These mechanisms also make it possible to describe
their compositions. However, existing platforms do not provide      the composition using conditional statements.
proper type checking. There is a situation when a monolithic           Project StdLib with FaaSlang provides a completely differ-
application is divided into separate logical blocks smaller         ent way of using serverless technology. StdLib is platform-
even than microservices, and there is no way to guarantee           agnostic API gateway and serverless framework for FaaS
these blocks will work together consistently and correctly.         enabling user to easily change serverless provider. FaaSlang
Condition may occur in which some of the components of              provides an approach to specify a function’s input and output
the system provide the updated interfaces, and dependent            types. However, StdLib with FaaSlang does not ensure that the
components wait for outdated interfaces; that situation will        realized function fulfils its interface declarations. Moreover,
result in an error in the process of operation. This fact is        the current state of the project does not support any language
a disadvantage of serverless solutions in comparison with           except JavaScript.
traditional methods of systems development: monolithic and             None of the solutions found enables to make sure in the
service-oriented approaches.                                        minimal form that the function will start in the scheme of
   In the article, we consider existing solutions for function      operation with parameters that are passed to it, i.e. to check in
composition in the FaaS platforms (sec. II), suggest a way to       advantage the compatibility of the data types of the interacting
describe the composition of functions and automatically check       components. Therefore, we need a new alternative solution to
their compatibility by means of DSL (sec. III) and a software       describe the composition of functions which should provide
complex that extends opportunities of the FaaS platform             the following features:
“Apache OpenWhisk” [4]. The use of such an extension is                1) To describe the composition of functions, namely:
assumed to reduce number of errors associated with mismatch                  • To describe the composition of one function with
between function types during developing.                                       another, when the result of the first is passed to the
                                                                                second.
                II. A LTERNATIVE SOLUTIONS
                                                                             • To describe error handling mechanism.
   Serverless computing is a young approach, not yet widely            2) Make it possible to define the types of arguments and
known and not widely used. As a result, there are only a few               results for the functions involved in the composition and
solutions providing the composition of functions.                          check their compatibility.
   Amazon provides AWS State Machine with its own lan-
                                                                       To meet paragraph 2 from the list of requirements, it is also
guage, Amazon States Language describing a sequence of
                                                                    necessary to have an extension for the FaaS platform which
functions to run (AWS Step Functions) within a specific
                                                                    will manage functions building and deploying to ensure the
task [5]. Language and platform capabilities enable:
                                                                    type safety of the entire project because:
   1) Define the order which functions should be started in.
                                                                       • If a function implements an interface different from
   2) Handle errors.
                                                                          the one the function declares, its compilation will be
   3) Set the number of data processing retries in case of error.
                                                                          impossible.
   4) Run multiple processes in parallel.
                                                                       • If the composition of a new version of the function is
   5) Set the conditions for the launch of certain functions
                                                                          impossible with operating ones, its deployment will not
      based on transmitted data.
                                                                          happen.
   Sequences of invoking functions are not functions them-
                                                                       We propose a domain-specific language called “Anzer”1
selves, they are state descriptions made by an external envi-
ronment.                                                              1 https://github.com/tariel-x/anzer
as well as software that includes the language analyzer, the       data of type A, but it is transmitted data B. If type A and
system of function building, interaction with the FaaS platform    provided type B are actually different, and the function will
and the user interface as a solution to the problem mentioned      handle B correctly, it can be concluded that B can be subtype
above.                                                             or type equivalent to the type A.
  In addition, it is assumed that the language should not be          For example, listing 2 describes type A, which contains a
highly specialized for use with a single FaaS platform. This       string type field named f1. It also describes type B, which
means that the software package to be developed should be          contains the same string field f1 and, optionally, an integer
sufficiently versatile and modular to be able to adapt it to the   field f2. Since type B contains the same fields of the same
new framework with minimal modifications.                          type as A, we can say that A <: B.
    III. T HE LANGUAGE OF FUNCTIONS COMPOSITION                                        Listing 2. A and B subtype
   Functions in the FaaS platforms are triggered in case of        type A = {
                                                                      f1 :: String
need, perform the programmed action and pass the result            }
forward, not keeping the state. This feature partly creates        type B = {
an affinity between the functions mentioned above and the             f1 :: String
concept of functions from some functional programming lan-            f2 :: Integer
guages.                                                            }
   In addition, if we consider a set of functions as a single        That is, B is subtype of A if every term B can be safely
monolithic program, then, in the absence of a global runtime       used in the context where A is expected (1) [7].
environment and variable changes, drawing an analogy with
imperative programming languages is impossible. Functional                                Γ ` x : A A <: B
                                                                                                                                  (1)
approach, on the contrary, is characterized by the composition                                  Γ`x:B
of independent functions, which means the result of the               Inheritance is reflective: A <: A and transitive. For instance,
calculation of the previous function is applied to the next        listing 3 shows an example of A, B and C, for which the
one. Also, programs written in a pure functional style do not      following equation is true: A <: B, B <: C and A <: C.
contain mutable variables, and functions can be easily moved
from one program to another.                                                              Listing 3. Transitivity
   Listed properties create an affinity between a functional       type A = {
                                                                      f1 :: String
programming style and systems built using the FaaS platforms.      }
In this regard, the concepts of such functional programming        type B = {
languages as Haskell and PureScript were taken as a basis for         f1 :: String
the proposed language.                                                f2 :: String
                                                                   }
A. Type system                                                     type C = {
                                                                      f1 :: String
   The implemented language supports both basic types (string,        f2 :: String
boolean etc.) and custom user-defined record types, as shown          f3 :: String
in listing 1.                                                      }

                   Listing 1. User-defined types
                                                                     Moreover, depth subtyping is true, i.e. the types of each
type Address = {                                                   corresponding field of a composite type may vary, but should
   house :: Integer                                                be in terms of inheritance, as in the listings 4 and 5.
   street :: Maybe String
   city :: MinLength 10 String                                                        Listing 4. Inheritance in depth
   country :: String                                               type A = {
}                                                                     f1 :: String
type Addresses = List Address                                      }
                                                                   type B = {
   Also, the language supports extension of basic and user-           f1 :: MinLength 10 String
defined types with the help of type constructors. List is the      }
type constructor, that is, the function that converts Address
type into List Address which is an array of addresses.                                Listing 5. Inheritance in depth
MinLength cconstructor defines a string with minimum               type A = {
length of 10. One can use Maybe constructor to determine              f1 :: {
that a field may not be present in the data being passed. The            sf1 :: String
type with the applied constructors is the new type. There are         }
                                                                   }
more type constructors defined by the language.                    type B = {
   Anzer language type system supports subtype polymor-               f1 :: {
phism. Let us assume there is a function a waiting for input             sf1 :: String
        sf2 :: String                                              synonymous with the composition of other functions: isp and
    }                                                              parse, hence the latter will be deployed. At the end of the
}                                                                  isp operation there will be an event created in the system and
   Rearranging of fields in the description of the user-defined    containing result of its operation, by means of which parse
type does not affect subtyping.                                    function will be launched and will receive this result.
   If there are two types A and B for which A <: B and             C. Error handling
B <: A are true, such types should be considered equivalent.
   It should be noted that the application of some constructors       To handle errors you can use the type construc-
to any type forms its subtype. For example, let A be a base        tor Either a b = Left a | Right b which specifies
string type, that is type A = String, and type B be a base         that the function returns data of either type a or type b.
string type with the applied string maximum length constraint      For example, Either Error Result defines an algebraic
constructor type A = MaxLength 10 String. Then, A <:               data type which means that the result can be either an Error
B is true. B. Language defines constructors List, Maybe and        type or the Result type. There is no predefined error type.
Either, which do not form a subtype due to their higher
                                                                      The composition of functions which returns the result
complexity.                                                        Either Error Result with functions expecting only the
   Applying different constructors or the same constructor         Result type is performed using Either monad. Its defini-
with a different parameter to any type leads to                    tion and use are similar to that of the Haskell programming
the appearance of two new different types. For                     language [8]. Construction Either in Anzer defines 2 oper-
example,        type A = MaxLength 10 String                and    ations: >>= and return.
type A = MaxLength 20 String can not be considered
                                                                      Operation >>= (bind) is the higher-order function of
in terms of inheritance or equivalence.                            Anzer, takes some data and another function as arguments
                                                                   and is defined as follows:
B. Functions                                                           Right a >>= f = f a
   The types in Anzer are used to describe function’s argu-            Left a >>= f = Left a
ments and results of its operation. A function is either a            Given example shows that if the first function argument
reference to a repository with its source code or a synonym for    >>= is of type Right a, where a is a user-defined data
the composition of other functions. Therefore, Anzer does not      type, then >>= converts data of type Right a into type a.
provide writing application logic, making it possible only the     Then, the function f passed by the second argument is applied
type-safe composition of functions having been implemented         to the given data, and the result of this application is the result
in other languages. An example of the system description is        of the operation >>=.
shown in the listing 6.                                               If the first binding argument is of Left a type, the
        Listing 6. An example of the system description in Anzer
                                                                   operation returns the data passed to it unchanged.
type RawAddress = MinLength 10 String                                 Thus, using the >>= operation it is possible to bind
type Address = {                                                   functions returning an error message instead of operation result
   street :: Maybe MinLength 10 String                             with functions expecting only correct data, not an error. At the
   city :: MaxLength 20 String                                     same time, once generated, the error will reach composition’s
   country :: String
}                                                                  end without changes.
                                                                      Another operation of Either monad is return function,
github.com/u/parse[go]::                                           which can be defined as follows: return a = Right a.
   RawAddress -> Address                                           As you can see from the definition, return casts user-defined
isp github.com/u/isprovider[go]::                                  data of type a to type Right a by means of the Right
   Address -> Bool
                                                                   constructor. With the help of this operation you can bind
detect :: RawAddress -> Bool                                       functions that return type a instead of Right a.
detect = isp . parse                                                  Since Anzer is the domain-specific language, not a general-
                                                                   purpose language, unlike Haskell or other similar functional
invoke (                                                           languages, there is no provision for creating custom type
   detect,
)
                                                                   constructors, monads, or higher-order functions.

   The record github.com/user/parse in the example                                    IV. A NZER P LATFORM
is the reference to the repository with the function’s source        One composition language would not be enough to achieve
code, and RawAddress -> Address is the description of              the goal, so the proposed solution also includes a specialized
input or output data. The record isp . parse defines the           platform, the tasks of which include:
composition of isp and parse functions, and detect is                • Type checking in the description of the function compo-
the function defined as the composition of the other two.               sition in Anzer.
   The invoke keyword determines, which functions will               • Functions building using a specialized library to ensure
be deployed in the FaaS platform. In this case, detect is               compliance of the declared and implemented types.
  •   Deployment of new versions of functions in the selected
      FaaS platform.
A. General organization
   To ensure compliance of the declared and implemented
types, a specialized library is used that encapsulates all in-
teraction with the FaaS platform. In addition, the proposed
solution has a built-in code generator that prepares the basic
structures or interfaces based on the data types described in the
Anzer language. After generating a function basis, developer
only needs to implement the business logic of an application.
   When you deploy a function in the platform, generating
additional function code based on the description in the Anzer
language comes first. Additional code is required to confirm
that the function implementation matches the description. If
                                                                               Figure 1. Schematic representation of the system.
the implementation does not match the description declared in
the Anzer file, the implementation language compiler would
report an error.                                                     be used as the languages of the function implementation. Such
   The schematic representation of the system consisting of          languages can be, for example, C++, Go, Java, TypeScript or
Anzer, the FaaS platform and functions is shown in figure 1.         PHP.
   The square with the caption “Anzer-λ” in the scheme
shows a component implementing the logic of the application          B. User interface
directly. This part is implemented by developer by means of             The user interface of the solution is a set of utilities with
the selected programming language. Arguments for launching           CLI (Command line interface) interface. The utilities use
in the function’s code and the return of the work result are         a document in Anzer language to generate the basis of a
available using the Anzer library. The library, in turn, interacts   function, to build it and to deploy it in the FaaS platform.
with the selected FaaS platform.                                        For instance, calling anzer g −i scheme.anz
   The square with the caption “λ” directly shows a container        −o ∼/go/src/a/a.go −f parse generates a basis
with an executable file launched by the FaaS platform. The           for the function parse which is shown in the listing 6.
data bus is the part of the FaaS platform.
                                                                        Calling anzercli build −−anz listing2.anz
   The rectangle labelled “Anzer Platform” indicates that the
                                                                     parse builds a container from source code of the parse
functions are managed through the appropriate user interface.
                                                                     function.
Despite this, it remains possible to use standard tools of the
selected FaaS platform.                                                          V. I MPLEMENTATION AND TESTING
   The typical process of creating a new system in the FaaS
                                                                     A. Implementation
platform using the proposed solution is as follows:
   1) Describing required data types.                                   Project Apache OpenWhisk [4] has been selected as the
   2) Generating a necessary function’s basis in terms of the        first supported FaaS platform due to ease of deployment,
       described types by means of Anzer user interface.             adequate performance [10] and the availability of the required
   3) Implementing the function’s operating logic.                   functionality to implement the proposed solutions [9]. The
   4) Deploying a function in the version control system and         proposed solution is implemented by means of Golang pro-
       describing functions in Anzer according to the same           gramming language which was chosen due to having necessary
       scheme as that of types.                                      competence. Having Golang supported by main suppliers of
   5) Deploying the implemented functions via the Anzer user         serverless cloud services (AWS Lambda Functions Azure,
       interface. What happens alongside:                            Google CloudFunctions) enabled to use it as the first language
                                                                     supported by the Anzer platform.
         a) Verification of function composition availability
                                                                        The developed software includes:
             based on the specified types.
         b) Based on the described types generation of missing          • CLI user interface;

             code to work within the target FaaS platform.              • Anzer parser and interpreter;

         c) Compilation (if possible) of the implemented func-          • A component to work with OpenWhisk:

             tion and the code generated in step 5.b.                       – A client for the OpenWhisk HTTP API;
         d) In case of the successful container’s compilation               – A library for Golang that encapsulates the work with
             here comes the deployment of the functions in the                 the FaaS platform.
             FaaS platform.                                             Package of functions, i.e. a collection of bound functions
   The languages for which there is a compiler or static anal-       and triggers, is created for each document in Anzer language
yser with the possibility of static type checking in the code can    with the help of the OpenWhisk client. A trigger, by means of
which a function can be called, is created for each function.         7) Overhead: absent as Anzer is not a component of the
In the case of function composition, the code required to                 FaaS platform and responsible only for configuring the
generate an event for calling the next function is generated              interaction between functions.
automatically. Rules for calling functions for HTTP events,           8) Billing model: not applicable.
database events etc. can be configured by OpenWhisk built-in          There is no type safety in the list of criteria because no
tools.                                                             alternative solutions matching this criterion have been found.
   A partial example of a template that could be generated by         According to the criteria of the article [5], the proposed
the command from Chapter IV-B is shown in the listing 7.           solution is not inferior to the alternative. However, if we
                                                                   take into account possibilities presented by Anzer, it is less
                 Listing 7. Generated Go-template                  functional, which means it is impossible to use it to build
type TypeIn struct {                                               complex systems yet.
   Price float64 ‘json:"price"‘
   Text string ‘json:"text"‘                                          It should also be noted that the Anzer platform does not
}                                                                  increase the system’s consumption of machine resources and
type TypeOut struct {                                              the same goes for the operating time of functions, as in fact
   Desc string ‘json:"desc"‘                                       it only adjusts the connection between them.
   Name string ‘json:"name"‘
   Price float64 ‘json:"price"‘                                    C. Testing
}
func Handle(input TypeIn) TypeOut {                                   The proposed solution is being in the process of testing.
   var out TypeOut                                                 Currently, Anzer is used in several simple systems, one of
   return out                                                      which is used to simplify the process of passing code-review.
}
                                                                   The system consists of 3 functions. Two functions perform
   It is notable that there is no line length check in the given   specific actions and return a result by a repository management
sample code. The specified data type requirement is checked        system event. The third one receives an action result and sends
by the Anzer interpreter, but checking in the function code        a text message to a chat.
is yet to be implemented. After generating the template, you          An example of the scheme used in testing is shown in the
should implement business logic in the Handle function.            listing 8. The Hook type describes a small part of the query
   The code required to work in OpenWhisk will be generated        that is automatically sent by the project management system
at the stage of function deployment. Due to the use of             Gitlab when certain events occur. The Event type contains
interfaces in it, it is impossible to change the format of the     validated information about edits in the code in the repository.
transmitted data without editing the Anzer document.               The Assignment type is used to transfer information about
                                                                   the person assigned to control the current edits in the code.
B. Comparison with analogues                                          The validate function, in accordance with its name,
                                                                   checks the incoming query and, using Gitlab API, determines
   Comparison with analogues was made using criteria               the programming language used in the repository. The assign
from [5]:                                                          function appoints the person responsible for checking code
  1) ST-safeness [11]: the solution meet the criterion as:         edits based on the programming language of the repository.
       • The function composition is a new function.
                                                                   The notify function sends an appointment notification to the
       • The composition of functions does not incur addi-
                                                                   chat.
         tional costs of computing power and, as a conse-                         Listing 8. The example of using Anzer
         quence, financial costs.                                  type Hook = {
       • In the proposed solution, the following function is          user :: {
         called asynchronously, that is, the execution time of        username :: String
         all functions in the composition is not summed.              }
                                                                      repository :: {
  2) Programming model: functional-like DSL.                          name :: String
  3) Parallel execution support: not supported at the moment.         homepage :: String
  4) State management: the presented solution uses the Open-          }
     Whisk platform that, in turn, uses the Apache Kafka           }
                                                                   type Event = {
     message broker in the data transmission channel between          author :: String
     functions. Therefore, the maximum size of the transmit-          repository :: String
     ted state is equal to the maximum size of the message            language :: String
     in Apache Kafka.                                              }
  5) Software packaging and repositories: the source code of       type Assignment = {
                                                                      reviewer :: String
     functions is stored in Git repositories.                         repository :: String
  6) Architecture: uses an OpenWhisk architecture consisting       }
     of a controller and a message queue.
github.com/u/validate[go]::                                              type function, for instance, Left a | Right b, the
   Hook -> Event                                                         final function is obliged to process both variants. For
github.com/u/assign[go]::                                                full use it is necessary to implement an analogue of the
   Event -> Assignment
github.com/u/notify[go]::                                                pattern matching operation in functional languages.
   Assignment -> Bool                                                 2) In addition to pattern matching, “if-then” construction
                                                                         working with data will simplify the description of com-
assign_mr = validate . assign . notify                                   plex interaction schemes.
invoke (                                                              3) Solving problems that are more complex than those
   assign_mr,
)                                                                        described in the “Testing” section requires the possibility
                                                                         of local functions testing and debugging.
   The given example is the very simple system not using even         An important point is to develop the possibility of using
a possibility to handle errors. Nevertheless, its construction     Anzer language along with one of the cloud FaaS platforms,
made it possible to verify the viability of the approach at the    such as IBM CloudFunctions, AWS Lambda or others, as it is
minimum level.                                                     them whom the most mature alternative composition solutions
   To apply the platform and Anzer language to the real-           are created for.
world problems, for example, building ETL systems, a number
of language and platform improvements are required, for                                         R EFERENCES
instance:                                                           [1] N. Kratzke, “A Brief History of Cloud Application Architecturesm”
   1) The support of the conditional operator present in alter-         Applied Sciences, vol. 8, 2018, pp. 1368-1368.
                                                                    [2] R. Rodger, The tao of microservices. New York: Manning publications,
       native means of composition is required. In the Anzer            2018, pp. 17-19.
       language, it could be a pattern-matching analogue from       [3] E. van Eyk, L. Toader, S. Talluri, L. Versluis, A. Ut, ă and A. Iosup
       functional programming languages.                                “Serverless is More: From PaaS to Present Cloud Computing,” IEEE
                                                                        Internet Computing, vol. 22, no. 5, 2018, pp. 8-17.
   2) Using the project as a tool to create full-fledged com-       [4] (2019          Jan.)       OpenWhisk.        [Online].       Available:
       mercial products requires the development of specialized         http://openwhisk.apache.org
       tools for function debugging and testing.                    [5] P. Garcia Lopez, M. Sanchez-Artigas, G. Paris, D. Barcelona Pons, A.
                                                                        Ruiz Ollobarren, and D. Arroyo Pinto, “Comparison of FaaS Orchestra-
   In general, the use of Anzer together with the accompanying          tion Systems,” 2018 IEEE/ACM International Conference on Utility and
software facilitates creation of new systems and support of             Cloud Computing Companion (UCC Companion), Zurich, Switzerland,
                                                                        2018, pp. 148-153.
existing ones, while not affecting the system requirements for      [6] K. Kritikos and P. Skrzypek “A Review of Serverless Frameworks,” 2018
hardware resources and performance.                                     IEEE/ACM International Conference on Utility and Cloud Computing
                                                                        Companion (UCC Companion), Zurich, Switzerland, 2018, pp. 161-168.
                      VI. C ONCLUSION                               [7] B. Pierce, Types and Programming Languages. London: MIT Press,
                                                                        2002, pp. 251–254.
   The article considers the problem of function interaction        [8] B. Milewski. (2019 Jan.) Basics of Haskell - Error handling. [On-
interface divergence in the FaaS platforms. When you develop            line]. Available: https://www.schoolofhaskell.com/user/bartosz/basics-
a system using this approach, you may experience a situation            of-haskell/10 Error Handling
                                                                    [9] S. Mohanty, “Evaluation of Serverless Computing Frameworks Based
where some components wait or return data in an updated                 on Kubernetes,” Aalto University, 2018.
format that is incompatible with outdated components. One of       [10] S.     Shillaker     (2019   Jan.)   A   provider-friendly   serverless
the reasons for this problem is the lack of tools to describe           framework for latency-critical applications. [Online]. Available:
                                                                        http://conferences.inf.ed.ac.uk/EuroDW2018/papers/eurodw18-
and verify the type checking of interacting functions.                  Shillaker.pdf
   As a solution, this article proposes domain-specific lan-       [11] I. Baldini et al. “The serverless trilemma: function composition for
guage Anzer created to easily describe the types of data                serverless computing,” in Proceedings of the 2017 ACM SIGPLAN In-
                                                                        ternational Symposium on New Ideas, New Paradigms, and Reflections
transmitted, the type-safe composition of functions within              on Programming and Software (Onward! 2017), New York, NY, USA,
the whole system, the semantics of their interaction and the            2017, pp. 89-103.
logic of error handling. The developed software enables to
automate the creation of new functions and maintain their
integration with others at all stages of system development and
support. Together language and software prevent errors due to
mismatch between input data format expected by a function
and actually transmitted one. All this makes it possible to
simplify and speed up the process of developing systems based
on the concept of Function as a Service.
   The extensive use of the type system in describing the
functions interaction distinguishes the proposed solution from
the alternatives, but there are several unresolved problems:
   1) A possibility to select a function for a composition based
       on the actually transmitted data type is needed. In the
       current implementation, in case of using an algebraic