Servant (web framework)

Last updated
Servant
Original author(s) Alp Mestanogullari, Sönke Hahn, Julian Arni
Initial release2014;10 years ago (2014)
Written in Haskell
Operating system Cross-platform
Available inEnglish
Type Web framework
License BSD 3-clause license [1]
Website www.servant.dev

Servant is a web framework based on the programming language Haskell, with an emphasis on data type safety. [2] [3] [4] It is free and open-source software released under a BSD 3-clause license.

Contents

Overview

Servant provides a type-level domain-specific language (DSL) to describe World Wide Web application programming interfaces (Web APIs); various interpretations of such descriptions are possible: as a server, which dispatches requests to handlers; as documentation and schema specifications for the API; and as client libraries in various languages. [5]

The type-level approach by Servant solves the expression problem by allowing the extensibility along the dimensions of both data and behavior. [5] New combinators or terms in the DSL can be modularly introduced, as can new interpretations of them, as entirely separate packages. As of 2023, well over 100 packages related to Servant have been published in the Haskell package repository. [6]

Usage

It is used in production by companies such as GitHub, [7] NoRedInk, [8] Klarna, [9] Input Output Global Inc. (in the Cardano project), [10] and Wire. [11]

See also

Related Research Articles

In computing, serialization is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of object-oriented objects does not include any of their associated methods with which they were previously linked.

Programming languages can be grouped by the number and types of paradigms supported.

HaXml is a collection of utilities for parsing, filtering, transforming, and generating XML documents using Haskell.

In computing, an effect system is a formal system that describes the computational effects of computer programs, such as side effects. An effect system can be used to provide a compile-time check of the possible effects of the program.

<span class="mw-page-title-main">Philip Wadler</span> American computer scientist

Philip Lee Wadler is a UK-based American computer scientist known for his contributions to programming language design and type theory. He is the chair of theoretical computer science at the Laboratory for Foundations of Computer Science at the School of Informatics, University of Edinburgh. He has contributed to the theory behind functional programming and the use of monads; and the designs of the purely functional language Haskell and the XQuery declarative query language. In 1984, he created the Orwell language. Wadler was involved in adding generic types to Java 5.0. He is also author of "Theorems for free!", a paper that gave rise to much research on functional language optimization.

<span class="mw-page-title-main">Vaadin</span>

Vaadin is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the Java programming language only, TypeScript only, or a combination of both.

Haskell is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell has pioneered a number of programming language features such as type classes, which enable type-safe operator overloading, and monadic input/output (IO). It is named after logician Haskell Curry. Haskell's main implementation is the Glasgow Haskell Compiler (GHC).

<span class="mw-page-title-main">API</span> Software interface between computer programs

An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build or use such a connection or interface is called an API specification. A computer system that meets this standard is said to implement or expose an API. The term API may refer either to the specification or to the implementation. Whereas a system's user interface dictates how its end-users interact with the system in question, its API dictates how to write code that takes advantage of that system's capabilities.

Probabilistic programming (PP) is a programming paradigm in which probabilistic models are specified and inference for these models is performed automatically. It represents an attempt to unify probabilistic modeling and traditional general purpose programming in order to make the former easier and more widely applicable. It can be used to create systems that help make decisions in the face of uncertainty.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

<span class="mw-page-title-main">GraalVM</span> Virtual machine software

GraalVM is a Java Development Kit (JDK), written in Java. The open-source distribution of GraalVM is based on OpenJDK, and the enterprise distribution is based on Oracle JDK. As well as just-in-time (JIT) compilation, GraalVM can compile a Java application ahead-of-time so that it starts instantly, provides peak performance with no warmup, and uses fewer resources. It provides additional programming languages and execution modes. The first production-ready release, GraalVM 19.0, was distributed in May 2019. The most recent release is GraalVM for JDK 21, made available in September 2023.

<span class="mw-page-title-main">WebAssembly</span> Cross-platform assembly language and bytecode designed for execution in web browsers

WebAssembly defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment.

<span class="mw-page-title-main">GraphQL</span> Data query language developed by Facebook

GraphQL is an open-source data query and manipulation language for APIs and a query runtime engine.

<span class="mw-page-title-main">SYCL</span> Higher-level programming standard for heterogeneous computing

SYCL is a higher-level programming model to improve programming productivity on various hardware accelerators. It is a single-source embedded domain-specific language (eDSL) based on pure C++17. It is a standard developed by Khronos Group, announced in March 2014.

<span class="mw-page-title-main">PureScript</span> Strongly-typed language that compiles to JavaScript

PureScript is a strongly-typed, purely-functional programming language that transpiles to JavaScript, C++11, Erlang, and Go. It can be used to develop web applications, server side apps, and also desktop applications with use of Electron or via C++11 and Go compilers with suitable libraries. Its syntax is mostly comparable to that of Haskell. In addition, it introduces row polymorphism and extensible records. Also, contrary to Haskell, the PureScript language is defined as having a strict evaluation strategy, although there are non-conforming back ends which implement a lazy evaluation strategy.

Since the advent of differential privacy, a number of systems supporting differentially private data analyses have been implemented and deployed. This article tracks real-world deployments, production software packages, and research prototypes.

<span class="mw-page-title-main">Deno (software)</span> Secure JavaScript and TypeScript runtime

Deno is a runtime for JavaScript, TypeScript, and WebAssembly that is based on the V8 JavaScript engine and the Rust programming language. Deno was co-created by Ryan Dahl, who also created Node.js.

Multitier programming is a programming paradigm for distributed software, which typically follows a multitier architecture, physically separating different functional aspects of the software into different tiers. Multitier programming allows functionalities that span multiple of such tiers to be developed in a single compilation unit using a single programming language. Without multitier programming, tiers are developed using different languages, e.g., JavaScript for the Web client, PHP for the Web server and SQL for the database. Multitier programming is often integrated into general-purpose languages by extending them with support for distribution.

FastAPI is a modern web framework for building RESTful APIs in Python. It was first released in 2018 and has since quickly gained popularity among developers due to its ease of use, speed and robustness.

References

  1. "Servant license". GitHub. Retrieved 10 February 2023.
  2. Bragilevsky, Vitaly (2021). Haskell in Depth. Manning. ISBN   9781617295409.
  3. Putrady, Ecky (2018). Practical Web Development with Haskell: Master the Essential Skills to Build Fast and Scalable Web Applications. Apress. ISBN   978-1484237380.
  4. Mazumder, Mark; Braje, Timothy (2016). "Safe Client/Server Web Development with Haskell". 2016 IEEE Cybersecurity Development (SecDev). p. 150. doi:10.1109/SecDev.2016.040. ISBN   978-1-5090-5589-0. S2CID   1953852.
  5. 1 2 Mestanogullari, Alp; Hahn, Sönke; Arni, Julian; Löh, Andreas (2015). "Type-level web APIs with Servant: An exercise in domain-specific generic programming". Proceedings of the 11th ACM SIGPLAN Workshop on Generic Programming. pp. 1–12. doi:10.1145/2808098.2808099. ISBN   9781450338103. S2CID   14512955.{{cite book}}: CS1 maint: date and year (link)
  6. "Browse and search packages". Haskell.org: Hackage.
  7. Thomson, Patrick; Rix, Rob; Wu, Nicolas; Schrijvers, Tom (2022). "Fusing Industry and Academia at GitHub (Experience Report)". Proceedings of the ACM on Programming Languages. 6: 496–511. arXiv: 2206.09206 . doi:10.1145/3547639. S2CID   249889460.
  8. "Type-Safe MySQL Queries via Postgres". NoRedInk Blog. 5 November 2019. Retrieved 16 February 2023.
  9. Mulder, Felix. "Haskell in Production: Services at Klarna written in Haskell" . Retrieved 16 February 2023.
  10. "Cardano Wallet Design" . Retrieved 16 February 2023.
  11. "Servant". Wire Documentation. Retrieved 16 February 2023.