Typescript's type system - From solving puzzles to proving facts of program

location_city Online schedule Mar 25th 02:30 - 03:15 PM IST place Zoom people 41 Interested

Typescript has gained a lot of traction with majority of javascript frameworks adopting it and gaining the power of static types.

Given the Typescript types are a language themselves and they are Turing complete, lets put our type flavoured favourite language of the web to test - for fun & profit.

With the advent of fp-ts, typescript's boundary to statically type FP algebras like Functor, Monoid & Monad are just a import away!.

But why restrict ourselves when we can achieve more with almost "Dependent types" in typescript - Like solving logical puzzles to proving properties of the program (like type level regex check, indexed list & matrices etc) for correctness.

 
 

Outline/Structure of the Demonstration

Basics of Typescript's Type system - 0 to 15 minutes

1. Structural Typing

2. Generics

3. Assertions

Introduction to Functional programming in typescript - fp-ts - 15 to 20 minutes

1. Functor, Monoid & Monad in fp-ts

20 to 30 minutes - Prolog & Logical Programming

1. Intro to Prolog & logical programming

2. Solving simple puzzles

3. Encoding Type level logic in typescript - https://itnext.io/solving-riddles-with-0-lines-of-program-b23994072dd0

Proving properties of program - Propositions as Types - 30 to 45 minutes

1. Indexed list

2. Indexed Matrix

3. Template literals

4. Typelevel lexers & parsers!

5. Propositions as types - Thank you Philip Wadler for the amazing introduction to this fascinating world! - https://www.youtube.com/watch?v=IOiZatlZtGU

 

Learning Outcome

Ability to use strong types in day to day encounters and avoid potential errors & breakages that might be caused in the due course. And also pushing the limits of Typescript's types system to its utmost limit - right from solving logical puzzles to proving properties of program.

Target Audience

Beginners & Mid level in FP. Introductory session on strong types in Typescript

Prerequisites for Attendees

Basic understanding of programming and little knowledge in javascript.

Video


schedule Submitted 9 months ago

Public Feedback


    • Bruce Tate
      keyboard_arrow_down

      Bruce Tate / Francesco Cesarini - Navigating the loop in water, on land and in programming models

      45 Mins
      Keynote
      Intermediate

       Loops are among the most critical programming constructs. These features shape core ideas about programming in the Erlang ecosystem; from how languages work to how programming features interact with other code and the outside world. How systems scale and are resilient. They are also metaphors for the way we think, build things, and grow. In Erlang and Elixir, loops define servers that form reliable, fault tolerant and scalable services. This keynote will explore Elixir and Erlang's approach to concurrency with a nautical adventure called the Great Loop.

    • Richard Feldman
      keyboard_arrow_down

      Richard Feldman - The Essence of Functional Programming

      Richard Feldman
      Richard Feldman
      Head of Technology
      NoRedInk
      schedule 5 months ago
      Sold Out!
      45 Mins
      Keynote
      Beginner

      This talk dives into the origins of functional programming, going all the way back to where the term was first introduced, to see how it evolved over time into our modern understanding of what FP essentially involves.

    • Michael Snoyman
      Michael Snoyman
      VP, Engineering
      FP Complete
      schedule 5 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Many of us in the functional programming community believe that FP is a significant improvement over object oriented programming, arguably the dominant programming paradigm today. That of course begs the question: how did an inferior paradigm grab so much mindshare and market share and rise to prominence? I'm going to tell the story a bit differently, exploring a different take on the strengths of OOP, and how that affects those of us who advocate for functional programming.

    • Nikhil Barthwal
      keyboard_arrow_down

      Nikhil Barthwal - Implementing Event-Driven Microservices architecture in Functional language

      Nikhil Barthwal
      Nikhil Barthwal
      Sr. Software Engineer
      Facebook
      schedule 4 months ago
      Sold Out!
      45 Mins
      Tutorial
      Intermediate

      Web services are typically stateless entities, that need to operate at scale at large. Functional paradigm can be used to model these web services work and offer several benefits like scalability, productivity, and correctness. This talk describes how to implement Event-Driven Microservices in functional programming languages with examples in F#.

      Immutability allows infinite scalability as it eliminates the need to worry about a mutex, a lock, or a race. As functional code is much more terse compared to object-oriented code, it provides productivity benefits. Its strict typing makes writing correct code easy as mismatches of types are caught at compile time.

      The objective of the talk is to show how to create a scalable & highly distributed web service in F#, and demonstrate how various characteristics of functional paradigm captures the behavior of such services architecture very naturally.

    • Dave Yarwood
      keyboard_arrow_down

      Dave Yarwood - Clojure through the lens of music

      Dave Yarwood
      Dave Yarwood
      Senior Software Engineer
      Kevel
      schedule 4 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      You may be familiar with what map, filter, and reduce do. But have you ever heard how these functions sound?

      The Alda language is centered around the idea that music can be represented as data. alda-clj is a Clojure library that maps Clojure data structures to the music theory concepts in the Alda language, including notes and chords. The library serves as an interface that takes Clojure code as input and produces music as output.

      In addition to the basic functions that you will find in the standard libraries of most functional programming languages, Clojure's standard library offers a wealth of interesting and useful functions that facilitate working with immutable data. In this talk, we will explore the Clojure standard library by applying interesting functions like cycle, mapcat, partition and reductions to transform data that represents music. Using the alda-clj library, we will not only see the result of each function call, we will also hear the results and observe how they can help us understand how each function works.

    • Greg Mefford
      keyboard_arrow_down

      Greg Mefford - Living the XKCD 927 Dream with OpenTelemetry 1.0

      Greg Mefford
      Greg Mefford
      Principal Full-Stack Engineer
      Stord
      schedule 4 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Have you ever experienced vendor lock-in from your observability tooling? Don't you wish you could instrument your code once and send telemetry data to multiple vendors to see what their platforms have to offer before signing a contract and investing a lot of engineering time?

      The future is now, with OpenTelemetry!

      OpenTelemetry has finally reached general availability, with the Erlang and Elixir library leading the way as one of the first official implementations to be compliant with this new industry specification. Now is the time to start thinking about how to get your services instrumented using this exciting new vendor-neutral instrumentation.

      This talk will quickly cover the basics you need to know to get started and send data to both open-source tooling and vendor platforms, so that you can get the observability you need, without being locked into a specific vendor's instrumentation library!

    • John Azariah
      keyboard_arrow_down

      John Azariah - Nature-Inspired Optimization Algorithms with F#

      John Azariah
      John Azariah
      Principal SDE
      Microsoft
      schedule 4 months ago
      Sold Out!
      45 Mins
      Talk
      Intermediate

      Quantum Computing is all the rage these days, but, as an emerging technology, it's difficult to find practical applications right away. One area which allows us to invest in a quantum future is to use quantum- and nature- inspired optimization algorithms, which can run on classical computing infrastructure today and leverage quantum hardware when it is available.

      In this talk, I'd like to give a short overview of the state of the art in quantum computing, and introduce two widely used optimization algorithms made better in F# with functional principles.

    • Alfonso Garcia-Caro
      keyboard_arrow_down

      Alfonso Garcia-Caro - Beyond: Crossing the Platform Boundaries with F# and Fable

      Alfonso Garcia-Caro
      Alfonso Garcia-Caro
      Software Developer
      Freelancer
      schedule 5 months ago
      Sold Out!
      45 Mins
      Talk
      Beginner

      Fable is an F# to JS compiler that has been successfully used in production by thousands of developers for more than 5 years. Thanks to steady improvements and a great community and ecosystem, including the SAFE stack, the Elmish architecture and the Feliz React API, it has become one of the best options to write robust, succinct and performant web applications nowadays.

      Fable was originally designed to integrate F# with the JS ecosystem instead of trying it to hide it. With this same philosophy, the Fable team is working now to target other languages beyond .NET and JS. There are already working prototypes to compile F# into Php, Python and Rust code, and we expect to release a beta in the upcoming months. Let's see how Fable 4 will further empower F# and functional programmers!

    • Grahame Dixon
      keyboard_arrow_down

      Grahame Dixon - Extending Railway Oriented Programming in Elm to Make Complex User Flows Simple

      20 Mins
      Talk
      Intermediate

      What do you do with a multi-step function with different kinds of user input that may be required at different steps? 

      I'm using Elm to build a game client for Codex, a complex strategy board game by David Sirlin with lots of interesting side effects in the game design. The pure functional programming of Elm is very powerful for managing these side effects, but how should I handle when there are many different kinds of user input required to complete the behaviour of a single feature?

      There’s a “railway oriented programming” metaphor to understand how to handle multiple-steps of errors. I’ll extend this metaphor – with stations – to show how to make what looks like a complex functional problem into a simple pattern of abstraction.

      Some familiarity with functional programming idioms is recommended, though the examples themselves are easy to follow. Attendees will walk away seeing functional programming applied in a fresh way, perhaps opening their mind to alternative perspectives to approach the complicated problems in their projects.

    • Dhananjay Nene
      keyboard_arrow_down

      Dhananjay Nene - Snippets from an algorithmic trading system in Kotlin

      45 Mins
      Talk
      Intermediate

      This talk will introduce the audience to algorithmic trading, the design of an algorithmic trading system, and various snippets written in Kotlin that fulfil specific tasks that collectively contribute towards a full trading system. The rough sketch will be as follows

    • Akshay Kumar Arumugasamy
      keyboard_arrow_down

      Akshay Kumar Arumugasamy / Christopher Anand - Teaching Functional Programming to Children

      20 Mins
      Talk
      Beginner

      Is functional programming for experts? We have found that children learning programming also benefit!

      Over the last 5 years, we have taught 25K children through the McMaster University’s outreach program McMaster Start Coding (Canada), and started training undergraduates from peer institutions, including Vellore Institute of Technology, Cihan University (Kurdistan), and Narasu’s Sarathy Institute of Technology (India), so that they they can create their own programs.

      Our main motivation for teaching functional programming to children is the similarity between algebra and functional programming. Algebra is a barrier to secondary and postsecondary education, and helping children overcome this barrier can have a huge impact.

      We continued to develop our program because both children and teachers loved it. Children find it easy to learn about functions when the functions draw shapes on their screen using a compositional language they find easy to learn. Teachers love it, because children immediately understand concepts including Cartesian coordinates which are difficult to motivate for some.

      In this talk we will explain the design philosophy behind our open-source graphics library GraphicSVG for Elm, and why we think Elm (with pure functions, and well-typed standard library) is the best language to teach 10- to 14-year olds.

      We will give you a toolkit for advocating functional programming in your local schools, and show what children can create, including children from Vikas School in Hyderabad who were isolating at home with only a smartphone to learn programming on.

    • Phillip Carter
      keyboard_arrow_down

      Phillip Carter - 5 years of trying to get people to use an FP language

      Phillip Carter
      Phillip Carter
      Senior Product Manager
      Honeycomb
      schedule 4 months ago
      Sold Out!
      45 Mins
      Case Study
      Beginner

      At Microsoft, Phillip worked on the F# language and tools from 2016 to 2021. In this talk, Phillip will recount the various strategies he and his team used to try and increase adoption of F#, and by extension, FP as a whole. Over this period of time, the F# language evolved and grew its user base substantially.

      Lots of experiments to increase adoption were tried, such as pivoting to data science, and most failed ... but some succeeded, hinting at some paths to adoption for FP that don't just involve a more mainstream language appropriating FP features. If you're interested in storytelling, learning about fun ways things failed, and curious about some things that succeeded in increasing adoption, check out this talk!

    help