Loading…
This event has ended. Visit the official site or create your own event on Sched.
View analytic

Log in to bookmark your favorites and sync them to your phone or calendar.

•Functional Programming [clear filter]
Tuesday, September 26
 

2:00pm

MPark.Patterns: Pattern Matching in C++
Pattern matching brings a declarative approach to destructuring and inspecting complex data types. It’s a very powerful abstraction provided by many programming languages such as Haskell and OCaml, and more recently, Rust, Scala, and Swift.

We’ll see a glimpse of pattern matching in C++17 and their current limitations through features such as structured bindings, `apply`, and `visit`. We’ll then jump into MPark.Patterns, an experimental pattern matching library for C++. The following is an example of `fizzbuzz` written with the library:

void fizzbuzz() {
   for (int i = 1; i <= 100; ++i) {
    using namespace mpark::patterns;
    match(i % 3, i % 5)(
      pattern(0, 0) = [] { std::cout << "fizzbuzz\n"; },
      pattern(0, _) = [] { std::cout << "fizz\n"; },
      pattern(_, 0) = [] { std::cout << "buzz\n"; },
      pattern(_, _) = [i] { std::cout << i << '\n'; });
  }
}

We’ll see many more examples like this that lead to simpler, declarative code that focuses on the desired shape/state of the data, rather than a sequence of imperative code that tries to inspect the data in piecemeal.

The goal of the library, and the talk is to gain experience and exposure to pattern matching in order to potentially help guide the design of a language-based pattern matching mechanism.

Speakers
avatar for Michael Park

Michael Park

Software Engineer, Mesosphere
I’m a committer for the Apache Mesos project, and work as a Distributed Systems Engineer at Mesosphere. Within the realm of computer science, I’m very much intrigued by language design, compiler construction, and distributed systems. I’m also an active member of the ISO C... Read More →


Tuesday September 26, 2017 2:00pm - 3:00pm
Manchester (407) Meydenbauer Center

3:15pm

Using Functional Programming Patterns to build a clean and simple HTTP routing API
Web services are flourishing, and C++ has some great libraries (such as Boost/Asio + Beast or CppRestSdk) which we can use as the basis to build such services. Yet it is still relatively inconvenient to define HTTP routes in C++. Most approaches available in online tutorials are based on manual manipulation of regex or HTTP concepts.

In this talk, we will present the result of our work toward creating a clean HTTP routing library, usable on top of any HTTP transport layer library, which offers a terse and declarative syntax, composable routes, type-safety and a rich set of additional features such as generating sample routes or documentation.

We will discuss our initial investigations, and explain why we chose a functional-programming-based approach over reflection-based designs such as are common in the object-oriented world. You will learn about some design choices which allowed us to come closer to the “Don't Repeat Yourself” ideal: maximizing the services offered for the information provided by the client of the API.

Speakers
avatar for Jeremy Demeule

Jeremy Demeule

Principal Software Engineer, Murex
Jeremy Demeule is a Principal Software Engineer from Murex in Paris, France. He is working on data access subject (database, ORM, IMDG…) in Java and C++ and he is an active member of the C++ community at Murex. He was also present with a coworker the CDBC poster during the Cpp... Read More →
avatar for Quentin Duval

Quentin Duval

Senior Software Developer, Murex
Quentin Duval is a Senior Software Engineer from Murex, working at the Paris office in France. He is the leader of a team responsible for the life cycle management of trades inside the MX3 plattform. | | He is also a member of the C++ community of Practice of Murex, animate... Read More →


Tuesday September 26, 2017 3:15pm - 4:15pm
Colossus Theater Meydenbauer Center
 
Friday, September 29
 

10:30am

Higher-order Functions in C++: Techniques and Applications
Higher-order functions are functions that take other functions as arguments. This is very frequently used in functional languages, somewhat less so in C++, although this is slowly changing since C++11 gave us lambdas and `std::function`... and frequently people don't realize that `std::function` is not a tool that fills all use cases.

This talk will first attempt to convince you that higher-order functions are useful; by both showing functionalities that you know that work with them already, and by showcasing some more interesting problems that can be solved easily by function composition. Next, it'll work through different approaches to implementing higher-order functions in C++ and their pros and cons, performance- and code-size-wise.

Speakers
avatar for Michał Dominiak

Michał Dominiak

Engineer, Software Developer, Nokia Networks
Bachelor of Engineering in Computer Science from Wrocław University of Technology. Professional and enthusiast programmer. Interested in the foundational problems of computing, from the lowest levels of CPU architectures, through operating systems and programming language design... Read More →


Friday September 29, 2017 10:30am - 11:30am
Atanasoff Hall Meydenbauer Center